From patchwork Wed Mar 30 12:17:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Diederick C. Niehorster" X-Patchwork-Id: 35060 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp773952pzb; Wed, 30 Mar 2022 05:19:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcPylvlOuoqW/ofPyFGJqWeWpIwO0kjL+1Gkaj8J3lVpsk1cTEmtV+OTXQTamU36XtDQcA X-Received: by 2002:a50:ec96:0:b0:419:75fb:a07b with SMTP id e22-20020a50ec96000000b0041975fba07bmr10288078edr.316.1648642758929; Wed, 30 Mar 2022 05:19:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648642758; cv=none; d=google.com; s=arc-20160816; b=f1oc2fF3yn/A8l2xiqSjp5m1KYrrc+sAqHrbK0OYatAhWYAtPsFqGXDtgqiGCJaUI0 GVzeiPx79u59DwsRa1hvFSwvywcoUTZABVVGvgK9IitFXvDneBRarHdY73yRJqeSuGW8 7UIxvmpTOLQRVoN6bWFPbRfI1r5T3F3FQRqGCebos58ltCD1m43eDO26tQ49V0Np2i1r PIZLCpeuHzEQhBeluZcamqOAq3dUtv0xDAV+gnCZRmnnC1q+Do7plW3PcgpSCRFAZWrY vZCJIJsnMjIPCsMU8fW5CMQogN3v7inVLHKqyNMGtu96nz6Ro0xPyvIx2qDgu4viyeQP UofA== 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=qZBSiQQxre/XhbTpWK0HUMsyUYGYp1VWZkESF4VPI7I=; b=Jm/JN4ZJ0G/CU+dxO9+MNsBZ/CIEwPQkjec7HTyR7PakLabo0UVgPAF1tdKCV8iCZm kdqlQmfVx7lWilCIvHSSeSc7Q9C0jDO1MZoOz4gEmvtsD8tR6mJoiDQkUhM7MHbneElY rNXPbGz+4b5JrtXAXmFYgeJv6Ke0CHqmJrdmsVBfefCrG65F5T3KN8HS1CR9RCbaN1KX oxeLI1/3CxxnSOWEi859sxepuNusZOmr+gLS5ivyRyiweivLwal/sU0qZ7JXAL5mgGoB r75O9ypwH3BKDvzrLs3pJwLGgTDy+ejF41zWYDbe69nuOGpRie4XRqJ6yQIoOSqXVAWH aOKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=ClrRLseG; 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 l4-20020a170907914400b006df76385c56si15920065ejs.246.2022.03.30.05.19.18; Wed, 30 Mar 2022 05:19:18 -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=20210112 header.b=ClrRLseG; 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 1AB5868B21F; Wed, 30 Mar 2022 15:19:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1D99368B1D4 for ; Wed, 30 Mar 2022 15:18:54 +0300 (EEST) Received: by mail-lf1-f51.google.com with SMTP id e16so35421182lfc.13 for ; Wed, 30 Mar 2022 05:18:54 -0700 (PDT) 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=gvjbBjGhD+4DTkoqUBR4omF9/1lb4OFPtJ3RkssfsRQ=; b=ClrRLseG6F1UlJV3rG/lXuh8l16hYzU6DPKEBdY+xckNvyEyRERZ44iB6imbByGHgH p//ARZIyowPyXH7c3LXIN5f5tC1gyPnZykNzmDC/I239kVvl74zaNrmJHvzvyfWRMXgv wA1A5Ip1fyyanAOcgk0LzmW2gFrinuGdt0pyR7E7T8aj/f92duNuQ6MQu2vpkOG2K/hj oDLWmb/S5l0Hsk64QQFwquxzRzjdYXKmFTXsCB3mDnPTgmCSIUQ/8cxz1XGzpAVuP99l 5fiMbb3nuW/TwfoCvrKvyYEtFlLHS1A8gcrFnm5leyXsloj3ijDA/rHCWMAgcCgM/fDb UuYw== 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=gvjbBjGhD+4DTkoqUBR4omF9/1lb4OFPtJ3RkssfsRQ=; b=OI4f79SaYVlJ1Y6b6zoh4tepxBsjxtGN/7hFQbGwogGTX7RW5jMZk1zz9W66/Sd2lb 6VVlss8fiL1RJ7e6dAPfW69I1Zfg9VGCT0tYMEkgk7eW2Dwjl2q8+yHyt/rlG+/CBBnk qjrE+YVqN3ZIzxbSYOmkPM/4Wb5XjyJbkj7AGxJNzjeJ+LPMf/8qKu3wzxu+VVEiCGCO bDgH+4t0ZYVkLnA3uE2SuXhvPvVYQblqKEO+H2UKlxoTCpfor7WwwWvu4GYCze3aQn7H zFC1sfrBAvrV0OGtDAMsP6wih7u0SackzWcfsNuoHyla3MAyybJxpmuXv9dGnALt4680 1SXA== X-Gm-Message-State: AOAM531/aYO5NrCqtK0S1fQ4VQqt1lGMQEtOSrQ6peE24ptZdG4on1i4 6zbVL5jdNo6ACkv2/Y4kSjKxuKNBCYc= X-Received: by 2002:a05:6512:b12:b0:44a:ba81:f874 with SMTP id w18-20020a0565120b1200b0044aba81f874mr3234909lfu.449.1648642733125; Wed, 30 Mar 2022 05:18:53 -0700 (PDT) Received: from localhost.localdomain (deedock.humlab.lu.se. [130.235.135.183]) by smtp.gmail.com with ESMTPSA id b35-20020a0565120ba300b0044a909dba3asm1124805lfv.266.2022.03.30.05.18.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 05:18:52 -0700 (PDT) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Wed, 30 Mar 2022 14:17:50 +0200 Message-Id: <20220330121806.822-6-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20220330121806.822-1-dcnieho@gmail.com> References: <20220330121806.822-1-dcnieho@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v5 05/21] 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: 713n5E8KAhd4 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 652e093204..78194406b5 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -1508,6 +1508,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: @@ -1519,6 +1520,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 @@ -1539,7 +1566,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)