From patchwork Fri Mar 25 14:10:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Diederick C. Niehorster" X-Patchwork-Id: 34674 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:ab0:5fda:0:0:0:0:0 with SMTP id g26csp1376247uaj; Fri, 25 Mar 2022 07:11:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjdlw6AdE+vZLx3XruNhgj6MzFgj0KVilrsNg/0oLz+6dK1NzCPU9ieLxCZyrhqVuPmskK X-Received: by 2002:a05:6402:2688:b0:419:5dde:4700 with SMTP id w8-20020a056402268800b004195dde4700mr13536285edd.124.1648217470421; Fri, 25 Mar 2022 07:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648217470; cv=none; d=google.com; s=arc-20160816; b=jH9+OrM0kz9bYlunBQBzeZWpxzvzTncG0OOAYMBp+olCcUJwmosYjOMP8sqRP5SBBZ LbsmBglVVNfo3EokuM8WXP/0ofmnxQH1mXJ3csnC1xpb2JfARcyADhE1ZzRLUcWsczPC 2paQ3Cquvn0a5y/cWjNvgh4PDUH+Ry9qrXw9IcJRmsQUombLhvFEWiYmULFu3QDJCD/M RhZQb2LvhJ2a5zTv+Ut6aKHdRMZ+Ji4lFjh3NuoGHtACvo222fwkbQpaG8x1hSrsatDC d7W8xaxGaaQuSTtAVFDAu4Fq8kyHRAVM+AA7DWk91BTBqF34rbMlmhh3E/YpP/HfReig +P4A== 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=LlXsOceKDiPxpsjzFk67o5O0dzBM9WyG+Or2zPeJPds=; b=hBNeaEU9uRaUK04233jXfcie1kRfy2lPnSJONFOm/EY6AnuGosi2UqMhqOFNP80bsC G0lh8nCsmG5Q3uq9dA+eY4cT6iwCCCwXUmJEShYSvx00jf4KkmNj76aYw8FRi1rO2gC0 B7Dfo7SXkqUapzl3kZNv1nWjp+d9OiXttl9a0dv2Lf7zp9r+/Jfd8GaaPbQ+mZZUXbzX s+2KT1aqhaGiq3Tvkpq1wth0qs3nASAklI7WWQjjBryq96KAdiyRp7wbtxBKw++Bg6T/ fuCw4iH+4wWDseUhdxdCMQWRFAmFRz1z7Oiy3T3LYvdFmo8X3Ukr1WoHfVMot3xAm8qU kZDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=h3HFbp4R; 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 ay6-20020a170906d28600b006dffbac9704si2565683ejb.747.2022.03.25.07.11.09; Fri, 25 Mar 2022 07:11:10 -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=20210112 header.b=h3HFbp4R; 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 7740868B192; Fri, 25 Mar 2022 16:11:05 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7F77268B192 for ; Fri, 25 Mar 2022 16:10:58 +0200 (EET) Received: by mail-lj1-f169.google.com with SMTP id q14so10445510ljc.12 for ; Fri, 25 Mar 2022 07:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=funaBG/rXNoGNqIKx9SLwQpMHERYbrR5NthLacBI58I=; b=h3HFbp4RkzrFF5+uwh7Jy5n2exVXk17sGaD2+ohWN/AE6AvQB33LqoMNE3UBaTCzib xWknD1RmIGvz9q8I5kfo2Obs4XVO9IWE87cqwSnzdfzRjlrY/z4OBwd9NOO2YnrDD6Ow pwzinVnqH+UpAkmKPEMp5nvEG/1Alb7bBB48caulJlq7CzGDxheexpb3HQCf72LBKgHK wOuS7v6x1EgWziajrQPq/uaMmxZVdlNg15GGVYAy4O6DYZlkgGesTRSeVsQoJ/eAsPA6 IZOIXqdr04TPZRbOqzvAQiCDtLyRfGrCmqKKBN1+UI3hAGzoR5alOftEqMlxVrgI7d6P nJuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=funaBG/rXNoGNqIKx9SLwQpMHERYbrR5NthLacBI58I=; b=VhRS3X+3zx5RheQjMHZ0uGDfa2GsRdMTviL0smYn1Hbw25xaXa9xgE40JzwM+DlK6X T/FO+kHnqqk9wiUEzsOuj89RNZVHyzBgnbMPKDNgBdDHu7Ek1BbsYHoNf65ZVkpqx4dR Cv35oivj0mgDN2RMp2GlJNt1t25IagjdDKc2Q20atxeV/k8h5mfg9SSkZp6eVMYWTQmi /6+99Pd639auFDqSjcpDcDKqjO+IuRKISRRql1k4izd9Goo1XKBzFtflp3q41d069SzO LDmbxGM5+nKOhMXrbR1ie3VXyzhQGSb0rEiy0ewWdQJ9mimVVHbfBYneex0oDn+exXSJ NC9g== X-Gm-Message-State: AOAM533fBY9s1YrxoWdQaXzwQyTbL7coNN6JuhlbKw9nA1kq/sLNTpLE ikXDodm4dsnPWBgd41wXlM8mORtlSW4= X-Received: by 2002:a2e:9c12:0:b0:249:9927:edac with SMTP id s18-20020a2e9c12000000b002499927edacmr8134144lji.47.1648217457395; Fri, 25 Mar 2022 07:10:57 -0700 (PDT) Received: from localhost.localdomain (deedock.humlab.lu.se. [130.235.135.183]) by smtp.gmail.com with ESMTPSA id r3-20020ac25f83000000b0044a3b37d30csm715809lfe.214.2022.03.25.07.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 07:10:56 -0700 (PDT) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Fri, 25 Mar 2022 15:10:19 +0100 Message-Id: <20220325141041.1748-1-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 00/22] 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: 4rEy8zxMqDbg 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 v3, part of the patches has now been accepted, so only remaining features are in this set. Importantly, as per discussion on the list ( https://ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281513.html, see especially https://ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281586.html), to resolve the the unholy ABI-relationship between libavdevice and libavformat and allow easier working on the part of the avdevice API that lives in avformat, avdevice is now locked to a specific major and minor version of avformat. This is documented in libavdevice/avdevice.h. Regarding new functionality added to avformat: 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(). This is tested in the new device_get_capabilities example. Diederick Niehorster (22): avdevice/dshow: fix regression avdevice: lock to minor version of avformat avformat: add control_message function to AVInputFormat avdevice/dshow: implement control_message interface avdevice: add control message requesting to show config dialog avdevice/dshow: accept show config dialog control message avdevice/dshow: add config dialog command for crossbar and tv tuner 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: 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 | 34 ++ libavdevice/avdevice.c | 177 ++++++- libavdevice/avdevice.h | 111 ++--- libavdevice/dshow.c | 662 ++++++++++++++++++++++--- libavdevice/dshow_capture.h | 14 + libavdevice/dshow_crossbar.c | 91 ++-- libavdevice/internal.h | 66 +++ libavdevice/utils.c | 48 ++ libavdevice/version.h | 15 +- libavdevice/version_major.h | 2 +- libavformat/avformat.h | 59 ++- libavformat/demux.c | 74 ++- libavformat/utils.c | 5 + libavformat/version.h | 14 +- libavutil/avutil.h | 3 + libavutil/macros.h | 3 + libavutil/opt.c | 2 +- libavutil/opt.h | 5 + 23 files changed, 1467 insertions(+), 212 deletions(-) create mode 100644 doc/examples/device_get_capabilities.c