From patchwork Fri Jun 11 20:30:31 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: 28220 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:c91a:0:0:0:0:0 with SMTP id z26csp765605iol; Fri, 11 Jun 2021 13:37:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCFkKIWZFBK+ey+jdkOCev4sw3+kPEspUwyyuxsq9jjESnb8FIb3hZUaM1qCJMlXlW5GDN X-Received: by 2002:aa7:c7cd:: with SMTP id o13mr5547964eds.269.1623443859611; Fri, 11 Jun 2021 13:37:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623443859; cv=none; d=google.com; s=arc-20160816; b=ZijuaO6hqZLSkYb+SDq5uWN/J2VKw7tmwtd5IpvAbnHUEJznvWI9d2xrl79S3sPWNm Dvh2VIt9j5maJFjRb5SPHVLQR2Jubx7KacDVVmHuyxwj6X1W30H2xZHdNmHENMsf/696 yiO5TKJLJZQt57aNLx8BN+URFBsfyXGYZbdDA/yQPvyURZsk0nriFucCLUAP90PJRq4B /74pICDvmo+VQ0Gp43fcA+axFCYX3n6kjxrbma/1sLsmNDH6j92VlcQHlte2FEo/7TP4 Knj9hXBBP6uJ/1eKm5cZRiznKNDenyrK8p3trQcWIDxJVtIYkzt8kn/MJbUV4E6awAyc 08kA== 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=wp1ub6FSnRJAQnBJxF/vxOjHSU7YXHyZZvq+GUqIsp0=; b=wu/fqnnEXqbQOm8Nl8frPmb8I5ErF40GVRfQYK28nQZgFiE0zR0hCoW+sD5UyDBoMK ND9gfu2HEmJLAnyQrOCGmGTEy5dX1MPUFU1734DN8Z3RZc0wgSmC//LWFvzXuUVR4gLA nebgdHsSe/W9WlxUrvtnBy/ymMwAoKJiFNBMPe/JDTXJJIpnDWfyqAZdcYnJssNqNpFq TwRGFCDUD+yHCSFG2aH2njiZ8PbHwXX9k7CxABduw5J66qTLgx5KKPvsGLdv4HlrPu/y bp9hn6WaOKvn2KmYPe9FdCFCDyGo0MlIWRX6X579qe3z0hpZextAkpdBqkzQKeMRZe6Q 5luA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Y7pC1jqB; 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 q5si6063960ejy.439.2021.06.11.13.37.39; Fri, 11 Jun 2021 13:37:39 -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=Y7pC1jqB; 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 55CE86899B3; Fri, 11 Jun 2021 23:37:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 41EE5689953 for ; Fri, 11 Jun 2021 23:37:21 +0300 (EEST) Received: by mail-wr1-f45.google.com with SMTP id l2so7330851wrw.6 for ; Fri, 11 Jun 2021 13:37:21 -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=iwAs4kCXtfcN3VhOXSeAMROuD5RDDWLf/pzqmGkyeBY=; b=Y7pC1jqBxHf4hswFSa6LauTBoZyb/56VA+9UvS06sOI0uA+3WvYGwj35PMnh8z1Ekw JbNO8g/gsKHnJbCsaDhF3z1Tt+Y6oUhYgVOxty1VpFVRFxCgTSs1oE61Tx5I7XiHizax vxbSyMZlWMP0kBH1ij4eHmbUGVcaBtDFYiTV/nqBg0MiIfNoPKNZZV/ZVGzcBn1HYtpw 8PrvOUisZOms79bwA1B5DhJqGvrNBz6kl9zRfHsN4T+1/4G8QsGO/BIJUnNulwD8C+zR GvOiPN+HePDwQKohWtRoRMfLBIUtleA8nVC+y3C28a8DoQWRJmLK45bVNKbKI6pLJpHr B3zw== 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=iwAs4kCXtfcN3VhOXSeAMROuD5RDDWLf/pzqmGkyeBY=; b=FNUlQwIXk6ZX+7CvKm48cPiWCID+lZ3dIVEdZm3jF5Kr67JXuPSdWfBEbVp4s9epJq 2D8iM4gp2ZzWU0A8t1YJY91vhAX6Y0Wfjj1rrjuKi3U+TGPPb36NUVrGwtye2dzN96k0 2+7Lk0/MKxGRWkWHGfVS4QzAX3kznoZWExldNdoGCEsFAzZSqjOH7D9NyuTBU1drcSyo 7EGpTlHMo1Vh16z10y49gUSTyIt3P1LFTsxle2ufL++2cKVZ0aMxbllKw32P3zMWd2Os tiqaOZx/SAjQHE/OrDPgTZHt4d1QNqg2XgDsEKCDEvGQsFp9VbsmsQjj0T11qIz35baP ngwA== X-Gm-Message-State: AOAM5321LuX+ZZ6rx0USTMqAgAaHNh/Dz2ShJAEXj5WNmdPaqSX/pqtT 616/kPlP0RGDh7wLZBLxuMVgcs2MxQL0ow== X-Received: by 2002:a05:6512:3604:: with SMTP id f4mr3759367lfs.553.1623443498493; Fri, 11 Jun 2021 13:31:38 -0700 (PDT) Received: from localhost.localdomain ([196.196.203.214]) by smtp.gmail.com with ESMTPSA id x3sm843166ljd.12.2021.06.11.13.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jun 2021 13:31:37 -0700 (PDT) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Fri, 11 Jun 2021 22:30:31 +0200 Message-Id: <20210611203104.1692-1-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 00/33] 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: 0DpKPF3L8GgM 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. All review comments have been incorporated unless otherwise replied in the respective threads. 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 (33): 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 avutil/opt: add av_opt_print_num 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() 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 | 190 ++++ doc/indevs.texi | 40 + fftools/cmdutils.c | 34 +- libavdevice/avdevice.c | 86 +- libavdevice/avdevice.h | 45 +- libavdevice/dshow.c | 1384 +++++++++++++++++++++--- 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 | 56 +- libavformat/utils.c | 74 +- libavformat/version.h | 2 +- libavutil/opt.c | 83 +- libavutil/opt.h | 22 +- libavutil/version.h | 2 +- 22 files changed, 2041 insertions(+), 297 deletions(-) create mode 100644 doc/examples/device_get_capabilities.c