[Pkg-gstreamer-commits] [gstreamer-vaapi] 29/176: plugins: allow VA video meta to be allocated from surface proxy pools.

Vincent Cheng vcheng at moszumanska.debian.org
Tue Jun 3 08:09:25 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 b04c75848a7f5f6191b02de713e53f49339fbc0a
Author: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
Date:   Thu Nov 28 16:37:31 2013 +0100

    plugins: allow VA video meta to be allocated from surface proxy pools.
    
    Fix gst_vaapi_video_meta_new_from_pool() to allocate VA surface proxies
    from surface pools instead of plain VA surfaces. This is to simplify
    allocations now that surface proxies are created from a surface pool.
---
 gst/vaapi/gstvaapivideometa.c | 41 +++++++++++++++++++++++++++++++++++------
 1 file changed, 35 insertions(+), 6 deletions(-)

diff --git a/gst/vaapi/gstvaapivideometa.c b/gst/vaapi/gstvaapivideometa.c
index f770120..ce8c04d 100644
--- a/gst/vaapi/gstvaapivideometa.c
+++ b/gst/vaapi/gstvaapivideometa.c
@@ -98,6 +98,39 @@ set_surface_from_pool(GstVaapiVideoMeta *meta, GstVaapiVideoPool *pool)
     return TRUE;
 }
 
+static gboolean
+set_surface_proxy(GstVaapiVideoMeta *meta, GstVaapiSurfaceProxy *proxy)
+{
+    GstVaapiSurface *surface;
+
+    surface = GST_VAAPI_SURFACE_PROXY_SURFACE(proxy);
+    if (!surface)
+        return FALSE;
+
+    set_surface(meta, surface);
+    meta->proxy = gst_vaapi_surface_proxy_ref(proxy);
+    return TRUE;
+}
+
+static gboolean
+set_surface_proxy_from_pool(GstVaapiVideoMeta *meta, GstVaapiVideoPool *pool)
+{
+    GstVaapiSurfaceProxy *proxy;
+    gboolean success;
+
+    proxy = gst_vaapi_surface_proxy_new_from_pool(GST_VAAPI_SURFACE_POOL(pool));
+    if (!proxy)
+        return FALSE;
+
+    success = set_surface_proxy(meta, proxy);
+    gst_vaapi_surface_proxy_unref(proxy);
+    if (!success)
+        return FALSE;
+
+    meta->surface_pool = gst_vaapi_video_pool_ref(pool);
+    return TRUE;
+}
+
 static void
 gst_vaapi_video_meta_destroy_image(GstVaapiVideoMeta *meta)
 {
@@ -299,7 +332,7 @@ gst_vaapi_video_meta_new_from_pool(GstVaapiVideoPool *pool)
             goto error;
         break;
     case GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_SURFACE:
-        if (!set_surface_from_pool(meta, pool))
+        if (!set_surface_proxy_from_pool(meta, pool))
             goto error;
         break;
     }
@@ -638,7 +671,6 @@ void
 gst_vaapi_video_meta_set_surface_proxy(GstVaapiVideoMeta *meta,
     GstVaapiSurfaceProxy *proxy)
 {
-    GstVaapiSurface *surface;
     const GstVaapiRectangle *crop_rect;
 
     g_return_if_fail(GST_VAAPI_IS_VIDEO_META(meta));
@@ -646,11 +678,8 @@ gst_vaapi_video_meta_set_surface_proxy(GstVaapiVideoMeta *meta,
     gst_vaapi_video_meta_destroy_surface(meta);
 
     if (proxy) {
-        surface = GST_VAAPI_SURFACE_PROXY_SURFACE(proxy);
-        if (!surface)
+        if (!set_surface_proxy(meta, proxy))
             return;
-        set_surface(meta, surface);
-        meta->proxy = gst_vaapi_surface_proxy_ref(proxy);
 
         crop_rect = gst_vaapi_surface_proxy_get_crop_rect(proxy);
         if (crop_rect)

-- 
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