From patchwork Tue Jul 6 09:19:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Diederick C. Niehorster" X-Patchwork-Id: 28817 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5d:965a:0:0:0:0:0 with SMTP id d26csp4935950ios; Tue, 6 Jul 2021 02:47:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSD+LxsCqJyp0YqA+83Kguddi53YyGp5x1sXslNPx7G1RmiVamNsVCh4clW9XPbDO4xaM2 X-Received: by 2002:a05:6402:3507:: with SMTP id b7mr22153061edd.66.1625564867360; Tue, 06 Jul 2021 02:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625564867; cv=none; d=google.com; s=arc-20160816; b=uXk+bjrzzuc61CEcej4AHSU9Od7SvEw8VB1Pvre+y6Pe6sTiNhq2mjt9Cw5sas41YB INtR1GKZNq02TLPzRObly3Djdlhhrzgpe6jZkkD746Qqc0d+RBC8H9SZcdvsH1mGyxYB egvciv0jEfHtv3BFCCalC3ZeOTg2irVaDOe228bHlDhlAIHJBomtCC6vnTDKOLTt8Zgq VFWbx0nZMv6rIx/djyl93MrFbfkf0M/fYytky5GHcedzHa0+hZWcWHegUaPvIBM80AIf aTgk4s4LltFz/4hIz8+wjrMFVfWCai5zWrRBKMBxuh56k2wjqCecjZyT0Cn/MmSEF+wh tZAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=wCqQaxKIT8NFmQxQZo3TyRq9Krj5wNG+8kY8ulVLURg=; b=ExhTjdpi1Tcrz5gKHoQ4x1jBpXCIT18q7Z0arW24EMyIfoaUqoURTUBmuW3UcYB1Zh I6tlErzd2MW1EzVacZN72xEXRJm6ijQaGUqQ3V7aTkz8RcqnIztDIWdxJI27arC8JuOv JSqOF8rWrJdFqXSw/9JnQcXoZOWGtGWQ41fXn0tVat2b8FU5zYhck4bEeG+1C+IA6R/b VnMjNtnhGysV2Eh2tBSIrRIjY10HRT36ks8inR8ei3L1eVQvKMHAFiceIqcxRTnLY1X7 HOwNLDpG0yLUMx/9pfobZ9r83X3UOGKEiGqWslevFZen7+P4tZ3f3wHWA7AlWHRq8PeB 3Faw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=AJeiskOh; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f21si14304522edy.196.2021.07.06.02.47.46; Tue, 06 Jul 2021 02:47:47 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=AJeiskOh; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9FE5B68A81B; Tue, 6 Jul 2021 12:47:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DB62968A407 for ; Tue, 6 Jul 2021 12:47:36 +0300 (EEST) Received: by mail-lj1-f181.google.com with SMTP id t30so8312647ljo.5 for ; Tue, 06 Jul 2021 02:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fV4ArN8iwL6biioZvsj6GfRiciutijqcgCmIl08gwCU=; b=AJeiskOhNmroLvQ0hnA9ZqzmbJesCuFvsTW0hoav4DKqXHAaLhri4tvXGAuRbLRj98 dISOQPxXTEK8aH23CCI4tEPEef+WY91Ff23lTREm/S8Jj+b6a4PfMI25W2ftiEaIoUKN 8e2NRqmL5yV4FPDHGlxnGLgzfCPmM+WC6qAPS2xOUty+39VoL6F3vJ3bnS6wK1136cbf 1nH/RTj3PTr8jDSUHsdvRj9Y4DI2D4nbjIr2MsZxyjdAlDtI9AGEzeTppBakIL3QMDCM SWl3/6PrIOuM9ob/jpYw3Ug7XjhfNtm7mYeP/yQR/DAFH2Q1Os/fnmEDKQ50LwtxEXlR H5Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fV4ArN8iwL6biioZvsj6GfRiciutijqcgCmIl08gwCU=; b=Nge7MTZq0hurI7PdKUh6LMMX/A+kb/DjMJN4t2xZLHxJtSiyDyzVdKpTDaH7NBr63B UIb2ynWAmO5zMo8+D3TfWpgWzV651sfRV1Ora/NWGgb6dtPrRZFsZ18VtuN7O/SvxoOO RwMYtnSUtUj4k3ebEM3NAkF6+WWARHKMSKQjLT7XDT0v5zM7AMV7fN/t2EQc8yBE+iqW Zg1QP6arajzoSnwpHoFoJe1LkGoURsldNqTCL1dT0m4HfH9UPIqwl09zEdOC/A0uhQvD lE32VMFs888HWW7wzuQEP2qM8zsVDb2QneLEV6+lJbGApacRycYppUvjLWMbCVlYI6WA k8Qw== X-Gm-Message-State: AOAM530s8joXO4WINrmeVqIlARiqQGmg/H+KmD6V5XjVI894g3lMUh/8 Z5faO7i+XyPwokcCRigFocZlaQd13JQ= X-Received: by 2002:a05:651c:1032:: with SMTP id w18mr14832840ljm.34.1625563254717; Tue, 06 Jul 2021 02:20:54 -0700 (PDT) Received: from localhost.localdomain (deedock.humlab.lu.se. [130.235.135.183]) by smtp.gmail.com with ESMTPSA id b14sm1342416lfb.149.2021.07.06.02.20.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 02:20:54 -0700 (PDT) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Tue, 6 Jul 2021 11:19:46 +0200 Message-Id: <20210706092020.1057-1-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 00/34] avdevice (mostly dshow) enhancements X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Diederick Niehorster Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: DNEm3W6g51nq This patch series implements a series of features, mostly enhancing the dshow avdevice, but also adding new functionality to avformat. This whole patchset enabled users of the FFmpeg API to fully query and control a dshow device, making FFmpeg a nice backend for any program that needs access to, e.g., a webcam. Different from v2, a print helper function for return values from the avdevice capabilities API is now in avdevice instead of avutil, as making it specific to avdevice allows for better output. Querying the capabilities of a dshow device is also possible on a device that is already opened. I expect/guess however that it may not be possible to achieve that for all of the avdevices, so in principle it is important that this patchset adds the ability to create an allocated but unopened AVFormatContext+AVInputFormat with the new function avformat_alloc_input_context(). Diederick Niehorster (34): avdevice/dshow: implement option to use device video timestamps avdevice/dshow: add use_video_device_timestamps to docs avdevice/dshow: query graph and sample time only once avdevice/dshow: handle unknown sample time avdevice/dshow: set no-seek flags avdevice/dshow: implement get_device_list avdevice/dshow: list_devices: show media type(s) per device avdevice: add info about media types(s) to AVDeviceInfo avdevice/dshow: add media type info to get_device_list fftools: provide media type info for devices avformat: add control_message function to AVInputFormat avdevice/dshow: implement control_message interface avdevice: adding control message requesting to show config dialog avdevice/dshow: accept show config dialog control message avdevice/dshow: tv_tuner_audio_dialog cleanup missing avdevice/dshow: add config dialog command for crossbar and tv tuner avdevice/dshow: discover source color range/space/etc avdevice/dshow: select format with extended color info avdevice/avdevice: Revert "Deprecate AVDevice Capabilities API" avdevice/avdevice: clean up avdevice_capabilities_create avdevice: capabilities API details no longer public avutil/opt: document AVOptionRange min_value > max_value avdevice: Add internal helpers for querying device capabilities avdevice: change device capabilities option type avdevice: improve capabilities' option API avdevice/dshow: move audio format helpers avdevice/dshow: when closing, set context fields back to zero avdevice/dshow: implement capabilities API avdevice/dshow: cosmetics avformat: add avformat_alloc_input_context() doc/examples: adding device_get_capabilities example Makefile/examples: cosmetics avdevice/dshow: prevent NULL access avdevice/dshow: capabilities query also works on opened device configure | 2 + doc/examples/.gitignore | 1 + doc/examples/Makefile | 47 +- doc/examples/Makefile.example | 1 + doc/examples/device_get_capabilities.c | 243 ++++ doc/indevs.texi | 40 + fftools/cmdutils.c | 34 +- libavdevice/avdevice.c | 165 ++- libavdevice/avdevice.h | 103 +- libavdevice/dshow.c | 1445 +++++++++++++++++++++--- libavdevice/dshow_capture.h | 15 + libavdevice/dshow_crossbar.c | 95 +- libavdevice/dshow_pin.c | 46 +- libavdevice/internal.h | 66 ++ libavdevice/utils.c | 48 + libavdevice/version.h | 2 +- libavformat/avformat.h | 56 +- libavformat/utils.c | 74 +- libavutil/opt.c | 2 +- libavutil/opt.h | 5 + 20 files changed, 2179 insertions(+), 311 deletions(-) create mode 100644 doc/examples/device_get_capabilities.c