Export gst_vaapi_video_buffer_new().
authorgb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Thu, 29 Apr 2010 21:56:10 +0000 (21:56 +0000)
committerGwenole Beauchesne <gbeauchesne@splitted-desktop.com>
Mon, 20 Sep 2010 10:55:41 +0000 (12:55 +0200)
gst-libs/gst/vaapi/gstvaapivideobuffer.c
gst-libs/gst/vaapi/gstvaapivideobuffer.h

index bb002bf..113df76 100644 (file)
@@ -127,16 +127,25 @@ gst_vaapi_video_buffer_init(GstVaapiVideoBuffer *buffer)
     priv->proxy         = NULL;
 }
 
-static inline GstVaapiVideoBuffer *
-gst_vaapi_video_buffer_new(void)
+/**
+ * gst_vaapi_video_buffer_new:
+ *
+ * Creates an empty #GstBuffer. The caller is responsible for completing
+ * the initialization of the buffer with the gst_vaapi_video_buffer_set_*()
+ * functions.
+ *
+ * Return value: the newly allocated #GstBuffer, or %NULL or error
+ */
+static inline gpointer
+_gst_vaapi_video_buffer_new(void)
 {
-    GstMiniObject *object;
-
-    object = gst_mini_object_new(GST_VAAPI_TYPE_VIDEO_BUFFER);
-    if (!object)
-        return NULL;
+    return gst_mini_object_new(GST_VAAPI_TYPE_VIDEO_BUFFER);
+}
 
-    return GST_VAAPI_VIDEO_BUFFER(object);
+GstBuffer *
+gst_vaapi_video_buffer_new(void)
+{
+    return _gst_vaapi_video_buffer_new();
 }
 
 /**
@@ -165,7 +174,7 @@ gst_vaapi_video_buffer_new_from_pool(GstVaapiVideoPool *pool)
     if (!is_image_pool && !is_surface_pool)
         return NULL;
 
-    buffer = gst_vaapi_video_buffer_new();
+    buffer = _gst_vaapi_video_buffer_new();
     if (buffer &&
         ((is_image_pool &&
           gst_vaapi_video_buffer_set_image_from_pool(buffer, pool)) ||
@@ -193,7 +202,7 @@ gst_vaapi_video_buffer_new_with_image(GstVaapiImage *image)
 
     g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), NULL);
 
-    buffer = gst_vaapi_video_buffer_new();
+    buffer = _gst_vaapi_video_buffer_new();
     if (buffer)
         gst_vaapi_video_buffer_set_image(buffer, image);
     return GST_BUFFER(buffer);
@@ -215,7 +224,7 @@ gst_vaapi_video_buffer_new_with_surface(GstVaapiSurface *surface)
 
     g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), NULL);
 
-    buffer = gst_vaapi_video_buffer_new();
+    buffer = _gst_vaapi_video_buffer_new();
     if (buffer)
         gst_vaapi_video_buffer_set_surface(buffer, surface);
     return GST_BUFFER(buffer);
@@ -237,7 +246,7 @@ gst_vaapi_video_buffer_new_with_surface_proxy(GstVaapiSurfaceProxy *proxy)
 
     g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), NULL);
 
-    buffer = gst_vaapi_video_buffer_new();
+    buffer = _gst_vaapi_video_buffer_new();
     if (buffer)
         gst_vaapi_video_buffer_set_surface_proxy(buffer, proxy);
     return GST_BUFFER(buffer);
index 1303df7..55b4633 100644 (file)
@@ -83,6 +83,9 @@ GType
 gst_vaapi_video_buffer_get_type(void);
 
 GstBuffer *
+gst_vaapi_video_buffer_new(void);
+
+GstBuffer *
 gst_vaapi_video_buffer_new_from_pool(GstVaapiVideoPool *pool);
 
 GstBuffer *