summaryrefslogtreecommitdiffstats
path: root/stream/tvi_v4l2.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2018-03-03 11:57:41 -0800
committerKevin Mitchell <kevmitch@gmail.com>2018-03-04 16:28:24 -0800
commitf0223e1b835894a20989523555a0f4e19cd36619 (patch)
treef3f818ef6e9cf0588890a772f5944c6f237524b6 /stream/tvi_v4l2.c
parent496b13227b7f4b47a660bbf4e314f9a55b7e8867 (diff)
downloadmpv-f0223e1b835894a20989523555a0f4e19cd36619.tar.bz2
mpv-f0223e1b835894a20989523555a0f4e19cd36619.tar.xz
tv: Recognise v4l2 'JPEG' fourcc
Naturally, there's more than one fourcc that indicates an mjpeg stream. I have a particular ancient webcam here (Logitech QuickCam Messanger) that only supports the single 'JPEG' format, but there are other devices out there which support both 'JPEG' and 'MJPG' with no visible differences, and others where the streams are slightly different. Regardless of those details, it remains correct to treat 'JPEG' the same as 'MJPG' from a stream consumption perspective.
Diffstat (limited to 'stream/tvi_v4l2.c')
-rw-r--r--stream/tvi_v4l2.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c
index 57bf6b875f..70595c6034 100644
--- a/stream/tvi_v4l2.c
+++ b/stream/tvi_v4l2.c
@@ -235,7 +235,8 @@ static int fcc_mp2vl(int fcc)
case MP_FOURCC_YUY2: return V4L2_PIX_FMT_YUYV;
case MP_FOURCC_YV12: return V4L2_PIX_FMT_YVU420;
case MP_FOURCC_UYVY: return V4L2_PIX_FMT_UYVY;
- case MP_FOURCC_MJPEG: return V4L2_PIX_FMT_MJPEG;
+ case MP_FOURCC_MJPEG: return V4L2_PIX_FMT_MJPEG;
+ case MP_FOURCC_JPEG: return V4L2_PIX_FMT_JPEG;
}
return fcc;
}
@@ -259,7 +260,8 @@ static int fcc_vl2mp(int fcc)
case V4L2_PIX_FMT_YVU420: return MP_FOURCC_YV12;
case V4L2_PIX_FMT_YUYV: return MP_FOURCC_YUY2;
case V4L2_PIX_FMT_UYVY: return MP_FOURCC_UYVY;
- case V4L2_PIX_FMT_MJPEG: return MP_FOURCC_MJPEG;
+ case V4L2_PIX_FMT_MJPEG: return MP_FOURCC_MJPEG;
+ case V4L2_PIX_FMT_JPEG: return MP_FOURCC_JPEG;
}
return fcc;
}
@@ -298,6 +300,7 @@ static const char *pixfmt2name(char *buf, int pixfmt)
case V4L2_PIX_FMT_HI240: return "HI240";
case V4L2_PIX_FMT_WNVA: return "WNVA";
case V4L2_PIX_FMT_MJPEG: return "MJPEG";
+ case V4L2_PIX_FMT_JPEG: return "JPEG";
}
sprintf(buf, "unknown (0x%x)", pixfmt);
return buf;