diff mbox series

[FFmpeg-devel,v2,09/33] avdevice/dshow: add media type info to get_device_list

Message ID 20210611203104.1692-10-dcnieho@gmail.com
State Superseded, archived
Headers show
Series avdevice (mostly dshow) enhancements | 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 11, 2021, 8:30 p.m. UTC
The list returned by get_device_list now contains info about what media
type(s), if any, can be provided by each device.

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
---
 libavdevice/dshow.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 5d7f065a8c..3e41f4f99f 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -377,6 +377,11 @@  dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
                 if (!device->device_name || !device->device_description)
                     goto fail1;
 
+                device->nb_media_types = nb_media_types;
+                device->media_types = media_types;
+                nb_media_types = 0;
+                media_types = NULL;
+
                 // store to device_list output
                 if (av_reallocp_array(&(*device_list)->devices,
                                      (*device_list)->nb_devices + 1,
@@ -412,6 +417,8 @@  dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
                 av_freep(&device->device_name);
             if (device->device_name)
                 av_freep(&device->device_description);
+            if (device->media_types)
+                av_freep(&device->media_types);
             av_free(device);
         }
         if (olestr && co_malloc)