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

Diederick Niehorster dcnieho at gmail.com
Tue Jun 8 02:03:53 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 | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

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
-- 
2.28.0.windows.1



More information about the ffmpeg-devel mailing list