v4l2object: mark jpeg as parsed

Assuming that V4L2 CAPTURE devices always use one buffer per JPEG image, we can
always mark JPEGs provided by a V4L2 element as parsed.

The V4L2 elements require that JPEG images sent to V4L2 OUTPUT devices must
always be parsed.

This is necessary to link a V4L2 CAPTURE device with a V4L2 OUTPUT device
without explicitly marking the stream as parsed or adding a jpegparse into the
pipeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4247>
This commit is contained in:
Michael Tretter 2023-01-31 16:02:03 +01:00 committed by Tim-Philipp Müller
parent 5fcd34bf22
commit 6c539cbb4a
2 changed files with 4 additions and 3 deletions

View file

@ -24891,7 +24891,7 @@
"long-name": "Video (video4linux2) Sink",
"pad-templates": {
"sink": {
"caps": "image/jpeg:\nvideo/mpeg:\n mpegversion: 4\n systemstream: false\nvideo/mpeg:\n mpegversion: { (int)1, (int)2 }\nvideo/mpegts:\n systemstream: true\nvideo/x-bayer:\n format: { bggr, gbrg, grbg, rggb }\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-dv:\n systemstream: true\nvideo/x-fwht:\nvideo/x-h263:\n variant: itu\nvideo/x-h264:\n stream-format: { (string)byte-stream, (string)avc }\n alignment: au\nvideo/x-h265:\n stream-format: byte-stream\n alignment: au\nvideo/x-pwc1:\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-pwc2:\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-raw:\n format: { RGB16, BGR, RGB, ABGR, xBGR, RGBA, RGBx, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU, UYVY, Y42B, Y41B, YUV9, NV12_64Z32, NV12_8L128, NV12_10BE_8L128, NV24, NV12_16L32S, NV61, NV16, NV21, NV12, I420, ARGB, xRGB, BGRA, BGRx, BGR15, RGB15 }\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-sonix:\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-vp8:\nvideo/x-vp9:\nvideo/x-wmv:\n wmvversion: 3\n format: WVC1\n\nvideo/x-raw(format:Interlaced):\n format: { RGB16, BGR, RGB, ABGR, xBGR, RGBA, RGBx, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU, UYVY, Y42B, Y41B, YUV9, NV12_64Z32, NV12_8L128, NV12_10BE_8L128, NV24, NV12_16L32S, NV61, NV16, NV21, NV12, I420, ARGB, xRGB, BGRA, BGRx, BGR15, RGB15 }\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\n interlace-mode: alternate\n",
"caps": "image/jpeg:\n parsed: true\nvideo/mpeg:\n mpegversion: 4\n systemstream: false\nvideo/mpeg:\n mpegversion: { (int)1, (int)2 }\nvideo/mpegts:\n systemstream: true\nvideo/x-bayer:\n format: { bggr, gbrg, grbg, rggb }\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-dv:\n systemstream: true\nvideo/x-fwht:\nvideo/x-h263:\n variant: itu\nvideo/x-h264:\n stream-format: { (string)byte-stream, (string)avc }\n alignment: au\nvideo/x-h265:\n stream-format: byte-stream\n alignment: au\nvideo/x-pwc1:\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-pwc2:\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-raw:\n format: { RGB16, BGR, RGB, ABGR, xBGR, RGBA, RGBx, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU, UYVY, Y42B, Y41B, YUV9, NV12_64Z32, NV12_8L128, NV12_10BE_8L128, NV24, NV12_16L32S, NV61, NV16, NV21, NV12, I420, ARGB, xRGB, BGRA, BGRx, BGR15, RGB15 }\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-sonix:\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-vp8:\nvideo/x-vp9:\nvideo/x-wmv:\n wmvversion: 3\n format: WVC1\n\nvideo/x-raw(format:Interlaced):\n format: { RGB16, BGR, RGB, ABGR, xBGR, RGBA, RGBx, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU, UYVY, Y42B, Y41B, YUV9, NV12_64Z32, NV12_8L128, NV12_10BE_8L128, NV24, NV12_16L32S, NV61, NV16, NV21, NV12, I420, ARGB, xRGB, BGRA, BGRx, BGR15, RGB15 }\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\n interlace-mode: alternate\n",
"direction": "sink",
"presence": "always"
}
@ -25199,7 +25199,7 @@
"long-name": "Video (video4linux2) Source",
"pad-templates": {
"src": {
"caps": "image/jpeg:\nvideo/mpeg:\n mpegversion: 4\n systemstream: false\nvideo/mpeg:\n mpegversion: { (int)1, (int)2 }\nvideo/mpegts:\n systemstream: true\nvideo/x-bayer:\n format: { bggr, gbrg, grbg, rggb }\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-dv:\n systemstream: true\nvideo/x-fwht:\nvideo/x-h263:\n variant: itu\nvideo/x-h264:\n stream-format: { (string)byte-stream, (string)avc }\n alignment: au\nvideo/x-h265:\n stream-format: byte-stream\n alignment: au\nvideo/x-pwc1:\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-pwc2:\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-raw:\n format: { RGB16, BGR, RGB, ABGR, xBGR, RGBA, RGBx, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU, UYVY, Y42B, Y41B, YUV9, NV12_64Z32, NV12_8L128, NV12_10BE_8L128, NV24, NV12_16L32S, NV61, NV16, NV21, NV12, I420, ARGB, xRGB, BGRA, BGRx, BGR15, RGB15 }\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-sonix:\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-vp8:\nvideo/x-vp9:\nvideo/x-wmv:\n wmvversion: 3\n format: WVC1\n\nvideo/x-raw(format:Interlaced):\n format: { RGB16, BGR, RGB, ABGR, xBGR, RGBA, RGBx, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU, UYVY, Y42B, Y41B, YUV9, NV12_64Z32, NV12_8L128, NV12_10BE_8L128, NV24, NV12_16L32S, NV61, NV16, NV21, NV12, I420, ARGB, xRGB, BGRA, BGRx, BGR15, RGB15 }\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\n interlace-mode: alternate\n",
"caps": "image/jpeg:\n parsed: true\nvideo/mpeg:\n mpegversion: 4\n systemstream: false\nvideo/mpeg:\n mpegversion: { (int)1, (int)2 }\nvideo/mpegts:\n systemstream: true\nvideo/x-bayer:\n format: { bggr, gbrg, grbg, rggb }\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-dv:\n systemstream: true\nvideo/x-fwht:\nvideo/x-h263:\n variant: itu\nvideo/x-h264:\n stream-format: { (string)byte-stream, (string)avc }\n alignment: au\nvideo/x-h265:\n stream-format: byte-stream\n alignment: au\nvideo/x-pwc1:\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-pwc2:\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-raw:\n format: { RGB16, BGR, RGB, ABGR, xBGR, RGBA, RGBx, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU, UYVY, Y42B, Y41B, YUV9, NV12_64Z32, NV12_8L128, NV12_10BE_8L128, NV24, NV12_16L32S, NV61, NV16, NV21, NV12, I420, ARGB, xRGB, BGRA, BGRx, BGR15, RGB15 }\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-sonix:\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\nvideo/x-vp8:\nvideo/x-vp9:\nvideo/x-wmv:\n wmvversion: 3\n format: WVC1\n\nvideo/x-raw(format:Interlaced):\n format: { RGB16, BGR, RGB, ABGR, xBGR, RGBA, RGBx, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU, UYVY, Y42B, Y41B, YUV9, NV12_64Z32, NV12_8L128, NV12_10BE_8L128, NV24, NV12_16L32S, NV61, NV16, NV21, NV12, I420, ARGB, xRGB, BGRA, BGRx, BGR15, RGB15 }\n width: [ 1, 32768 ]\n height: [ 1, 32768 ]\n framerate: [ 0/1, 2147483647/1 ]\n interlace-mode: alternate\n",
"direction": "src",
"presence": "always"
}

View file

@ -1453,7 +1453,8 @@ gst_v4l2_object_v4l2fourcc_to_bare_struct (guint32 fourcc)
case V4L2_PIX_FMT_MJPEG: /* Motion-JPEG */
case V4L2_PIX_FMT_PJPG: /* Progressive-JPEG */
case V4L2_PIX_FMT_JPEG: /* JFIF JPEG */
structure = gst_structure_new_empty ("image/jpeg");
structure = gst_structure_new ("image/jpeg",
"parsed", G_TYPE_BOOLEAN, TRUE, NULL);
break;
case V4L2_PIX_FMT_MPEG1:
structure = gst_structure_new ("video/mpeg",