diff mbox series

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

Message ID 20210602112901.2163-5-dcnieho@gmail.com
State Superseded, archived
Headers show
Series avdevice/dshow: control_message interface | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Diederick C. Niehorster June 2, 2021, 11:28 a.m. UTC
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@gmail.com>
---
 libavdevice/dshow.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff mbox series

Patch

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) {