[FFmpeg-devel] [PATCH 4/6] avdevice/dshow: accept show config dialog control message

Diederick Niehorster dcnieho at gmail.com
Wed Jun 2 14:28:59 EEST 2021


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 <dcnieho at gmail.com>
---
 libavdevice/dshow.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 6e0147aed7..561b85f4e0 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -928,6 +928,25 @@ 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:
+    {
+        int dialog = *(int*)data;
+        enum dshowDeviceType devtype = (dialog & 1) ? AudioDevice : VideoDevice;
+        if (dialog & 2) {
+            // device_dialog
+            if (ctx->device_filter[devtype])
+                ff_dshow_show_filter_properties(ctx->device_filter[devtype], avctx);
+        }
+        else if (dialog & 2) {
+            // crossbar_connection_dialog
+            // TODO
+        }
+        else if (dialog & 4) {
+            // tv_tuner_dialog
+            // TODO
+        }
+        break;
+    }
     }
 
     if (run_state != ctx->is_running) {
-- 
2.28.0.windows.1



More information about the ffmpeg-devel mailing list