[FFmpeg-devel] [PATCH] Add get_device_list() to AVFoundation input device.

Thilo Borgmann thilo.borgmann at mail.de
Wed Apr 29 14:08:20 CEST 2015

Am 28.04.15 um 16:49 schrieb Daniel Ly:
> This makes avdevice_list_input_sources() available for
> device_name = "avfoundation". avf_read_header is retrofitted
> to use the new method.
> Signed-off-by: Daniel Ly <nalply at gmail.com>
> ---
>  libavdevice/avfoundation.m | 139 +++++++++++++++++++++++++++++++++------------
>  1 file changed, 104 insertions(+), 35 deletions(-)
> [...]

Unfortunately, I think this is misdesigned. I suggest to do the following instead:

- add a AVDeviceInfoList to AVFContext
- in read_header() or get_device_list() fill this AVDeviceInfoList if not yet
- in get_device_list() copy/reference the AVFContext.AVDeviceInfoList into the
- in read_header() just cycle through the AVFContext.AVDeviceInfoList to print
it out if -list_devices has been set

This will need some new lines of code for handling device indices, though.


More information about the ffmpeg-devel mailing list