mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 23:58:17 +00:00
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.
This commit is contained in:
parent
7e62a38569
commit
edd3c007ea
1 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue