[Pkg-gstreamer-commits] [gstreamer-vaapi] 67/176: plugins: implement GLTextureUploadMeta user data copy.

Vincent Cheng vcheng at moszumanska.debian.org
Tue Jun 3 08:09:28 UTC 2014


This is an automated email from the git hooks/post-receive script.

vcheng pushed a commit to branch upstream
in repository gstreamer-vaapi.

commit bf8f244de3262c782f425252afe919dbad0f554b
Author: Matthieu Bouron <matthieu.bouron at collabora.com>
Date:   Thu Dec 12 17:01:29 2013 +0000

    plugins: implement GLTextureUploadMeta user data copy.
    
    Makes the copies of a buffer reference their own GLTextureUploadMeta
    user data and prevent the original buffer accessing already freed
    memory if its copies has been released and freed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=720336
    
    [Propagate the original meta texture to the copy too]
    Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
---
 gst/vaapi/gstvaapivideometa_texture.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/gst/vaapi/gstvaapivideometa_texture.c b/gst/vaapi/gstvaapivideometa_texture.c
index 8a38be6..8d96770 100644
--- a/gst/vaapi/gstvaapivideometa_texture.c
+++ b/gst/vaapi/gstvaapivideometa_texture.c
@@ -57,6 +57,19 @@ meta_texture_new(void)
     return meta;
 }
 
+static GstVaapiVideoMetaTexture *
+meta_texture_copy(GstVaapiVideoMetaTexture *meta)
+{
+    GstVaapiVideoMetaTexture *copy;
+
+    copy = meta_texture_new();
+    if (!copy)
+        return NULL;
+
+    gst_vaapi_texture_replace(&copy->texture, meta->texture);
+    return copy;
+}
+
 static gboolean
 gst_vaapi_texture_upload(GstVideoGLTextureUploadMeta *meta, guint texture_id[4])
 {
@@ -108,7 +121,8 @@ gst_buffer_add_texture_upload_meta(GstBuffer *buffer)
     meta = gst_buffer_add_video_gl_texture_upload_meta(buffer,
         GST_VIDEO_GL_TEXTURE_ORIENTATION_X_NORMAL_Y_NORMAL,
         1, tex_type, gst_vaapi_texture_upload,
-        meta_texture, NULL, (GBoxedFreeFunc)meta_texture_free);
+        meta_texture, (GBoxedCopyFunc)meta_texture_copy,
+        (GBoxedFreeFunc)meta_texture_free);
     if (!meta)
         goto error;
     return TRUE;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gstreamer/gstreamer-vaapi.git



More information about the Pkg-gstreamer-commits mailing list