From patchwork Fri Jun 11 20:30: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: 28228 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:c91a:0:0:0:0:0 with SMTP id z26csp763538iol; Fri, 11 Jun 2021 13:34:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXDT6nCH/mi7TSz7gmB6P5/+OwwWeaDT3gjPQKOKYUsu8aHeoZOq1hWrm6ldWpNcKbfnNt X-Received: by 2002:a17:906:7f0e:: with SMTP id d14mr5089517ejr.103.1623443649864; Fri, 11 Jun 2021 13:34:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623443649; cv=none; d=google.com; s=arc-20160816; b=DAO/NHzqP9j7u9fzymcMXXqfOECUKiTwmYKvHka+jIV6o/4QIiMf0+yBGSxJAOVmiC hYgGR3S43H6leXPV5XmzU2gYbWTc1CgW/GBTa4UKe0Jp3+sJKvuX3Q1tEQhzD4yQXTXN un2YXBUhd+hNrdntauVftuY6+lX4Am4iuf8RMi7WFhYaswaYCVim9xn3zgIaa05qOyMU pXOg05KQskzIrg4hzE/OPexw8QObqXEsnAZ57q5F79goBGDcqDL9dduhcfF6NIWx0Vdq +rOY/eQdgcYOGjjbHrmnK/oikvWvqNQOTQ2M8DS3uxG+aAASv+VN4ro5qTam/pkJzG3p nsWQ== 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=XTcUtUDazvrxnQ1U/B+ZA4MUuvoZ9f5eNe084JO+cnk=; b=QIsVeX+2boS3lGufQZDirPJRsjHwgfrLWGeHh/OkXf/1GCujhqa46JNQS+EkgA9jM+ wYcTlpedG2JRDe5B2AfaBe9slzyuYWlwFeu96Y+tEpa2xACOOcILnvnea1XEQtPe6xwq KGmisG6IzO4Cr6cPXlJ1Zqq/XhtUIot5ZKUiyjP6n47FHwe4CLcsFR9bPNi55GqfL2hy oxfEU6X8Vv3i093FGD8RfsJ1VwiSZJY7fw52PD96+yE3WtjFW2u1ZhRMxNx3pOqH4KR8 NbiCoZs6tA2NPOBAPW9SyaMHGAf3g1t3s1dZOOhZrOaj2poP2ANw2fWkePfjEjPbR8yu sg1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=KUJpbhzF; 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 a13si5460917edv.228.2021.06.11.13.34.04; Fri, 11 Jun 2021 13:34:09 -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=KUJpbhzF; 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 7766C680869; Fri, 11 Jun 2021 23:34:01 +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 51DFD680869 for ; Fri, 11 Jun 2021 23:33:54 +0300 (EEST) Received: by mail-lf1-f48.google.com with SMTP id i10so10373902lfj.2 for ; Fri, 11 Jun 2021 13:33:54 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=jkH7//Ug1KRjrqJO2w+IvuSqaoye+0tWmmd3ktLeHBM=; b=KUJpbhzFse0wgZSivBEgXV4gOh5rch3x7kXLFRbAENC7MclK1BSQrmR2j4Hq7X5th9 6y4VObFufstlao7+D/flRPgcdLKYlAIiFIt9ovnkGQvZtCKzR0BkxxEDDRxQP83P2WVo 4KigROe9Y8ONBftNno6eQU5qhAaxa3Rbb823h7ywu1y0+HqTVePOQrZqrqgRtk1zJGzw K8DIIXdHGukwwhRBRi/b9EUYz73DM2RZj6kjaV2iIIVsK/T10JhWdIN8BHuOjrBciZ2t WxBAx3ZQU/oJ0hLRgSCPfBtMf1LyIOCqK+k8HgPtsp14sf1Q5zh6sCQAc9WZ5r1bWc9e GvXw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=jkH7//Ug1KRjrqJO2w+IvuSqaoye+0tWmmd3ktLeHBM=; b=iu6im97vl8j6tAWuezl5WA8WK5TGyIznabDF1kS6wYhzpVaCJRBh/f24wWVckU3Y+x T6fEbHPAZThFY7dFh/lsNmzoNtqfkpO2zSJ66msKV7zYjvU0sBvYyBHFzVLq87FxXYSh 7QPrrhEAZ+Cr0EaqH8EJJ33EN2385+8xNI0E/TNu5Bz68y9e/G01Mmq8PRxTkExRXNtK L7eQza5dD0IbQR2i9/NczUwusJdDu10GPR4URWSTo7nCp70aTu9A0PjOgyWaoIa8oPVI pxU2joVhIipRAdy+KauJz4fdX/ZA++BWRxPAbWAKnmgy7r9qWj8PXP9o4K038WXRh88U ANDw== X-Gm-Message-State: AOAM532T5HHvySUw5SndHVWN3ix0T+E0CsHf7N5Zd3H/ej71SLge6CuA mNjAOPJfb+7qyTx1JQp4S+mpX3C/6ZmTrw== X-Received: by 2002:a05:6512:3d17:: with SMTP id d23mr3670959lfv.596.1623443633462; Fri, 11 Jun 2021 13:33:53 -0700 (PDT) Received: from localhost.localdomain ([196.196.203.214]) by smtp.gmail.com with ESMTPSA id z4sm661145lji.61.2021.06.11.13.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jun 2021 13:33:53 -0700 (PDT) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Fri, 11 Jun 2021 22:30:39 +0200 Message-Id: <20210611203104.1692-9-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20210611203104.1692-1-dcnieho@gmail.com> References: <20210611203104.1692-1-dcnieho@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 08/33] avdevice: add info about media types(s) to AVDeviceInfo 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: 8HxuXuL3VFhg An avdevice, regardless of whether its category says its an audio or video device, may provide access to devices providing different media types, or even single devices providing multiple media types. Also, some devices may provide no media types. dshow is an example encompassing all of these cases. Users should be provided with this information, so AVDeviceInfo is extended to provide it. Bump avdevice version Signed-off-by: Diederick Niehorster --- libavdevice/avdevice.c | 2 ++ libavdevice/avdevice.h | 2 ++ libavdevice/version.h | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c index 22b7595ab1..4a40929007 100644 --- a/libavdevice/avdevice.c +++ b/libavdevice/avdevice.c @@ -158,6 +158,8 @@ void avdevice_free_list_devices(AVDeviceInfoList **device_list) if (dev) { av_freep(&dev->device_name); av_freep(&dev->device_description); + if (dev->media_types) + av_freep(&dev->media_types); av_free(dev); } } diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h index 8370bbc7f2..6f24976dcc 100644 --- a/libavdevice/avdevice.h +++ b/libavdevice/avdevice.h @@ -457,6 +457,8 @@ void avdevice_capabilities_free(AVDeviceCapabilitiesQuery **caps, AVFormatContex typedef struct AVDeviceInfo { char *device_name; /**< device name, format depends on device */ char *device_description; /**< human friendly name */ + enum AVMediaType *media_types; /**< array indicating what media types(s), if any, a device can provide. If null, cannot provide any */ + int nb_media_types; /**< length of media_types array, 0 if device cannot provide any media types */ } AVDeviceInfo; /** diff --git a/libavdevice/version.h b/libavdevice/version.h index 6021a0dd65..6e593ba00e 100644 --- a/libavdevice/version.h +++ b/libavdevice/version.h @@ -28,7 +28,7 @@ #include "libavutil/version.h" #define LIBAVDEVICE_VERSION_MAJOR 59 -#define LIBAVDEVICE_VERSION_MINOR 0 +#define LIBAVDEVICE_VERSION_MINOR 1 #define LIBAVDEVICE_VERSION_MICRO 100 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \