aboutsummaryrefslogtreecommitdiff
path: root/gst/videomixer/videomixer2.c
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2012-10-08 10:46:50 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-10-08 10:46:50 +0200
commit4d1e52587e9e22a5bf0644b9ba2fea1dda86ba42 (patch)
tree4af83c0515fabb31b7601896560206c24cfb7b46 /gst/videomixer/videomixer2.c
parente8789381f41f0f3951e9631c8a44a21e582e0473 (diff)
Imported Upstream version 1.0.1
Diffstat (limited to 'gst/videomixer/videomixer2.c')
-rw-r--r--gst/videomixer/videomixer2.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/gst/videomixer/videomixer2.c b/gst/videomixer/videomixer2.c
index 98a3312d..5d428345 100644
--- a/gst/videomixer/videomixer2.c
+++ b/gst/videomixer/videomixer2.c
@@ -270,6 +270,7 @@ gst_videomixer2_update_src_caps (GstVideoMixer2 * mix)
gst_structure_get_fraction (s, "fraction", &info.fps_n, &info.fps_d);
}
+ gst_caps_unref (caps);
caps = gst_video_info_to_caps (&info);
GST_VIDEO_MIXER2_UNLOCK (mix);
@@ -835,10 +836,29 @@ gst_videomixer2_blend_buffers (GstVideoMixer2 * mix,
mix->fill_color (&outframe, 240, 128, 128);
break;
case VIDEO_MIXER2_BACKGROUND_TRANSPARENT:
- gst_buffer_memset (*outbuf, 0, 0, outsize);
+ {
+ guint i, plane, num_planes, height;
+
+ num_planes = GST_VIDEO_FRAME_N_PLANES (&outframe);
+ for (plane = 0; plane < num_planes; ++plane) {
+ guint8 *pdata;
+ gsize rowsize, plane_stride;
+
+ pdata = GST_VIDEO_FRAME_PLANE_DATA (&outframe, plane);
+ plane_stride = GST_VIDEO_FRAME_PLANE_STRIDE (&outframe, plane);
+ rowsize = GST_VIDEO_FRAME_COMP_WIDTH (&outframe, plane)
+ * GST_VIDEO_FRAME_COMP_PSTRIDE (&outframe, plane);
+ height = GST_VIDEO_FRAME_COMP_HEIGHT (&outframe, plane);
+ for (i = 0; i < height; ++i) {
+ memset (pdata, 0, rowsize);
+ pdata += plane_stride;
+ }
+ }
+
/* use overlay to keep background transparent */
composite = mix->overlay;
break;
+ }
}
for (l = mix->sinkpads; l; l = l->next) {