From patchwork Wed Mar 30 12:17:45 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: 34678 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp773587pzb; Wed, 30 Mar 2022 05:18:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVQCVDuumy3Haw/wopGBqg2yJJlDA5Kkly/TQDoMaava/aRZw5fF9AxIXE+KecybHFx4AZ X-Received: by 2002:a17:906:5ad6:b0:6e0:1799:4a15 with SMTP id x22-20020a1709065ad600b006e017994a15mr40952163ejs.594.1648642712017; Wed, 30 Mar 2022 05:18:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648642712; cv=none; d=google.com; s=arc-20160816; b=skowhXwdD8v7nDVGBUjry9wIIzospXNo4EuJ/q4Dh51z9WYjP6w81QIOTyNEW8LrhI aOPzpEtTvWJ3qFadt5vsEhCX1kqTDbK67RaXIhT+X3/BSD2KZYcSQDgVCwdQ6KKCOmkV Qbr9W7sisfrqU67QpBSBYstODEE2B81E/5dI6J/hU3iIki9UmFbzAoi++tcxFuJjuzRu bnYSTovIu9/LXnOud3GlzcRbSRfZ8F0hYD18ab7m0ViPx82PwjCcClq6TtLBWszK1Wwj wRg4H4V5jpwrdP3ofuPNEhfHz5Fyl6+w6JWyO7763fyFkR76LfvzCtn+bMaM0gBxC0iX oFiQ== 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=Kw037PKemNT4VGXBRT28jsYCZadsbVYYj23tjWxwxs8=; b=CDtUearOhwzxNPjejlKPfvL0G4CQJwBudrkL/tV60G+1vw5GOr2SZqd5uupj+m4o/f Y7MR9MrR5HLTePt8F9nY0DWDglm7LDCiUDpfgYHNnZQWE9t2FrAquqpztuuFxVD6MD1O xHyqqR4nZEXlJJI4VjNW9kyLp40yYY5SLQGYgItZDUcRcBfo2S/+874pRIUoLX4D5vxH 5sVSM5HkXTaD8P3aoGFg5NNTv03Ct7Iz+yDqiuyDNqZOOznuWf5y1bAU1UGO56gjAFgg 6FvUok3jvXw4ySxe+0UBhKMYZzi3O5NI2BfIFsms7MNxMyQB7wpUHI6Lgh+m2y0Nw/18 HjIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=nOB8tGky; 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 q19-20020a170906b29300b006df76385f44si19682806ejz.996.2022.03.30.05.18.31; Wed, 30 Mar 2022 05:18:31 -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=nOB8tGky; 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 0B36368B13C; Wed, 30 Mar 2022 15:18:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2245668AB17 for ; Wed, 30 Mar 2022 15:18:21 +0300 (EEST) Received: by mail-lj1-f178.google.com with SMTP id c15so27384435ljr.9 for ; Wed, 30 Mar 2022 05:18:21 -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=Tx8zrCBdhlreRJ2p0oJ36gXS+gDgTV1SdcEVxAp5cMw=; b=nOB8tGkyoZ9QuFmlQ5iwMGzAm6/JMNT68pFwwL2unOqyi2QdBR9cObiIzKGa3IvSba 1/krADKK4KgxA4lzKkV5rJcVTFqS8XOjGp/jgXn+PnROlCW3saAaKOz0ClStolcRAPjZ lMK251HNGIcQzjoC2prDOPFAlQsexfuxRBXKr7mklLVyicpmcayzMUGTlLqp/MZRI9tp 2QnvYM5huqPg/W2lYzZfx9cojHgPkBgR1AdrT0JVZxX1a2Len6wH+5uEypEwHaTQkDbx I8oMU3yJckKv3yeir8rR4xs+VYOW/KwznpaG7WPVkciSDguTu2r4Scnw+8bUSHzbjA5f 9NRw== 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=Tx8zrCBdhlreRJ2p0oJ36gXS+gDgTV1SdcEVxAp5cMw=; b=VBNGlV6zgzwaIzi0+8AxQJewBDYa58ZXhNaULrAiazVm39T+ONBZROYwh1rLwD4xSE cLs9YidV+SankUlpNL5Wf3WvrTw46wBUtB1Un0lMpS3v6QPxK3cXjcNGtfUy7vDXVzUS 6TDMWEfTE21zMKjTWskXY+opzEKTN6wLQXCnKNwCRWGZMzaf7xXhF6nuDaPtwPPutlGE bP7GrhhH6St2+Flc6mwd8/dvfvFKhQjPY2uqD4ZjVi1/ZpfiuMek15Pu4BIFuM1KhO0t zmhR7RSZCNLOHQFhkXI4cd5bQ4Boe3QKRdHL0AUrWPTF2JBJWhoAoKoMUhk9qm3pcYT5 EhUg== X-Gm-Message-State: AOAM531cpFGKtpypqcMj346nQdDgm8IPeFb7wDr5HG/DgQ7GATN/Jxv+ CI568wh1jhWfxFecdPRjPF+1evTHc64= X-Received: by 2002:a2e:3517:0:b0:247:f48a:7c35 with SMTP id z23-20020a2e3517000000b00247f48a7c35mr6211502ljz.217.1648642699440; Wed, 30 Mar 2022 05:18:19 -0700 (PDT) Received: from localhost.localdomain (deedock.humlab.lu.se. [130.235.135.183]) by smtp.gmail.com with ESMTPSA id p41-20020a05651213a900b00443e2c39fc4sm2318669lfa.111.2022.03.30.05.18.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 05:18:18 -0700 (PDT) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Wed, 30 Mar 2022 14:17:45 +0200 Message-Id: <20220330121806.822-1-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v5 00/21] 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: 87h2HgDvvv+3 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 and v4, 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 (21): 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 | 641 +++++++++++++++++++++++-- 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, 1462 insertions(+), 196 deletions(-) create mode 100644 doc/examples/device_get_capabilities.c