[Pkg-gstreamer-commits] [gstreamer-vaapi] 137/176: vaapisink: set csc render flags from sinkpad caps.
Vincent Cheng
vcheng at moszumanska.debian.org
Tue Jun 3 08:09:35 UTC 2014
This is an automated email from the git hooks/post-receive script.
vcheng pushed a commit to branch upstream
in repository gstreamer-vaapi.
commit b1d3f7d4c0f3be8ec1f82aa00516596cafb7a0a2
Author: Holger Kaelberer <hk at getslash.de>
Date: Wed Jan 15 12:09:14 2014 +0100
vaapisink: set csc render flags from sinkpad caps.
This maps GstVideoColorimetry information in vaapisink's sinkpad caps
to GST_VAAPI_COLOR_STANDARD_* flags, if per-buffer information was not
available.
https://bugzilla.gnome.org/show_bug.cgi?id=722255
[factored out code, added SMPTE240M, handle per-buffer flags]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
---
gst/vaapi/gstvaapisink.c | 26 ++++++++++++++++++++++++++
gst/vaapi/gstvaapisink.h | 1 +
2 files changed, 27 insertions(+)
diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c
index 9c5ecd2..36c35bd 100644
--- a/gst/vaapi/gstvaapisink.c
+++ b/gst/vaapi/gstvaapisink.c
@@ -674,6 +674,26 @@ gst_vaapisink_get_caps(GstBaseSink *base_sink, GstCaps *filter)
#define gst_vaapisink_get_caps gst_vaapisink_get_caps_impl
#endif
+static void
+update_colorimetry(GstVaapiSink *sink, GstVideoColorimetry *cinfo)
+{
+#if GST_CHECK_VERSION(1,0,0)
+ if (gst_video_colorimetry_matches(cinfo,
+ GST_VIDEO_COLORIMETRY_BT601))
+ sink->color_standard = GST_VAAPI_COLOR_STANDARD_ITUR_BT_601;
+ else if (gst_video_colorimetry_matches(cinfo,
+ GST_VIDEO_COLORIMETRY_BT709))
+ sink->color_standard = GST_VAAPI_COLOR_STANDARD_ITUR_BT_709;
+ else if (gst_video_colorimetry_matches(cinfo,
+ GST_VIDEO_COLORIMETRY_SMPTE240M))
+ sink->color_standard = GST_VAAPI_COLOR_STANDARD_SMPTE_240M;
+ else
+ sink->color_standard = 0;
+
+ GST_DEBUG("colorimetry %s", gst_video_colorimetry_to_string(cinfo));
+#endif
+}
+
static gboolean
gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
{
@@ -702,6 +722,7 @@ gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
GST_DEBUG("video pixel-aspect-ratio %d/%d",
sink->video_par_n, sink->video_par_d);
+ update_colorimetry(sink, &vip->colorimetry);
gst_caps_replace(&sink->caps, caps);
gst_vaapisink_ensure_rotation(sink, FALSE);
@@ -1006,6 +1027,11 @@ gst_vaapisink_show_frame(GstBaseSink *base_sink, GstBuffer *src_buffer)
flags = gst_vaapi_video_meta_get_render_flags(meta);
+ /* Append default color standard obtained from caps if none was
+ available on a per-buffer basis */
+ if (!(flags & GST_VAAPI_COLOR_STANDARD_MASK))
+ flags |= sink->color_standard;
+
if (!gst_vaapi_apply_composition(surface, src_buffer))
GST_WARNING("could not update subtitles");
diff --git a/gst/vaapi/gstvaapisink.h b/gst/vaapi/gstvaapisink.h
index bcabe08..832689e 100644
--- a/gst/vaapi/gstvaapisink.h
+++ b/gst/vaapi/gstvaapisink.h
@@ -86,6 +86,7 @@ struct _GstVaapiSink {
GstVaapiRectangle display_rect;
GstVaapiRotation rotation;
GstVaapiRotation rotation_req;
+ guint color_standard;
guint foreign_window : 1;
guint fullscreen : 1;
guint synchronous : 1;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gstreamer/gstreamer-vaapi.git
More information about the Pkg-gstreamer-commits
mailing list