summaryrefslogtreecommitdiff
path: root/src/gstreamer
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2021-09-21 16:35:15 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-09-22 16:41:04 +0100
commitf9ca897c7fe2846f0a2163563014ca02d3c1624a (patch)
tree9362321b5e87f86d747459acf003e94165eda45a /src/gstreamer
parenta3b1539869ae53a6446a1c31bdade6560f91a46b (diff)
gstreamer: Support planar formats
Existing pipeline handlers already support planar YUV formats. Extend the gstreamer format map to incorporate them. While here, split the formats into distinct groups. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Diffstat (limited to 'src/gstreamer')
-rw-r--r--src/gstreamer/gstlibcamera-utils.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp
index 0af91c1a..e1af30c8 100644
--- a/src/gstreamer/gstlibcamera-utils.cpp
+++ b/src/gstreamer/gstlibcamera-utils.cpp
@@ -16,19 +16,32 @@ static struct {
GstVideoFormat gst_format;
PixelFormat format;
} format_map[] = {
+ /* Compressed */
{ GST_VIDEO_FORMAT_ENCODED, formats::MJPEG },
+
+ /* RGB */
{ GST_VIDEO_FORMAT_RGB, formats::BGR888 },
{ GST_VIDEO_FORMAT_BGR, formats::RGB888 },
{ GST_VIDEO_FORMAT_ARGB, formats::BGRA8888 },
+
+ /* YUV Semiplanar */
{ GST_VIDEO_FORMAT_NV12, formats::NV12 },
{ GST_VIDEO_FORMAT_NV21, formats::NV21 },
{ GST_VIDEO_FORMAT_NV16, formats::NV16 },
{ GST_VIDEO_FORMAT_NV61, formats::NV61 },
{ GST_VIDEO_FORMAT_NV24, formats::NV24 },
+
+ /* YUV Planar */
+ { GST_VIDEO_FORMAT_I420, formats::YUV420 },
+ { GST_VIDEO_FORMAT_YV12, formats::YVU420 },
+ { GST_VIDEO_FORMAT_Y42B, formats::YUV422 },
+
+ /* YUV Packed */
{ GST_VIDEO_FORMAT_UYVY, formats::UYVY },
{ GST_VIDEO_FORMAT_VYUY, formats::VYUY },
{ GST_VIDEO_FORMAT_YUY2, formats::YUYV },
{ GST_VIDEO_FORMAT_YVYU, formats::YVYU },
+
/* \todo NV42 is used in libcamera but is not mapped in GStreamer yet. */
};