diff mbox series

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

Message ID 20210607230414.612-15-dcnieho@gmail.com
State Superseded, archived
Headers show
Series avdevice (mostly dshow) enhancements
Related show

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 7, 2021, 11:03 p.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 | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
diff mbox series

Patch

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 9f041e90f8..b3c005d3f7 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -1095,6 +1095,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:
+    {
+        /*
+         * Documentation of dialog variable:
+         * 1st bit: if set, audio device, if not set, video device
+         * 2nd bit: if set, show property dialog for audio/video capture device
+         * 3rd bit: if set, show property dialog for crossbar connecting pins filter on audio/video device
+         * 4th bit: if set, show property dialog for analog tuner audio / analog tuner filter
+         */
+        int dialog = *(int *) data;
+        enum dshowDeviceType 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;
+    }
     }
 
     // if play state change requested, apply