From 2573de106218e3b7827d7679ef79ae5eda76d576 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sat, 18 Jun 2011 15:51:54 -0700 Subject: [PATCH] colorspace: Add JPEG YCbCr matrix --- gst/colorspace/colorspace.c | 6 ++++-- gst/colorspace/colorspace.h | 3 ++- gst/colorspace/gstcolorspace.c | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gst/colorspace/colorspace.c b/gst/colorspace/colorspace.c index 3fd1ccde9c..bfaa9e7b39 100644 --- a/gst/colorspace/colorspace.c +++ b/gst/colorspace/colorspace.c @@ -49,7 +49,8 @@ colorspace_convert_new (GstVideoFormat to_format, ColorSpaceColorSpec to_spec, || to_spec == COLOR_SPEC_RGB, NULL); g_return_val_if_fail (!gst_video_format_is_yuv (to_format) || to_spec == COLOR_SPEC_YUV_BT709 - || to_spec == COLOR_SPEC_YUV_BT470_6, NULL); + || to_spec == COLOR_SPEC_YUV_BT470_6 + || to_spec == COLOR_SPEC_YUV_JPEG, NULL); g_return_val_if_fail (gst_video_format_is_rgb (to_format) || gst_video_format_is_yuv (to_format) || (gst_video_format_is_gray (to_format) && @@ -59,7 +60,8 @@ colorspace_convert_new (GstVideoFormat to_format, ColorSpaceColorSpec to_spec, || from_spec == COLOR_SPEC_RGB, NULL); g_return_val_if_fail (!gst_video_format_is_yuv (from_format) || from_spec == COLOR_SPEC_YUV_BT709 - || from_spec == COLOR_SPEC_YUV_BT470_6, NULL); + || from_spec == COLOR_SPEC_YUV_BT470_6 + || from_spec == COLOR_SPEC_YUV_JPEG, NULL); g_return_val_if_fail (gst_video_format_is_rgb (from_format) || gst_video_format_is_yuv (from_format) || (gst_video_format_is_gray (from_format) && diff --git a/gst/colorspace/colorspace.h b/gst/colorspace/colorspace.h index 05bcc18670..7ae8892060 100644 --- a/gst/colorspace/colorspace.h +++ b/gst/colorspace/colorspace.h @@ -32,7 +32,8 @@ typedef enum { COLOR_SPEC_RGB, COLOR_SPEC_GRAY, COLOR_SPEC_YUV_BT470_6, - COLOR_SPEC_YUV_BT709 + COLOR_SPEC_YUV_BT709, + COLOR_SPEC_YUV_JPEG } ColorSpaceColorSpec; typedef enum { diff --git a/gst/colorspace/gstcolorspace.c b/gst/colorspace/gstcolorspace.c index 6b512b5b2f..1f396c7e8a 100644 --- a/gst/colorspace/gstcolorspace.c +++ b/gst/colorspace/gstcolorspace.c @@ -278,6 +278,8 @@ gst_csp_set_caps (GstBaseTransform * btrans, GstCaps * incaps, if (matrix && g_str_equal (matrix, "hdtv")) in_spec = COLOR_SPEC_YUV_BT709; + else if (matrix && g_str_equal (matrix, "jpeg")) + in_spec = COLOR_SPEC_YUV_JPEG; else in_spec = COLOR_SPEC_YUV_BT470_6; } else { @@ -308,6 +310,8 @@ gst_csp_set_caps (GstBaseTransform * btrans, GstCaps * incaps, if (matrix && g_str_equal (matrix, "hdtv")) out_spec = COLOR_SPEC_YUV_BT709; + else if (matrix && g_str_equal (matrix, "jpeg")) + out_spec = COLOR_SPEC_YUV_JPEG; else out_spec = COLOR_SPEC_YUV_BT470_6; } else {