summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2017-05-15 16:37:14 +0300
committerSebastian Dröge <sebastian@centricular.com>2017-05-15 16:38:51 +0300
commit7d64bb7513d7b0ce4f99450a38762bd718674df2 (patch)
tree8677f648c1aa2e884d75a6f0c3e64ff6d87c4c44 /sys
parent65545ecfa360ba28754611d077d9bb485c6a5d19 (diff)
downloadgstreamer-plugins-bad-7d64bb7513d7b0ce4f99450a38762bd718674df2.tar.gz
decklinkvideosink: Copy min(gstreamer_stride, decklink_stride) per line
Instead of just bpp * width, which might be more than we can copy.
Diffstat (limited to 'sys')
-rw-r--r--sys/decklink/gstdecklinkvideosink.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/decklink/gstdecklinkvideosink.cpp b/sys/decklink/gstdecklinkvideosink.cpp
index 7586bc356..78f5726fa 100644
--- a/sys/decklink/gstdecklinkvideosink.cpp
+++ b/sys/decklink/gstdecklinkvideosink.cpp
@@ -556,7 +556,7 @@ gst_decklink_video_sink_prepare (GstBaseSink * bsink, GstBuffer * buffer)
gint i;
GstDecklinkVideoFormat caps_format;
BMDPixelFormat format;
- gint bpp;
+ gint stride;
GstVideoTimeCodeMeta *tc_meta;
GST_DEBUG_OBJECT (self, "Preparing buffer %p", buffer);
@@ -568,7 +568,6 @@ gst_decklink_video_sink_prepare (GstBaseSink * bsink, GstBuffer * buffer)
caps_format = gst_decklink_type_from_video_format (self->info.finfo->format);
format = gst_decklink_pixel_format_from_type (caps_format);
- bpp = gst_decklink_bpp_from_type (caps_format);
timestamp = GST_BUFFER_TIMESTAMP (buffer);
duration = GST_BUFFER_DURATION (buffer);
@@ -623,8 +622,9 @@ gst_decklink_video_sink_prepare (GstBaseSink * bsink, GstBuffer * buffer)
frame->GetBytes ((void **) &outdata);
indata = (guint8 *) GST_VIDEO_FRAME_PLANE_DATA (&vframe, 0);
+ stride = MIN (GST_VIDEO_FRAME_PLANE_STRIDE (&vframe, 0), frame->GetRowBytes());
for (i = 0; i < self->info.height; i++) {
- memcpy (outdata, indata, GST_VIDEO_FRAME_WIDTH (&vframe) * bpp);
+ memcpy (outdata, indata, stride);
indata += GST_VIDEO_FRAME_PLANE_STRIDE (&vframe, 0);
outdata += frame->GetRowBytes ();
}