surface: re-indent all GstVaapiSurface related source code.

This commit is contained in:
Gwenole Beauchesne 2014-09-15 14:57:57 +02:00
parent 568a62ae1e
commit 334dd704b6
3 changed files with 479 additions and 561 deletions

File diff suppressed because it is too large Load diff

View file

@ -67,15 +67,16 @@ G_BEGIN_DECLS
* *
* The set of all chroma types for #GstVaapiSurface. * The set of all chroma types for #GstVaapiSurface.
*/ */
typedef enum { typedef enum
GST_VAAPI_CHROMA_TYPE_YUV420 = 1, {
GST_VAAPI_CHROMA_TYPE_YUV422, GST_VAAPI_CHROMA_TYPE_YUV420 = 1,
GST_VAAPI_CHROMA_TYPE_YUV444, GST_VAAPI_CHROMA_TYPE_YUV422,
GST_VAAPI_CHROMA_TYPE_YUV411, GST_VAAPI_CHROMA_TYPE_YUV444,
GST_VAAPI_CHROMA_TYPE_YUV410, GST_VAAPI_CHROMA_TYPE_YUV411,
GST_VAAPI_CHROMA_TYPE_YUV400, GST_VAAPI_CHROMA_TYPE_YUV410,
GST_VAAPI_CHROMA_TYPE_RGB32, GST_VAAPI_CHROMA_TYPE_YUV400,
GST_VAAPI_CHROMA_TYPE_RGB16 GST_VAAPI_CHROMA_TYPE_RGB32,
GST_VAAPI_CHROMA_TYPE_RGB16
} GstVaapiChromaType; } GstVaapiChromaType;
/** /**
@ -91,11 +92,12 @@ typedef enum {
* *
* The set of all surface status for #GstVaapiSurface. * The set of all surface status for #GstVaapiSurface.
*/ */
typedef enum { typedef enum
GST_VAAPI_SURFACE_STATUS_IDLE = 1 << 0, {
GST_VAAPI_SURFACE_STATUS_RENDERING = 1 << 1, GST_VAAPI_SURFACE_STATUS_IDLE = 1 << 0,
GST_VAAPI_SURFACE_STATUS_DISPLAYING = 1 << 2, GST_VAAPI_SURFACE_STATUS_RENDERING = 1 << 1,
GST_VAAPI_SURFACE_STATUS_SKIPPED = 1 << 3 GST_VAAPI_SURFACE_STATUS_DISPLAYING = 1 << 2,
GST_VAAPI_SURFACE_STATUS_SKIPPED = 1 << 3
} GstVaapiSurfaceStatus; } GstVaapiSurfaceStatus;
/** /**
@ -121,21 +123,22 @@ typedef enum {
* *
* The set of all render flags for gst_vaapi_window_put_surface(). * The set of all render flags for gst_vaapi_window_put_surface().
*/ */
typedef enum { typedef enum
/* Picture structure */ {
GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD = 0x01 << 0, /* Picture structure */
GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD = 0x02 << 0, GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD = 0x01 << 0,
GST_VAAPI_PICTURE_STRUCTURE_FRAME = 0x03 << 0, GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD = 0x02 << 0,
GST_VAAPI_PICTURE_STRUCTURE_MASK = 0x00000003, /* 2 bits */ GST_VAAPI_PICTURE_STRUCTURE_FRAME = 0x03 << 0,
GST_VAAPI_PICTURE_STRUCTURE_MASK = 0x00000003, /* 2 bits */
/* Color standard */ /* Color standard */
GST_VAAPI_COLOR_STANDARD_ITUR_BT_601 = 0x01 << 2, GST_VAAPI_COLOR_STANDARD_ITUR_BT_601 = 0x01 << 2,
GST_VAAPI_COLOR_STANDARD_ITUR_BT_709 = 0x02 << 2, GST_VAAPI_COLOR_STANDARD_ITUR_BT_709 = 0x02 << 2,
GST_VAAPI_COLOR_STANDARD_ITUR_BT_470M = 0x03 << 2, GST_VAAPI_COLOR_STANDARD_ITUR_BT_470M = 0x03 << 2,
GST_VAAPI_COLOR_STANDARD_ITUR_BT_470BG = 0x04 << 2, GST_VAAPI_COLOR_STANDARD_ITUR_BT_470BG = 0x04 << 2,
GST_VAAPI_COLOR_STANDARD_SMPTE_170M = 0x05 << 2, GST_VAAPI_COLOR_STANDARD_SMPTE_170M = 0x05 << 2,
GST_VAAPI_COLOR_STANDARD_SMPTE_240M = 0x06 << 2, GST_VAAPI_COLOR_STANDARD_SMPTE_240M = 0x06 << 2,
GST_VAAPI_COLOR_STANDARD_MASK = 0x0000003c, /* 4 bits */ GST_VAAPI_COLOR_STANDARD_MASK = 0x0000003c, /* 4 bits */
} GstVaapiSurfaceRenderFlags; } GstVaapiSurfaceRenderFlags;
#define GST_VAAPI_SURFACE(obj) \ #define GST_VAAPI_SURFACE(obj) \
@ -145,81 +148,60 @@ typedef struct _GstVaapiSurface GstVaapiSurface;
typedef struct _GstVaapiSurfaceProxy GstVaapiSurfaceProxy; typedef struct _GstVaapiSurfaceProxy GstVaapiSurfaceProxy;
GstVaapiSurface * GstVaapiSurface *
gst_vaapi_surface_new( gst_vaapi_surface_new (GstVaapiDisplay * display,
GstVaapiDisplay *display, GstVaapiChromaType chroma_type, guint width, guint height);
GstVaapiChromaType chroma_type,
guint width,
guint height
);
GstVaapiSurface * GstVaapiSurface *
gst_vaapi_surface_new_with_format( gst_vaapi_surface_new_with_format (GstVaapiDisplay * display,
GstVaapiDisplay *display, GstVideoFormat format, guint width, guint height);
GstVideoFormat format,
guint width,
guint height
);
GstVaapiID GstVaapiID
gst_vaapi_surface_get_id(GstVaapiSurface *surface); gst_vaapi_surface_get_id (GstVaapiSurface * surface);
GstVaapiChromaType GstVaapiChromaType
gst_vaapi_surface_get_chroma_type(GstVaapiSurface *surface); gst_vaapi_surface_get_chroma_type (GstVaapiSurface * surface);
GstVideoFormat GstVideoFormat
gst_vaapi_surface_get_format(GstVaapiSurface *surface); gst_vaapi_surface_get_format (GstVaapiSurface * surface);
guint guint
gst_vaapi_surface_get_width(GstVaapiSurface *surface); gst_vaapi_surface_get_width (GstVaapiSurface * surface);
guint guint
gst_vaapi_surface_get_height(GstVaapiSurface *surface); gst_vaapi_surface_get_height (GstVaapiSurface * surface);
void void
gst_vaapi_surface_get_size( gst_vaapi_surface_get_size (GstVaapiSurface * surface, guint * width_ptr,
GstVaapiSurface *surface, guint * height_ptr);
guint *pwidth,
guint *pheight
);
GstVaapiImage * GstVaapiImage *
gst_vaapi_surface_derive_image(GstVaapiSurface *surface); gst_vaapi_surface_derive_image (GstVaapiSurface * surface);
gboolean gboolean
gst_vaapi_surface_get_image(GstVaapiSurface *surface, GstVaapiImage *image); gst_vaapi_surface_get_image (GstVaapiSurface * surface, GstVaapiImage * image);
gboolean gboolean
gst_vaapi_surface_put_image(GstVaapiSurface *surface, GstVaapiImage *image); gst_vaapi_surface_put_image (GstVaapiSurface * surface, GstVaapiImage * image);
gboolean gboolean
gst_vaapi_surface_associate_subpicture( gst_vaapi_surface_associate_subpicture (GstVaapiSurface * surface,
GstVaapiSurface *surface, GstVaapiSubpicture * subpicture, const GstVaapiRectangle * src_rect,
GstVaapiSubpicture *subpicture, const GstVaapiRectangle * dst_rect);
const GstVaapiRectangle *src_rect,
const GstVaapiRectangle *dst_rect
);
gboolean gboolean
gst_vaapi_surface_deassociate_subpicture( gst_vaapi_surface_deassociate_subpicture (GstVaapiSurface * surface,
GstVaapiSurface *surface, GstVaapiSubpicture * subpicture);
GstVaapiSubpicture *subpicture
);
gboolean gboolean
gst_vaapi_surface_sync(GstVaapiSurface *surface); gst_vaapi_surface_sync (GstVaapiSurface * surface);
gboolean gboolean
gst_vaapi_surface_query_status( gst_vaapi_surface_query_status (GstVaapiSurface * surface,
GstVaapiSurface *surface, GstVaapiSurfaceStatus * pstatus);
GstVaapiSurfaceStatus *pstatus
);
gboolean gboolean
gst_vaapi_surface_set_subpictures_from_composition( gst_vaapi_surface_set_subpictures_from_composition (GstVaapiSurface * surface,
GstVaapiSurface *surface, GstVideoOverlayComposition * composition, gboolean propagate_context);
GstVideoOverlayComposition *composition,
gboolean propagate_context
);
G_END_DECLS G_END_DECLS

View file

@ -27,6 +27,8 @@
#include <gst/vaapi/gstvaapisurface.h> #include <gst/vaapi/gstvaapisurface.h>
#include "gstvaapiobject_priv.h" #include "gstvaapiobject_priv.h"
G_BEGIN_DECLS
typedef struct _GstVaapiSurfaceClass GstVaapiSurfaceClass; typedef struct _GstVaapiSurfaceClass GstVaapiSurfaceClass;
/** /**
@ -34,16 +36,17 @@ typedef struct _GstVaapiSurfaceClass GstVaapiSurfaceClass;
* *
* A VA surface wrapper. * A VA surface wrapper.
*/ */
struct _GstVaapiSurface { struct _GstVaapiSurface
/*< private >*/ {
GstVaapiObject parent_instance; /*< private >*/
GstVaapiObject parent_instance;
GstVideoFormat format; GstVideoFormat format;
guint width; guint width;
guint height; guint height;
GstVaapiChromaType chroma_type; GstVaapiChromaType chroma_type;
GPtrArray *subpictures; GPtrArray *subpictures;
GstVaapiContext *parent_context; GstVaapiContext *parent_context;
}; };
/** /**
@ -51,9 +54,10 @@ struct _GstVaapiSurface {
* *
* A VA surface wrapper class. * A VA surface wrapper class.
*/ */
struct _GstVaapiSurfaceClass { struct _GstVaapiSurfaceClass
/*< private >*/ {
GstVaapiObjectClass parent_class; /*< private >*/
GstVaapiObjectClass parent_class;
}; };
/** /**
@ -66,7 +70,7 @@ struct _GstVaapiSurfaceClass {
*/ */
#undef GST_VAAPI_SURFACE_CHROMA_TYPE #undef GST_VAAPI_SURFACE_CHROMA_TYPE
#define GST_VAAPI_SURFACE_CHROMA_TYPE(surface) \ #define GST_VAAPI_SURFACE_CHROMA_TYPE(surface) \
GST_VAAPI_SURFACE(surface)->chroma_type (GST_VAAPI_SURFACE (surface)->chroma_type)
/** /**
* GST_VAAPI_SURFACE_SURFACE_FORMAT: * GST_VAAPI_SURFACE_SURFACE_FORMAT:
@ -78,7 +82,7 @@ struct _GstVaapiSurfaceClass {
*/ */
#undef GST_VAAPI_SURFACE_FORMAT #undef GST_VAAPI_SURFACE_FORMAT
#define GST_VAAPI_SURFACE_FORMAT(surface) \ #define GST_VAAPI_SURFACE_FORMAT(surface) \
GST_VAAPI_SURFACE(surface)->format (GST_VAAPI_SURFACE (surface)->format)
/** /**
* GST_VAAPI_SURFACE_SURFACE_WIDTH: * GST_VAAPI_SURFACE_SURFACE_WIDTH:
@ -90,7 +94,7 @@ struct _GstVaapiSurfaceClass {
*/ */
#undef GST_VAAPI_SURFACE_WIDTH #undef GST_VAAPI_SURFACE_WIDTH
#define GST_VAAPI_SURFACE_WIDTH(surface) \ #define GST_VAAPI_SURFACE_WIDTH(surface) \
GST_VAAPI_SURFACE(surface)->width (GST_VAAPI_SURFACE (surface)->width)
/** /**
* GST_VAAPI_SURFACE_SURFACE_HEIGHT: * GST_VAAPI_SURFACE_SURFACE_HEIGHT:
@ -102,17 +106,17 @@ struct _GstVaapiSurfaceClass {
*/ */
#undef GST_VAAPI_SURFACE_HEIGHT #undef GST_VAAPI_SURFACE_HEIGHT
#define GST_VAAPI_SURFACE_HEIGHT(surface) \ #define GST_VAAPI_SURFACE_HEIGHT(surface) \
GST_VAAPI_SURFACE(surface)->height (GST_VAAPI_SURFACE (surface)->height)
G_GNUC_INTERNAL G_GNUC_INTERNAL
void void
gst_vaapi_surface_set_parent_context( gst_vaapi_surface_set_parent_context (GstVaapiSurface * surface,
GstVaapiSurface *surface, GstVaapiContext * context);
GstVaapiContext *context
);
G_GNUC_INTERNAL G_GNUC_INTERNAL
GstVaapiContext * GstVaapiContext *
gst_vaapi_surface_get_parent_context(GstVaapiSurface *surface); gst_vaapi_surface_get_parent_context (GstVaapiSurface * surface);
G_END_DECLS
#endif /* GST_VAAPI_SURFACE_PRIV_H */ #endif /* GST_VAAPI_SURFACE_PRIV_H */