Add support for enumerating the sources/sinks via the ffmpeg command line options, as opposed to having to create a real pipeline and use the "-list_devices" option which does exit() after dumping out the options. Note that this patch preserves the existing "-list_devices" option, but now shares common code for the actual enumeration. Updated to reflect feedback from Marton Balint <cus@passwd.hu>.
Showing the changes to libavdevice/decklink_dec.cpp (1 of 8 files). Show all
Unified · Split
| @@ -39,6 +39,7 @@ extern "C" { · 38 unmodified lines | ||
| 39 | 39 | #include "libavutil/time.h" |
| 40 | 40 | #include "libavutil/mathematics.h" |
| 41 | 41 | #include "libavutil/reverse.h" |
| 42 | +#include "avdevice.h" | |
| 42 | 43 | #if CONFIG_LIBZVBI |
| 43 | 44 | #include <libzvbi.h> |
| 44 | 45 | #endif |
| @@ -868,7 +869,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx) · 823 unmodified lines | ||
| 868 | 869 | |
| 869 | 870 | /* List available devices. */ |
| 870 | 871 | if (ctx->list_devices) { |
| 871 | − ff_decklink_list_devices(avctx); | |
| 872 | + ff_decklink_list_devices_legacy(avctx, 1, 0); | |
| 872 | 873 | return AVERROR_EXIT; |
| 873 | 874 | } |
| 874 | 875 | |
| @@ -1063,4 +1064,9 @@ int ff_decklink_read_packet(AVFormatContext *avctx, AVPacket *pkt) · 188 unmodified lines | ||
| 1063 | 1064 | return 0; |
| 1064 | 1065 | } |
| 1065 | 1066 | |
| 1067 | +int ff_decklink_list_input_devices(AVFormatContext *avctx, struct AVDeviceInfoList *device_list) | |
| 1068 | +{ | |
| 1069 | + return ff_decklink_list_devices(avctx, device_list, 1, 0); | |
| 1070 | +} | |
| 1071 | + | |
| 1066 | 1072 | } /* extern "C" */ |