[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gstreamer-cvs
Subject:    gst-plugins-bad: glmemory: Support offset when downloading
From:       nicolasd () kemper ! freedesktop ! org (Nicolas Dufresne)
Date:       2015-02-28 20:02:32
Message-ID: 20150228200232.4AC7D762D6 () kemper ! freedesktop ! org
[Download RAW message or body]

Module: gst-plugins-bad
Branch: master
Commit: 04377cfc5e749c8c9bb22678aef5a33a8e167a76
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=04377cfc5e749c8c9bb22678aef5a33a8e167a76


Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Date:   Sat Feb 28 15:00:13 2015 -0500

glmemory: Support offset when downloading

Make sure we support offset and video alignment when downloading too.
This is currently not used (plane_start is always 0), but it makes
the code correct if we want to use that later.

---

 gst-libs/gst/gl/gstglmemory.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gst-libs/gst/gl/gstglmemory.c b/gst-libs/gst/gl/gstglmemory.c
index 0aca76a..e134d16 100644
--- a/gst-libs/gst/gl/gstglmemory.c
+++ b/gst-libs/gst/gl/gstglmemory.c
@@ -655,7 +655,7 @@ _download_memory (GstGLContext * context, GstGLMemory * gl_mem)
     gl->GetTexImage (gl_mem->tex_target, 0, format, type, gl_mem->data);
     gl->BindTexture (gl_mem->tex_target, 0);
   } else if (gl_mem->transfer_pbo && CONTEXT_SUPPORTS_PBO_DOWNLOAD (context)) {
-    gsize size;
+    gsize size, plane_start;
     gpointer map_data = NULL;
 
     size = gst_gl_get_plane_data_size (&gl_mem->info, &gl_mem->valign,
@@ -671,7 +671,8 @@ _download_memory (GstGLContext * context, GstGLMemory * gl_mem)
     }
 
     /* FIXME: COPY! use glMapBuffer + glSync everywhere to remove this */
-    memcpy (gl_mem->data, map_data, size);
+    plane_start = _find_plane_frame_start (gl_mem);
+    memcpy ((guint8 *) gl_mem->data + plane_start, map_data, size);
 
     gl->UnmapBuffer (GL_PIXEL_PACK_BUFFER);
     gl->BindBuffer (GL_PIXEL_PACK_BUFFER, 0);

_______________________________________________
gstreamer-commits mailing list
gstreamer-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic