gst_vaapi_image_get_pitch
gst_vaapi_image_get_data_size
gst_vaapi_image_get_buffer
-gst_vaapi_image_get_raw
gst_vaapi_image_update_from_buffer
gst_vaapi_image_copy
<SUBSECTION Standard>
gstvaapidecoder_priv.h \
gstvaapidecoder_unit.h \
gstvaapidisplay_priv.h \
+ gstvaapiimage_priv.h \
gstvaapiminiobject.h \
gstvaapiobject_priv.h \
gstvaapiparser_frame.h \
#include "gstvaapicompat.h"
#include "gstvaapiutils.h"
#include "gstvaapiimage.h"
+#include "gstvaapiimage_priv.h"
#include "gstvaapiobject_priv.h"
#define DEBUG 1
#include "gstvaapidebug.h"
-typedef struct _GstVaapiImageClass GstVaapiImageClass;
-
-/**
- * GstVaapiImage:
- *
- * A VA image wrapper
- */
-struct _GstVaapiImage {
- /*< private >*/
- GstVaapiObject parent_instance;
-
- VAImage internal_image;
- VAImage image;
- guchar *image_data;
- GstVideoFormat internal_format;
- GstVideoFormat format;
- guint width;
- guint height;
- guint is_linear : 1;
-};
-
-/**
- * GstVaapiImageClass:
- *
- * A VA image wrapper class
- */
-struct _GstVaapiImageClass {
- /*< private >*/
- GstVaapiObjectClass parent_class;
-};
-
#define SWAP_UINT(a, b) do { \
guint v = a; \
a = b; \
#define GST_VAAPI_IMAGE_HEIGHT(image) gst_vaapi_image_get_height(image)
typedef struct _GstVaapiImage GstVaapiImage;
-typedef struct _GstVaapiImageRaw GstVaapiImageRaw;
-
-/**
- * GstVaapiImageRaw:
- *
- * A raw image wrapper. The caller is responsible for initializing all
- * the fields with sensible values.
- */
-struct _GstVaapiImageRaw {
- GstVideoFormat format;
- guint width;
- guint height;
- guint num_planes;
- guchar *pixels[3];
- guint stride[3];
-};
GstVaapiImage *
gst_vaapi_image_new(
);
gboolean
-gst_vaapi_image_get_raw(
- GstVaapiImage *image,
- GstVaapiImageRaw *dst_image,
- GstVaapiRectangle *rect
-);
-
-gboolean
gst_vaapi_image_update_from_buffer(
GstVaapiImage *image,
GstBuffer *buffer,
);
gboolean
-gst_vaapi_image_update_from_raw(
- GstVaapiImage *image,
- GstVaapiImageRaw *src_image,
- GstVaapiRectangle *rect
-);
-
-gboolean
gst_vaapi_image_copy(GstVaapiImage *dst_image, GstVaapiImage *src_image);
G_END_DECLS
--- /dev/null
+/*
+ * gstvaapiimage_priv.h - VA image abstraction (private definitions)
+ *
+ * Copyright (C) 2010-2011 Splitted-Desktop Systems
+ * Copyright (C) 2011-2013 Intel Corporation
+ *
+ * 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 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
+ * Lesser General Public License for more details.
+ *
+ * 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_PRIV_H
+#define GST_VAAPI_IMAGE_PRIV_H
+
+#include <gst/vaapi/gstvaapiimage.h>
+#include "gstvaapiobject_priv.h"
+
+G_BEGIN_DECLS
+
+typedef struct _GstVaapiImageClass GstVaapiImageClass;
+typedef struct _GstVaapiImageRaw GstVaapiImageRaw;
+
+/**
+ * GstVaapiImage:
+ *
+ * A VA image wrapper
+ */
+struct _GstVaapiImage {
+ /*< private >*/
+ GstVaapiObject parent_instance;
+
+ VAImage internal_image;
+ VAImage image;
+ guchar *image_data;
+ GstVideoFormat internal_format;
+ GstVideoFormat format;
+ guint width;
+ guint height;
+ guint is_linear : 1;
+};
+
+/**
+ * GstVaapiImageClass:
+ *
+ * A VA image wrapper class
+ */
+struct _GstVaapiImageClass {
+ /*< private >*/
+ GstVaapiObjectClass parent_class;
+};
+
+/**
+ * GstVaapiImageRaw:
+ *
+ * A raw image wrapper. The caller is responsible for initializing all
+ * the fields with sensible values.
+ */
+struct _GstVaapiImageRaw {
+ GstVideoFormat format;
+ guint width;
+ guint height;
+ guint num_planes;
+ guchar *pixels[3];
+ guint stride[3];
+};
+
+/**
+ * GST_VAAPI_IMAGE_FORMAT:
+ * @image: a #GstVaapiImage
+ *
+ * Macro that evaluates to the #GstVideoFormat of @image.
+ */
+#undef GST_VAAPI_IMAGE_FORMAT
+#define GST_VAAPI_IMAGE_FORMAT(image) \
+ (GST_VAAPI_IMAGE(image)->format)
+
+/**
+ * GST_VAAPI_IMAGE_WIDTH:
+ * @image: a #GstVaapiImage
+ *
+ * Macro that evaluates to the width of @image.
+ */
+#undef GST_VAAPI_IMAGE_WIDTH
+#define GST_VAAPI_IMAGE_WIDTH(image) \
+ (GST_VAAPI_IMAGE(image)->width)
+
+/**
+ * GST_VAAPI_IMAGE_HEIGHT:
+ * @image: a #GstVaapiImage
+ *
+ * Macro that evaluates to the height of @image.
+ */
+#undef GST_VAAPI_IMAGE_HEIGHT
+#define GST_VAAPI_IMAGE_HEIGHT(image) \
+ (GST_VAAPI_IMAGE(image)->height)
+
+G_GNUC_INTERNAL
+gboolean
+gst_vaapi_image_get_raw(
+ GstVaapiImage *image,
+ GstVaapiImageRaw *dst_image,
+ GstVaapiRectangle *rect
+);
+
+G_GNUC_INTERNAL
+gboolean
+gst_vaapi_image_update_from_raw(
+ GstVaapiImage *image,
+ GstVaapiImageRaw *src_image,
+ GstVaapiRectangle *rect
+);
+
+G_END_DECLS
+
+#endif /* GST_VAAPI_IMAGE_PRIV_H */
#include "gstvaapiutils.h"
#include "gstvaapisubpicture.h"
#include "gstvaapiobject_priv.h"
+#include "gstvaapiimage_priv.h"
#define DEBUG 1
#include "gstvaapidebug.h"
GST_VAAPI_ID_ARGS(GST_VAAPI_OBJECT_ID(image)));
display = GST_VAAPI_OBJECT_DISPLAY(image);
- format = gst_vaapi_image_get_format(image);
+ format = GST_VAAPI_IMAGE_FORMAT(image);
if (!gst_vaapi_display_has_subpicture_format(display, format, &va_flags))
return NULL;
if (flags & ~va_flags)
#include "gstvaapisurface_priv.h"
#include "gstvaapicontext.h"
#include "gstvaapiimage.h"
+#include "gstvaapiimage_priv.h"
#define DEBUG 1
#include "gstvaapidebug.h"
if (surface->format == GST_VIDEO_FORMAT_UNKNOWN) {
GstVaapiImage * const image = gst_vaapi_surface_derive_image(surface);
if (image) {
- surface->format = gst_vaapi_image_get_format(image);
+ surface->format = GST_VAAPI_IMAGE_FORMAT(image);
gst_vaapi_object_unref(image);
}
if (surface->format == GST_VIDEO_FORMAT_UNKNOWN)
if (!display)
return FALSE;
- gst_vaapi_image_get_size(image, &width, &height);
+ width = GST_VAAPI_IMAGE_WIDTH(image);
+ height = GST_VAAPI_IMAGE_HEIGHT(image);
if (width != surface->width || height != surface->height)
return FALSE;
if (!display)
return FALSE;
- gst_vaapi_image_get_size(image, &width, &height);
+ width = GST_VAAPI_IMAGE_WIDTH(image);
+ height = GST_VAAPI_IMAGE_HEIGHT(image);
if (width != surface->width || height != surface->height)
return FALSE;
src_rect = &src_rect_default;
src_rect_default.x = 0;
src_rect_default.y = 0;
- gst_vaapi_image_get_size(
- image,
- &src_rect_default.width,
- &src_rect_default.height
- );
+ src_rect_default.width = GST_VAAPI_IMAGE_WIDTH(image);
+ src_rect_default.height = GST_VAAPI_IMAGE_HEIGHT(image);
}
if (!dst_rect) {