summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2015-08-16 18:13:12 +0200
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2015-08-16 18:13:27 +0200
commita31a753bfd35f2260d6204b06862c0f2884cc62b (patch)
treecbf33907c1954a6e5147c8bfb3c7663f9f68daa5
parentae5befef5f2c148c7358c7413ff7dd8e24f1e3db (diff)
downloadgstreamer-plugins-bad-a31a753bfd35f2260d6204b06862c0f2884cc62b.tar.gz
glupload: Recalculate offset and size in raw upload
As we only expose the mapped portion of the frame into the GL memory object (and not the original padding) we need to re-calculate the size and offset.
-rw-r--r--gst-libs/gst/gl/gstglupload.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c
index 926191410..0addca112 100644
--- a/gst-libs/gst/gl/gstglupload.c
+++ b/gst-libs/gst/gl/gstglupload.c
@@ -714,6 +714,8 @@ static struct RawUploadFrame *
_raw_upload_frame_new (struct RawUpload *raw, GstBuffer * buffer)
{
struct RawUploadFrame *frame;
+ GstVideoInfo *info;
+ gint i;
if (!buffer)
return NULL;
@@ -728,6 +730,14 @@ _raw_upload_frame_new (struct RawUpload *raw, GstBuffer * buffer)
}
raw->upload->priv->in_info = frame->frame.info;
+ info = &raw->upload->priv->in_info;
+
+ /* Recalculate the offsets (and size) */
+ info->size = 0;
+ for (i = 0; i < GST_VIDEO_INFO_N_PLANES (info); i++) {
+ info->offset[i] = info->size;
+ info->size += gst_gl_get_plane_data_size (info, NULL, i);
+ }
return frame;
}