summaryrefslogtreecommitdiff
path: root/libavdevice/dshow.c
diff options
context:
space:
mode:
authorDiederick Niehorster <dcnieho@gmail.com>2021-12-21 14:53:34 +0100
committerGyan Doshi <ffmpeg@gyani.pro>2021-12-24 14:06:51 +0530
commite4b9aee11c5fff00eb7a491552dca1fe52b1264c (patch)
tree57040fc205d51913da255e63035a93b9f032e0c1 /libavdevice/dshow.c
parenta8a530331fba298fa0f8863502906f5d7d17d54f (diff)
downloadffmpeg-e4b9aee11c5fff00eb7a491552dca1fe52b1264c.tar.gz
avdevice/dshow: add media type info to get_device_list
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> Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
Diffstat (limited to 'libavdevice/dshow.c')
-rw-r--r--libavdevice/dshow.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 8dba04a787..4b1e942c7a 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -384,6 +384,12 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
sizeof(*(*device_list)->devices)) < 0)
goto fail;
+ // attach media_types to device
+ device->nb_media_types = nb_media_types;
+ device->media_types = media_types;
+ nb_media_types = 0;
+ media_types = NULL;
+
// store device in list
(*device_list)->devices[(*device_list)->nb_devices] = device;
(*device_list)->nb_devices++;
@@ -412,6 +418,7 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
if (device) {
av_freep(&device->device_name);
av_freep(&device->device_description);
+ // NB: no need to av_freep(&device->media_types), its only moved to device once nothing can fail anymore
av_free(device);
}
if (olestr && co_malloc)