vaapiconvert: try directly copy buffer to derived surface first
[profile/ivi/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapiimage.h
index df6dd4f..46bfb19 100644 (file)
@@ -1,27 +1,30 @@
 /*
  *  gstvaapiimage.h - VA image abstraction
  *
- *  gstreamer-vaapi (C) 2010 Splitted-Desktop Systems
+ *  Copyright (C) 2010-2011 Splitted-Desktop Systems
+ *  Copyright (C) 2011-2012 Intel Corporation
  *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public License
+ *  as published by the Free Software Foundation; either version 2.1
+ *  of the License, or (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
+ *  This library is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301 USA
  */
 
 #ifndef GST_VAAPI_IMAGE_H
 #define GST_VAAPI_IMAGE_H
 
 #include <gst/gstbuffer.h>
+#include <gst/vaapi/gstvaapiobject.h>
 #include <gst/vaapi/gstvaapidisplay.h>
 #include <gst/vaapi/gstvaapiimageformat.h>
 
@@ -78,6 +81,7 @@ G_BEGIN_DECLS
 typedef struct _GstVaapiImage                   GstVaapiImage;
 typedef struct _GstVaapiImagePrivate            GstVaapiImagePrivate;
 typedef struct _GstVaapiImageClass              GstVaapiImageClass;
+typedef struct _GstVaapiImageRaw                GstVaapiImageRaw;
 
 /**
  * GstVaapiImage:
@@ -86,9 +90,8 @@ typedef struct _GstVaapiImageClass              GstVaapiImageClass;
  */
 struct _GstVaapiImage {
     /*< private >*/
-    GObject parent_instance;
+    GstVaapiObject parent_instance;
 
-    /*< private >*/
     GstVaapiImagePrivate *priv;
 };
 
@@ -99,11 +102,26 @@ struct _GstVaapiImage {
  */
 struct _GstVaapiImageClass {
     /*< private >*/
-    GObjectClass parent_class;
+    GstVaapiObjectClass parent_class;
+};
+
+/**
+ * GstVaapiImageRaw:
+ *
+ * A raw image wrapper. The caller is responsible for initializing all
+ * the fields with sensible values.
+ */
+struct _GstVaapiImageRaw {
+    GstVaapiImageFormat format;
+    guint               width;
+    guint               height;
+    guint               num_planes;
+    guchar             *pixels[3];
+    guint               stride[3];
 };
 
 GType
-gst_vaapi_image_get_type(void);
+gst_vaapi_image_get_type(void) G_GNUC_CONST;
 
 GstVaapiImage *
 gst_vaapi_image_new(
@@ -116,15 +134,12 @@ gst_vaapi_image_new(
 GstVaapiImage *
 gst_vaapi_image_new_with_image(GstVaapiDisplay *display, VAImage *va_image);
 
-VAImageID
+GstVaapiID
 gst_vaapi_image_get_id(GstVaapiImage *image);
 
 gboolean
 gst_vaapi_image_get_image(GstVaapiImage *image, VAImage *va_image);
 
-GstVaapiDisplay *
-gst_vaapi_image_get_display(GstVaapiImage *image);
-
 GstVaapiImageFormat
 gst_vaapi_image_get_format(GstVaapiImage *image);
 
@@ -162,7 +177,39 @@ guint
 gst_vaapi_image_get_data_size(GstVaapiImage *image);
 
 gboolean
-gst_vaapi_image_update_from_buffer(GstVaapiImage *image, GstBuffer *buffer);
+gst_vaapi_image_get_buffer(
+    GstVaapiImage     *image,
+    GstBuffer         *buffer,
+    GstVaapiRectangle *rect
+);
+
+gboolean
+gst_vaapi_image_get_raw(
+    GstVaapiImage     *image,
+    GstVaapiImageRaw  *dst_image,
+    GstVaapiRectangle *rect
+);
+
+gboolean
+gst_vaapi_image_update_from_buffer(
+    GstVaapiImage     *image,
+    GstBuffer         *buffer,
+    GstVaapiRectangle *rect
+);
+
+gboolean
+gst_vaapi_image_update_from_raw(
+    GstVaapiImage     *image,
+    GstVaapiImageRaw  *src_image,
+    GstVaapiRectangle *rect
+);
+
+gboolean
+gst_vaapi_convert_buffer_to_image(
+    GstVaapiImage *image,
+    GstBuffer *buffer,
+    GstVaapiImageFormat in_format);
+
 
 G_END_DECLS