From 6c539cbb4a11a7ba40c8ac32bfc42a3616752995 Mon Sep 17 00:00:00 2001 From: Michael Tretter Date: Tue, 31 Jan 2023 16:02:03 +0100 Subject: [PATCH] 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: --- subprojects/gst-plugins-good/docs/gst_plugins_cache.json | 4 ++-- subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-good/docs/gst_plugins_cache.json b/subprojects/gst-plugins-good/docs/gst_plugins_cache.json index cf759d4..25e8b41 100644 --- a/subprojects/gst-plugins-good/docs/gst_plugins_cache.json +++ b/subprojects/gst-plugins-good/docs/gst_plugins_cache.json @@ -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" } diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c index a992341..9b2dbc6 100644 --- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c +++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c @@ -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", -- 2.7.4