From patchwork Fri Jun 11 20:30:45 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: 28211 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:c91a:0:0:0:0:0 with SMTP id z26csp764622iol; Fri, 11 Jun 2021 13:36:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw54vsp8bmbCmqaYqiXgBqpV8+B1xWLqNrevTC1rJUSjNF+ijgJxQ6OoY4vmekjrMPE6VHp X-Received: by 2002:a05:6402:31ba:: with SMTP id dj26mr5416591edb.71.1623443760872; Fri, 11 Jun 2021 13:36:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623443760; cv=none; d=google.com; s=arc-20160816; b=BCcGOkk+Uv9bk8Czr1uJivUEnpk0KJKSEBDgpdp1y9fggT5BmlmhU3EZPRDVpHgYm9 7OgPkSXnaJrHvNTpIVBb6C5kJxhaLS4qVkUrjIoGzq5KCMdDuGnB+NVu1CiJBOQIARQE DcmEQui4I2WRxqc3UxoHvmc4QozGrmD2pGfdRUv9NqEBEhNbd4iQy0CY4J3w9HTIRgEK oy+JqjpJWJKwKjRux2QAJsn1q9JsxBiUE050NhX8Lh1k11Hj4hjq8y10DfcA4rtePMxC QVzFzz5iTFZV4G0XiyLKv/gAOQoFEshfnbOJZJ2smi58Q1E0g5mmwtq1/UI3lubD/0mD wqpQ== 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=M0ffoaj71A3wghe0ujw18GvS3rsLO1NbcpZYmlHMrv4=; b=SUZsO1Nf2bH3EVqQ3aAU9g+CfgN00Pey+DvSFMwffJjxeIIJJRZpCZP5YwtKwIAM2S z2v9yWEPQ3+gcbXrP1F7PV+5CrhX2T5XXE3iQxJAb4BWeNVb66VYpILbUyiYToXjmbK/ ajEhcGbIQCaHYnzq6RVtz+kmiOjPDIhGJx+jMEt8gFSxMFHsSUIGCMqNWAm9zhDV2MOH IY5Q4aLMmE9VnINAlzHgIiHq0oKpQxj8Mb4TkdanGT/tMwnUUFIHvJzU9Ey3fer4fECb shw6LjClxvSGKIG627E4JZaLdD2yH0BR87G7h/pr5PVanh4dw5BkETR1fVIT2vwBKMsv SmkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Mq0P0II3; 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 f17si5707428eds.78.2021.06.11.13.35.45; Fri, 11 Jun 2021 13:36:00 -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=Mq0P0II3; 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 98DA568980E; Fri, 11 Jun 2021 23:35:42 +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 F30916883C9 for ; Fri, 11 Jun 2021 23:35:35 +0300 (EEST) Received: by mail-lf1-f48.google.com with SMTP id j2so10357510lfg.9 for ; Fri, 11 Jun 2021 13:35:35 -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=RlN10Tx/WPucIl/WAKARARDEjMbJM+blL7G6lm1/GT8=; b=Mq0P0II3rwcy4O12rSf1eNwi48aLuhaTZtZ3zul1QNGxbclpY7CaTwJuwNdejVNklA YKbkJ5oaZ1pB6ygM0TJJt2ySmLrmOA0977rlplW0C4Pw1ATzJGb2GNFT9JGUvyx9VA0P wsktpCJ+mzWr4qcNIQ46+ZdhyDKOXva3rPd3+WmgwkQqG0jLuGNQq9S+HvtPU0MUF6Wu n6YZMjtN0sK0ITj5Q738DljA4paeMQ4Zt4OAc/5n1uNRkM93VCM4rULVPkzXIZcdEC8D LpG1ByuSozEmjMcwl9ld5nLurN38yLw7MLQo4SHbj8PkdBQr+SAacIjDENKQ5H6/9Ptq UXdg== 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=RlN10Tx/WPucIl/WAKARARDEjMbJM+blL7G6lm1/GT8=; b=emMojctMRE5cFf3Gpmqz37QMGXoFIMCXj/zo32RqNty717YklxXRgO2l7eO3FD0yTR Jq4y4PxqQZ/rplLyyD18Ez4GxwxZkNdxc48Xj+3fMWs350edyT+QguuPGagvp6suJtDj QDoBdruK3fvxyqNtEP2fpFYFED//jlCZe1SkRGa+s0dJk6sXl+0BLq2i17coOgZLXMia a5uFfDVGeKrbYutcjfyE+2iIxn0uWuIUV7X3Bax4EBdGFn8s6Cyi84/VnyGFn9CtX4r2 /cTBVupeDPheZ1HFn7vCl5vW5BWB7xmgoaTZZpiVzsyQXNNEDY84i3m3luamkLE90zwJ 9LPw== X-Gm-Message-State: AOAM532bC8GCOgMyQtn1Lkdt8xImEWbnG6OYjhRoWZuuv15xtLs6RCl3 SdjIBwKKugEJG2rlCmMgydu301TQkCyoQg== X-Received: by 2002:a05:6512:3b2a:: with SMTP id f42mr3668287lfv.425.1623443735156; Fri, 11 Jun 2021 13:35:35 -0700 (PDT) Received: from localhost.localdomain ([196.196.203.214]) by smtp.gmail.com with ESMTPSA id i13sm685873lfe.81.2021.06.11.13.35.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jun 2021 13:35:34 -0700 (PDT) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Fri, 11 Jun 2021 22:30:45 +0200 Message-Id: <20210611203104.1692-15-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 14/33] avdevice/dshow: accept show config dialog control message 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: j3WFhruqq2Re DirectShow source will pop up its configuration dialog when AV_APP_TO_DEV_CONFIG is received. Implementation for several other possible configuration dialogs is more involved and will be provided in the next commit. Signed-off-by: Diederick Niehorster --- libavdevice/dshow.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 9f041e90f8..018792a886 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -1084,6 +1084,7 @@ static int dshow_control_message(AVFormatContext *avctx, int type, void *data, s struct dshow_ctx *ctx = avctx->priv_data; int run_state = ctx->is_running; HRESULT hr; + int ret = 0; switch (type) { case AV_APP_TO_DEV_PAUSE: @@ -1095,6 +1096,32 @@ static int dshow_control_message(AVFormatContext *avctx, int type, void *data, s case AV_APP_TO_DEV_TOGGLE_PAUSE: run_state = !run_state; break; + case AV_APP_TO_DEV_CONFIG: { + /* For documentation of dialog variable, see ffmpeg-devices.html in docs */ + int dialog; + enum dshowDeviceType devtype; + + if (!data) + av_log(avctx, AV_LOG_ERROR, "Use the data argument to indicate which dialog should be shown."); + dialog = *(int *) data; + devtype = (dialog & 1) ? AudioDevice : VideoDevice; + + if (dialog & 1<<1) { + // device_dialog + if (ctx->device_filter[devtype]) + ff_dshow_show_filter_properties(ctx->device_filter[devtype], avctx); + } else if (dialog & 1<<2) { + // crossbar_connection_dialog + // TODO + } else if (dialog & 1<<3) { + // tv_tuner_dialog + // TODO + } + break; + } + + default: + ret = AVERROR(ENOSYS); } // if play state change requested, apply @@ -1115,7 +1142,7 @@ static int dshow_control_message(AVFormatContext *avctx, int type, void *data, s ctx->is_running = run_state; } - return 0; + return ret; } static enum AVCodecID waveform_codec_id(enum AVSampleFormat sample_fmt)