From a2237750892f5d69b76430173393b19a89d4d33b Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Fri, 30 Sep 2011 09:44:12 -0300 Subject: [PATCH 1/2] encodebin: Fix typo on formatter adding condition The condition is if the muxer doesn't have tag setter *and* isn't a formatter itself. Any of those two conditions makes the muxer good enough to not need a formatter. --- gst/encoding/gstencodebin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/encoding/gstencodebin.c b/gst/encoding/gstencodebin.c index 740c9c9ea8..3ce67ff44c 100644 --- a/gst/encoding/gstencodebin.c +++ b/gst/encoding/gstencodebin.c @@ -1068,7 +1068,7 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof, */ if (!ebin->muxer || (!gst_element_implements_interface (ebin->muxer, GST_TYPE_TAG_SETTER) - || !_has_class (ebin->muxer, "Formatter"))) { + && !_has_class (ebin->muxer, "Formatter"))) { sgroup->formatter = _get_formatter (ebin, sprof); if (sgroup->formatter) { GST_DEBUG ("Adding formatter for %" GST_PTR_FORMAT, format); From 15dc83946755713d8c4e32fd89f7c69330ff6d9e Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Sat, 1 Oct 2011 01:05:00 +0100 Subject: [PATCH 2/2] textoverlay: add YV12 support Basically the same as I420, just with chroma planes swapped. https://bugzilla.gnome.org/show_bug.cgi?id=660604 --- ext/pango/gsttextoverlay.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ext/pango/gsttextoverlay.c b/ext/pango/gsttextoverlay.c index e740ba6f40..ac2e4a6b0e 100644 --- a/ext/pango/gsttextoverlay.c +++ b/ext/pango/gsttextoverlay.c @@ -213,7 +213,7 @@ static GstStaticPadTemplate src_template_factory = GST_VIDEO_CAPS_BGRA ";" GST_VIDEO_CAPS_ARGB ";" GST_VIDEO_CAPS_ABGR ";" - GST_VIDEO_CAPS_YUV ("{AYUV, I420, UYVY, NV12, NV21}")) + GST_VIDEO_CAPS_YUV ("{AYUV, I420, YV12, UYVY, NV12, NV21}")) ); static GstStaticPadTemplate video_sink_template_factory = @@ -228,7 +228,7 @@ static GstStaticPadTemplate video_sink_template_factory = GST_VIDEO_CAPS_BGRA ";" GST_VIDEO_CAPS_ARGB ";" GST_VIDEO_CAPS_ABGR ";" - GST_VIDEO_CAPS_YUV ("{AYUV, I420, UYVY, NV12, NV21}")) + GST_VIDEO_CAPS_YUV ("{AYUV, I420, YV12, UYVY, NV12, NV21}")) ); static GstStaticPadTemplate text_sink_template_factory = @@ -1641,7 +1641,7 @@ gst_text_overlay_blit_NV12_NV21 (GstTextOverlay * overlay, } static inline void -gst_text_overlay_blit_I420 (GstTextOverlay * overlay, +gst_text_overlay_blit_I420_YV12 (GstTextOverlay * overlay, guint8 * yuv_pixels, gint xpos, gint ypos) { int y_stride, u_stride, v_stride; @@ -1657,13 +1657,11 @@ gst_text_overlay_blit_I420 (GstTextOverlay * overlay, w = overlay->width; h = overlay->height; - y_stride = gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420, 0, w); - u_stride = gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420, 1, w); - v_stride = gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420, 2, w); - u_offset = - gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 1, w, h); - v_offset = - gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 2, w, h); + y_stride = gst_video_format_get_row_stride (overlay->format, 0, w); + u_stride = gst_video_format_get_row_stride (overlay->format, 1, w); + v_stride = gst_video_format_get_row_stride (overlay->format, 2, w); + u_offset = gst_video_format_get_component_offset (overlay->format, 1, w, h); + v_offset = gst_video_format_get_component_offset (overlay->format, 2, w, h); gst_text_overlay_blit_1 (overlay, yuv_pixels, xpos, ypos, overlay->text_image, y_stride); @@ -2013,6 +2011,7 @@ gst_text_overlay_push_frame (GstTextOverlay * overlay, GstBuffer * video_frame) if (overlay->want_shading) { switch (overlay->format) { case GST_VIDEO_FORMAT_I420: + case GST_VIDEO_FORMAT_YV12: case GST_VIDEO_FORMAT_NV12: case GST_VIDEO_FORMAT_NV21: gst_text_overlay_shade_planar_Y (overlay, @@ -2076,7 +2075,8 @@ gst_text_overlay_push_frame (GstTextOverlay * overlay, GstBuffer * video_frame) if (overlay->text_image) { switch (overlay->format) { case GST_VIDEO_FORMAT_I420: - gst_text_overlay_blit_I420 (overlay, + case GST_VIDEO_FORMAT_YV12: + gst_text_overlay_blit_I420_YV12 (overlay, GST_BUFFER_DATA (video_frame), xpos, ypos); break; case GST_VIDEO_FORMAT_NV12: