diff options
author | Matthew Waters <matthew@centricular.com> | 2015-07-14 17:40:32 +1000 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2015-07-14 17:49:17 +1000 |
commit | 82c0189b2842e8729e82a4e73491dffc977bc7c2 (patch) | |
tree | 017cd58b5cb7a46241d73e09211eed7b04c73811 /gst-libs | |
parent | 19f2b3b882fae83da168808e47f6bfdba0e8b846 (diff) | |
download | gstreamer-plugins-bad-82c0189b2842e8729e82a4e73491dffc977bc7c2.tar.gz |
glupload: memcpy on raw data upload
Anything else requires keeping track of the GstVideoFrame mapping
across possible multiple buffers to ensure correct data pointer
usage.
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/gl/gstglupload.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index 0ccf328ee..358cdb7a9 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -782,7 +782,6 @@ static GstGLUploadReturn _raw_data_upload_perform (gpointer impl, GstBuffer * buffer, GstBuffer ** outbuf) { - GstGLMemory *in_tex[GST_GL_UPLOAD_MAX_PLANES] = { 0, }; struct RawUpload *raw = impl; int i; GstVideoInfo *in_info = &raw->upload->priv->in_info; @@ -793,12 +792,22 @@ _raw_data_upload_perform (gpointer impl, GstBuffer * buffer, GST_VIDEO_MULTIVIEW_MODE_SEPARATED) max_planes *= GST_VIDEO_INFO_VIEWS (in_info); - gst_gl_memory_setup_wrapped (raw->upload->context, - &raw->upload->priv->in_info, NULL, raw->in_frame.data, in_tex); - + /* FIXME: buffer pool */ *outbuf = gst_buffer_new (); + gst_gl_memory_setup_buffer (raw->upload->context, NULL, + &raw->upload->priv->in_info, NULL, *outbuf); + for (i = 0; i < max_planes; i++) { - gst_buffer_append_memory (*outbuf, (GstMemory *) in_tex[i]); + GstMemory *mem = gst_buffer_peek_memory (*outbuf, i); + GstMapInfo map_info; + + gst_memory_map (mem, &map_info, GST_MAP_WRITE); + + memcpy (map_info.data, raw->in_frame.data[i], map_info.size); + + gst_memory_unmap (mem, &map_info); + + gst_gl_memory_upload_transfer ((GstGLMemory *) mem); } return GST_GL_UPLOAD_DONE; |