From patchwork Mon Jun 7 23:03:39 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: 28158 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp3890412iof; Mon, 7 Jun 2021 16:11:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/sXGqkXOU402UIQxKmDFTfxvk8lIh+Y+LCtt77OZ3cKzAQPas3oDVgFUaPRIMBtBsfVJm X-Received: by 2002:a17:907:3e04:: with SMTP id hp4mr9743431ejc.473.1623107493445; Mon, 07 Jun 2021 16:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623107493; cv=none; d=google.com; s=arc-20160816; b=iRXTbt7+2zufz4bmPP8wK33AXyGlltE/issiAtddHwcwL2pI6nIv6G6P+f7acad/u4 YGNnkXXASb7X4DmYnGv75EmAG3wd2POIAHyjOhcKOVJIGzgipwGJ2Jlgkd1jXfw6+Bob EyiG6WuSfWaEi3AyIM3TBAJN7jI0Se57G+RZa/Zd/2rsNyevcnxzXTMtRxC3F5wnKm3S MjkHvp10EshMjEaI8qCSX/OGsAOHj+ovFHoLTFWa/dNhmmthFSy7DsT63HC7SH2Ulj8a 1mxYW4eeiPl1rYKeDggYy0HL9OqkDOQPaVAHUvEoKlI0r45PaL6egp+tdFvWsjRUfpkr dHgA== 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=QzFwnMXhG9lqYquSKHWjh16X3IOfgy1rmZWev8dHNw8=; b=M/TzXONCNpDhiYvp08v+SfzxvuVxYjpZlzTWthnH6erOicTzVo98XK3UAS7E7WVz3G St+uNpM7uIp5x8VWctUpaj/t+pNHMIJllvpvABOE5zTHXnJk6jQRxGzULCLOJsN/X//H Ggh4Bhu79ccjslwt2uqODBFw4ZZCMNptnr+GYu/HggnmWyKm/S1e9uqUz+7TYBdAy9BF Hz1qB5HhU2UmMsOtPxMhbHBmqq4aE3zGeVMVbiHA0H73rsbpQQxLlbhqYe3oLpL+rqJd HZyZcX6ON2NvRU23ahhyJ2NOYj3QIWYZ3fABzpgUuQu6O9HafQGuI+XMFtV4vEXVr6P5 vL+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=tJXsOpeA; 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 4si12445384ejb.4.2021.06.07.16.11.33; Mon, 07 Jun 2021 16:11:33 -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=tJXsOpeA; 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 9B914688140; Tue, 8 Jun 2021 02:11:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F013668002C for ; Tue, 8 Jun 2021 02:11:23 +0300 (EEST) Received: by mail-lf1-f48.google.com with SMTP id v8so28982657lft.8 for ; Mon, 07 Jun 2021 16:11:23 -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=pab+BY31FynPhKaCYjdIPe62oHixUz/CsElebFkruBQ=; b=tJXsOpeAIHPL++DRPvgvAPmTC0lQMBsfLEG1cvWU6xtpj/rkEaXmKlOS0vz9m4+G8S Pe4oPym80CWzUUIS1dzRJjyEbI3VbwUB/1JkjHOmvV7mEb1Vy88lLzTIFv5pblr/6mu3 /ZkuEXx1kfi07JWig0VoOmkzw/V1+6e+MBWEre+E4TxxO7MoL8PtFymtk8ZUUhru6ZEM LSnv85QstSdJfoXxIYnloxE1lbpg2xxTq9lIDJ/RA8hJLgmTiVihsUvvS/+7PxskpaTF PeuXisZiMycSjXMwS2t4GfEGP3yWLKH2xrMCQifWNbR+EOToOXv2mCaO1oqULxUa0xkQ 7zOw== 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=pab+BY31FynPhKaCYjdIPe62oHixUz/CsElebFkruBQ=; b=neK3D5RFzweGUUBbvk9wRUiSgcYpVvtxApxD+Yprr2KMeRlgZl/Dom++zOnvech1WV fGcc4D+SaoXZCC2FpG9cKnoYgGX7DfqzT6XjzcZ3z0qQuCf2s+M+1NO/AIaDosFQD/JM hgI1aKxvZpB5Q0D+5PBEnX4dwfK1brSYtLbQqCg7BJVFE3dFgB/jWdkds8vb/srVgbIw BgM2DGrpTeK55UzaX5MmIWO8Ax04+rPwg4KhzqBoY++vFLhQpxDKgV/yb9igTlNFWxYj E8INu/XtT5HyP987vTvRN/arxvbemCRX5KTPmUATxN4hzV8ghF3HNww/1X5JLRbB532+ yPLg== X-Gm-Message-State: AOAM532mfphRiFOsK4TE4ILzNYqFJLoNZYPKEQU8jU13UxbSNkHt28FS nvawaKq34ZBIHuDHfwsxGn+WkLURIZK9zw== X-Received: by 2002:a05:651c:1202:: with SMTP id i2mr14766054lja.323.1623107066266; Mon, 07 Jun 2021 16:04:26 -0700 (PDT) Received: from localhost.localdomain (84-217-56-54.customers.ownit.se. [84.217.56.54]) by smtp.gmail.com with ESMTPSA id v9sm1999563ljv.131.2021.06.07.16.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 16:04:25 -0700 (PDT) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Jun 2021 01:03:39 +0200 Message-Id: <20210607230414.612-1-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 00/35] 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: 5hnAPliOA05u This patch series implements a series of features, mostly enhancing the dshow avdevice, but also adding new functionality to avformat and avutil. 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. [PATCH 29/35] avdevice/dshow: implement capabilities API and [PATCH 32/35] examples: adding device_get_capabilities example have incorporated all of Andreas Rheinhardt's review comments. Querying the capabilities of a dshow device is now 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 (35): 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 avformat: avdevice capabilities API details no longer public avformat: cosmetics avutil/opt: AVOptionRange gains is_set field. avutil/opt: add av_opt_to_string avdevice: Add internal helpers for querying device capabilities 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() 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 | 192 ++++ doc/indevs.texi | 6 + fftools/cmdutils.c | 41 +- libavdevice/avdevice.c | 94 +- libavdevice/avdevice.h | 59 +- libavdevice/dshow.c | 1372 +++++++++++++++++++++--- libavdevice/dshow_capture.h | 12 + libavdevice/dshow_crossbar.c | 95 +- libavdevice/dshow_pin.c | 46 +- libavdevice/internal.h | 64 ++ libavdevice/utils.c | 48 + libavdevice/version.h | 4 +- libavformat/avformat.h | 57 +- libavformat/utils.c | 66 +- libavformat/version.h | 4 +- libavutil/opt.c | 94 +- libavutil/opt.h | 17 +- libavutil/version.h | 2 +- 22 files changed, 2021 insertions(+), 303 deletions(-) create mode 100644 doc/examples/device_get_capabilities.c