aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice/v4l2.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2013-01-15 09:57:50 +0100
committerStefano Sabatini <stefasab@gmail.com>2013-01-15 21:48:21 +0100
commit1b325ce91ab78e2edd676cd8a099d04dd90a202c (patch)
tree9eb9be0c379a06bbd74630839d7c2b2fe68f9638 /libavdevice/v4l2.c
parentc994bb2fb7727f5c20ef71cc6727fb219fd49d60 (diff)
downloadffmpeg-1b325ce91ab78e2edd676cd8a099d04dd90a202c.tar.gz
lavd/v4l2: extend error/debug feedback in case of invalid codec/pix_fmt
Diffstat (limited to 'libavdevice/v4l2.c')
-rw-r--r--libavdevice/v4l2.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index c82a9084d0..6055278971 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -761,6 +761,10 @@ static uint32_t device_try_init(AVFormatContext *s1,
for (i = 0; i<FF_ARRAY_ELEMS(fmt_conversion_table); i++) {
if (s1->video_codec_id == AV_CODEC_ID_NONE ||
fmt_conversion_table[i].codec_id == s1->video_codec_id) {
+ av_log(s1, AV_LOG_DEBUG, "Trying to set codec:%s pix_fmt:%s\n",
+ avcodec_get_name(fmt_conversion_table[i].codec_id),
+ (char *)av_x_if_null(av_get_pix_fmt_name(fmt_conversion_table[i].ff_fmt), "none"));
+
desired_format = fmt_conversion_table[i].v4l2_fmt;
if (device_init(s1, width, height, desired_format) >= 0) {
break;
@@ -848,7 +852,9 @@ static int v4l2_read_header(AVFormatContext *s1)
if (desired_format == 0) {
av_log(s1, AV_LOG_ERROR, "Cannot find a proper format for "
- "codec_id %d, pix_fmt %d.\n", s1->video_codec_id, pix_fmt);
+ "codec '%s' (id %d), pixel format '%s' (id %d)\n",
+ avcodec_get_name(s1->video_codec_id), s1->video_codec_id,
+ (char *)av_x_if_null(av_get_pix_fmt_name(pix_fmt), "none"), pix_fmt);
v4l2_close(s->fd);
return AVERROR(EIO);