diff options
author | Wim Taymans <wtaymans@redhat.com> | 2016-01-20 10:02:20 +0100 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2016-01-20 10:35:05 +0100 |
commit | 2f1522789cf7d253a202b0512cab165aa6c4b435 (patch) | |
tree | 1118eba7f6d2f24944c912ec390deb023ef4d29b | |
parent | 9e3e864bdf69e0207d5a820c329562e00caf40b7 (diff) | |
download | gstreamer-plugins-base-2f1522789cf7d253a202b0512cab165aa6c4b435.tar.gz |
video-converter: ignore matrix for RGB formats
For RGB formats, the matrix in the colorimetry (conversion from YUV to
RGB) is irrelevant and we should ignore it and assume the identity
transform for everything we do.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=759624
-rw-r--r-- | gst-libs/gst/video/video-converter.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gst-libs/gst/video/video-converter.c b/gst-libs/gst/video/video-converter.c index 31d51e43f..75fa0a87b 100644 --- a/gst-libs/gst/video/video-converter.c +++ b/gst-libs/gst/video/video-converter.c @@ -2128,6 +2128,13 @@ gst_video_converter_new (GstVideoInfo * in_info, GstVideoInfo * out_info, finfo = gst_video_format_get_info (convert->unpack_format); convert->unpack_bits = GST_VIDEO_FORMAT_INFO_DEPTH (finfo, 0); convert->unpack_rgb = GST_VIDEO_FORMAT_INFO_IS_RGB (finfo); + if (convert->unpack_rgb + && in_info->colorimetry.matrix != GST_VIDEO_COLOR_MATRIX_RGB) { + /* force identity matrix for RGB input */ + GST_WARNING ("invalid matrix %d for input RGB format, using RGB", + in_info->colorimetry.matrix); + convert->in_info.colorimetry.matrix = GST_VIDEO_COLOR_MATRIX_RGB; + } convert->pack_format = out_info->finfo->unpack_format; finfo = gst_video_format_get_info (convert->pack_format); @@ -2136,6 +2143,13 @@ gst_video_converter_new (GstVideoInfo * in_info, GstVideoInfo * out_info, convert->pack_pal = gst_video_format_get_palette (GST_VIDEO_INFO_FORMAT (out_info), &convert->pack_palsize); + if (convert->pack_rgb + && out_info->colorimetry.matrix != GST_VIDEO_COLOR_MATRIX_RGB) { + /* force identity matrix for RGB output */ + GST_WARNING ("invalid matrix %d for output RGB format, using RGB", + out_info->colorimetry.matrix); + convert->out_info.colorimetry.matrix = GST_VIDEO_COLOR_MATRIX_RGB; + } if (video_converter_lookup_fastpath (convert)) goto done; |