From patchwork Tue Jul 6 09:20:00 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: 28800 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5d:965a:0:0:0:0:0 with SMTP id d26csp4920833ios; Tue, 6 Jul 2021 02:23:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO+j3FtRSbzr//B4xDPowjWvBsU5SBP8YwTsz5uBagGVdk2WEJsmpliPYyDOXte5xxUURP X-Received: by 2002:a17:907:868d:: with SMTP id qa13mr17729353ejc.173.1625563427998; Tue, 06 Jul 2021 02:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625563427; cv=none; d=google.com; s=arc-20160816; b=Ay1wobc3vEbHiLpo0e/Wfq3bI6VW608uJMPg/GE5DZBNBskxCDzQ+LzGn5ON4Vhy1n 6HjF1+Ww6scuVqkEcbk2u+JXBjJit9rqIDZjjZ6Xjx0qMzfn2+PQcog2YGOotmw20o5C 4qSS1v9jEJFCs//PvaQobjCJyFg5HvBuze1KAY6JbnfiZlnibeyRUHF6fuFpWpHC4o8f +Mw5rZmWJuDGOF/l3+m8zEuCz5e1/q440TPCN6WrYKkzWlCwtvkt0TB2AuXiiVe8zb1+ 6CPvAh83H637tpgzZOQkgR5MAHGvhe2KF9EUcdvG/MjLVBryBEatmCdb4T+3oQcJhLRh Iifw== 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=iBRJfUbIbqQbIw8wsS02yHrDfu3dNqFHPdis3HDH8vI=; b=WThlMKaWcG86SfUlaF5JdphVmA5oPVkjFhAWmDBxyXSm37HZ6bNjGv6rqHFNLwV2Oc GZhCVX6HrSpWG46iUp30EKogShxPQ/r2O9CkOJJcKSQzJtmHNwcu00bBvmeDj8R0Yf+t RSJnqaN03RI8lwllCPrx+iC5O7dC3szgC70GwIi3BTIhqusePBw6T1hfng5/IGpG1CVw +0oMkpBNbuATpxioVhQdJBaFhWyWu3aFb6FWSHQT0X/Z6QHGH7BFcBlIccftZWhuZe+U 2qIJ00GLe2BVwateMh0Al/lfRme8EfNZJmsMBC5dNh7eDRkqUieFelhDrBawvA6oGNF8 ZBzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=EKUyimu3; 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 jy1si15284533ejc.592.2021.07.06.02.23.47; Tue, 06 Jul 2021 02:23:47 -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=EKUyimu3; 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 6530F68A790; Tue, 6 Jul 2021 12:23:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 50E8268A78A for ; Tue, 6 Jul 2021 12:23:36 +0300 (EEST) Received: by mail-lj1-f175.google.com with SMTP id b40so8449772ljf.12 for ; Tue, 06 Jul 2021 02:23:36 -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=uORMR70G6JbnHxKR9LDal66X02UGXT25ssa2n+C8VWk=; b=EKUyimu3lgMmB9JVr6XYhJcC/I465Qs3bk7AM1U/rfpb0uRpz09vPCjrb8aeKpIai7 faD9ph6vScmWor3ezW3UuSPPCsYwdE6SZfLrZFvJwLTTO30ksWJfxBI2LxjRdwsM1xCD jyexL8sKhhO0o6pa7DEEGg9xG8lw51VJiu1Rw2FgIG4CNicicctUnD9gMT6P2cqNZWya UaZCr/VmdgcdymlRmFlCHr+2vYIp34yAgeG4tve9ABSPXcc77UNWIDKbvuHAPvLp+Yzh NR4UHy3EDyui881dWOQgAgrFH9qMNh2qvSEmXOqHrPl5L6evDME4QIeNMNh+/NigFet2 1Cgg== 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=uORMR70G6JbnHxKR9LDal66X02UGXT25ssa2n+C8VWk=; b=G5hvqKkcCOYgtdfzXzcPy//z1y2OS16prlcimarxkJHGZHPNIxFIzDijsI4mg8okqw WY8nixsM1wpvok1fN+gaAodsC8Vgxegm6DeUoRx1Myx7A19gTVGBlfo+5mon1souSAMq kVzkFhDl4GoFRS9KDVtENVScLT9NRQnLLQCsXjRg5qNEdCAcTGea/1INS+EAzs1tK6qe HYYSy0ChUn/pQ5BHnMzli6vIcFiQH+H24RKNyjW/xCqg5EQfHGiLZsrbOWdKoodKrmZq 1TvV5jJo2yr3+z5G8Viu2AzSd81/9wsTOQeatXjz075GvsisWj/J85kAaXfn3pyQImDc RuQg== X-Gm-Message-State: AOAM530TPuenpBVvM7mXvQwhmm6Lluw/KEPyGpHftCi+0hXHEJormPOt yeXn+8H6DPkJH8bNZq0YdgH7JKwvl18= X-Received: by 2002:a2e:7412:: with SMTP id p18mr14646295ljc.428.1625563415528; Tue, 06 Jul 2021 02:23:35 -0700 (PDT) Received: from localhost.localdomain (deedock.humlab.lu.se. [130.235.135.183]) by smtp.gmail.com with ESMTPSA id j13sm1331463lfe.108.2021.07.06.02.23.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 02:23:35 -0700 (PDT) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Tue, 6 Jul 2021 11:20:00 +0200 Message-Id: <20210706092020.1057-15-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20210706092020.1057-1-dcnieho@gmail.com> References: <20210706092020.1057-1-dcnieho@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 14/34] 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: ts97os7ealA0 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 3793923acf..e693770b3f 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)