From patchwork Tue Dec 21 12:12:36 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: 32786 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp5361554iog; Tue, 21 Dec 2021 04:14:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyPx6n6B5uhgSvF7ALGIRcVbxbX1LjqwfvKcJeCIBar0dCuSObpSmWCx2R4fqhcalRKx9+ X-Received: by 2002:a05:6402:516a:: with SMTP id d10mr3018586ede.131.1640088892332; Tue, 21 Dec 2021 04:14:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640088892; cv=none; d=google.com; s=arc-20160816; b=idZq6riZC0INWR0HKKW2fL16t33YcF/LcWNGAdQlbAEpizKexKoeWUXFsbQsH6s6dP yWo56lk9uKdb0NzW9f5LBsTy6YuPCcDeSpD4+EWlttJrscPquHQBrIdNDxq+euf6iiPa J1n2KrFaUCapy8xi7HiMigACOi8qrNE2AtLAshVL09YjRFH4J/LCTYkqrdsr8zMWSo1E +Y806i0y5OS6VL3lG33EmyNQyubXpB+ceFznbOndvYikrgI9RVMsZ/YLsnxttwY2H7tZ QAcapJr5OHUOoa9QYGfr0728+C5K0qFMs+Fw/nhWAMacQwn4TNVkIQghg3rK6kOjBNe6 KBJw== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=T1p4dXjdoOorQzbEjoxluW0EMmVJ1gI9e2DuNfkkNvg=; b=tL++PCwjVvu1JjMkgO7dWQIwqW59xaLg4POUxbecNRTBngQVGgwdM1+BtyS0498WPU 0yc9b9XiCeyZcVjuCweYVgX1jL73dElGk93bCTdPMn2BB9H3QLjlaBjq9oEireVQPmfk tfdiU+ZI/aMkGKzj/92vpSU6vwsL6M+3zL36B4KvP8rUxXWBzdGGIIHCxrKJP0deklMQ WYKiAixA2/Vvum24EEhtYuXMAc6D+Hi3g2qRxBlso5s0FYwx1hg+6uYRaVns3Bizxq0k OL/M49j49m4ELFxKVTHcshSTrwWFGtKffb+YtNQaVWe+GlFDlAilrvkLtx0ISctChh7S nc8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=boDRaBTU; 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 w14si4309041edc.474.2021.12.21.04.14.48; Tue, 21 Dec 2021 04:14:52 -0800 (PST) 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=boDRaBTU; 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 13BF368AFEB; Tue, 21 Dec 2021 14:13:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C305268AFDD for ; Tue, 21 Dec 2021 14:13:53 +0200 (EET) Received: by mail-lf1-f47.google.com with SMTP id x7so4345593lfu.8 for ; Tue, 21 Dec 2021 04:13:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v2kXJOQXp1FSsiOyRIGlHOZj4JiIWVkJ1nszCAPlQyM=; b=boDRaBTUcmRXyz/txcZJIyTJMcGyGX47/tDb0pfZQhvW0SPnKf8JOfM4f8zgqd0nio mFGGyiPqdS7a1CHCs3Wd1Nl6qt4SIj+V8wOAn4QNHBPHerYB4aZCrZphbuJlgYIra+zr LyQGRdlc9NabvnnDvjv65S0BHjaIJszeVOLrTq9BdNy9puJEwSkJDmRIAOXv3PxbntyY kAd97oAohV5JOVglFE9O8RL35eSnbUcCNz5/VU9XM2WMgZNOsfjzfVa7Hiv3py03Ssim /+s5FEk9H+nDNJjKxdxHtRP0n7JQKNGuIxC4YJGrvVtcyotPMZPDyeHF8MuQXLpjUKgj nuyA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=v2kXJOQXp1FSsiOyRIGlHOZj4JiIWVkJ1nszCAPlQyM=; b=FKpHaadx2LWJmM6mH4u/ZZnyR0gf96e+H9aWUIh9EuhGej1lNRVuRzqJGYqvK4iUc3 vn2wW5qJGUhq2I5MMrgh1l2EE36578OaBuaDXX5g2uAz2WDpLYex59/QS3hylrlwfk51 fW3Z9CdVbHae3dXb8s+CZ/+lz6E1YgEwimi8nlK9ZjjWpEC079cMt7Umzf8AT1gbhe48 3bUzsQ3v95Z2Wtx6NPeHejcaJRAn5vCkHCUUgF/QKbZ44swaUVp4aowjSe4zmfYXzIHK ZMD3S3zWFdwzArd7CHzAkmfM5ADCzqv03cYv+ru7+KvSWr+x3nfYSQFp7L0fXar8bJTw S2JQ== X-Gm-Message-State: AOAM533W+moHbm/DlNFrgtnkl59LhC71udAjNfUlry/wbSyvfdyo0My1 97SSsbC1S52KbZ6xYhRRptZkupb8lw2i6A== X-Received: by 2002:a05:6512:388d:: with SMTP id n13mr2691207lft.109.1640088832617; Tue, 21 Dec 2021 04:13:52 -0800 (PST) Received: from localhost.localdomain ([196.244.192.13]) by smtp.gmail.com with ESMTPSA id p6sm28403ljg.69.2021.12.21.04.13.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Dec 2021 04:13:52 -0800 (PST) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Tue, 21 Dec 2021 13:12:36 +0100 Message-Id: <20211221121239.1201-10-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20211221121239.1201-1-dcnieho@gmail.com> References: <20211221121239.1201-1-dcnieho@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v6 09/12] avdevice/dshow: add media type info to get_device_list 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: ieG0h/PFnGNp The list returned by get_device_list now contains info about what media type(s), if any, can be provided by each device. Signed-off-by: Diederick Niehorster --- libavdevice/dshow.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 8dba04a787..4b1e942c7a 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -384,6 +384,12 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum, sizeof(*(*device_list)->devices)) < 0) goto fail; + // attach media_types to device + device->nb_media_types = nb_media_types; + device->media_types = media_types; + nb_media_types = 0; + media_types = NULL; + // store device in list (*device_list)->devices[(*device_list)->nb_devices] = device; (*device_list)->nb_devices++; @@ -412,6 +418,7 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum, if (device) { av_freep(&device->device_name); av_freep(&device->device_description); + // NB: no need to av_freep(&device->media_types), its only moved to device once nothing can fail anymore av_free(device); } if (olestr && co_malloc)