From 1973e1018e966d3f33cf3ed1e358b54344637945 Mon Sep 17 00:00:00 2001 From: Ramiro Polla Date: Sat, 23 Oct 2010 02:11:30 +0000 Subject: [PATCH] vfwcap: add option to print list of supported drivers Originally committed as revision 25552 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavdevice/vfwcap.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c index 13aaad92ef..7b54490fbb 100644 --- a/libavdevice/vfwcap.c +++ b/libavdevice/vfwcap.c @@ -248,6 +248,22 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) int height; int ret; + if (!strcmp(s->filename, "list")) { + for (devnum = 0; devnum <= 9; devnum++) { + char driver_name[256]; + char driver_ver[256]; + ret = capGetDriverDescription(devnum, + driver_name, sizeof(driver_name), + driver_ver, sizeof(driver_ver)); + if (ret) { + av_log(s, AV_LOG_INFO, "Driver %d\n", devnum); + av_log(s, AV_LOG_INFO, " %s\n", driver_name); + av_log(s, AV_LOG_INFO, " %s\n", driver_ver); + } + } + return AVERROR(EIO); + } + if(!ap->time_base.den) { av_log(s, AV_LOG_ERROR, "A time base must be specified.\n"); return AVERROR(EIO);