diff options
author | Lukasz Marek <lukasz.m.luki@gmail.com> | 2014-02-16 20:06:23 +0100 |
---|---|---|
committer | Lukasz Marek <lukasz.m.luki@gmail.com> | 2014-02-16 20:07:08 +0100 |
commit | 81c3f81d6f11bf1dad9c6f3de5938e665447b991 (patch) | |
tree | 68bdd8e0804413e940f1a473c3900b4ac1bf2a68 /libavdevice/avdevice.h | |
parent | d3cf9b24cf80eb4d317964e887c591809a149cef (diff) | |
download | ffmpeg-81c3f81d6f11bf1dad9c6f3de5938e665447b991.tar.gz |
lavd: add list devices API
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Diffstat (limited to 'libavdevice/avdevice.h')
-rw-r--r-- | libavdevice/avdevice.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h index 3306020628..28344ca161 100644 --- a/libavdevice/avdevice.h +++ b/libavdevice/avdevice.h @@ -191,4 +191,43 @@ int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToAppMessageType type, void *data, size_t data_size); +/** + * Structure describes basic parameters of the device. + */ +typedef struct AVDeviceInfo { + char *device_name; /**< device name, format depends on device */ + char *device_description; /**< human friendly name */ +} AVDeviceInfo; + +/** + * List of devices. + */ +typedef struct AVDeviceInfoList { + AVDeviceInfo **devices; /**< list of autodetected devices */ + int nb_devices; /**< number of autodetected devices */ + int default_device; /**< index of default device or -1 if no default */ +} AVDeviceInfoList; + +/** + * List devices. + * + * Returns available device names and their parameters. + * + * @note: Some devices may accept system-dependent device names that cannot be + * autodetected. The list returned by this function cannot be assumed to + * be always completed. + * + * @param s device context. + * @param[out] device_list list of autodetected devices. + * @return count of autodetected devices, negative on error. + */ +int avdevice_list_devices(struct AVFormatContext *s, AVDeviceInfoList **device_list); + +/** + * Convinient function to free result of avdevice_list_devices(). + * + * @param devices device list to be freed. + */ +void avdevice_free_list_devices(AVDeviceInfoList **device_list); + #endif /* AVDEVICE_AVDEVICE_H */ |