From eca4c7da428f284ce89e9ad62d6c7d7569299e79 Mon Sep 17 00:00:00 2001 From: gb Date: Mon, 15 Mar 2010 15:55:20 +0000 Subject: [PATCH] Cosmetics. --- gst-libs/gst/vaapi/gstvaapiimage.c | 21 +++++++++++---------- gst-libs/gst/vaapi/gstvaapiimage.h | 10 +++++++--- gst-libs/gst/vaapi/gstvaapisurface.c | 8 ++++---- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapiimage.c b/gst-libs/gst/vaapi/gstvaapiimage.c index 564858e77b..75d8c677d5 100644 --- a/gst-libs/gst/vaapi/gstvaapiimage.c +++ b/gst-libs/gst/vaapi/gstvaapiimage.c @@ -273,7 +273,8 @@ gst_vaapi_image_new( g_return_val_if_fail(width > 0, NULL); g_return_val_if_fail(height > 0, NULL); - GST_DEBUG("size %ux%u, format 0x%x", width, height, format); + GST_DEBUG("size %ux%u, format %" GST_FOURCC_FORMAT, + width, height, GST_FOURCC_ARGS(format)); return g_object_new(GST_VAAPI_TYPE_IMAGE, "display", display, @@ -301,6 +302,15 @@ gst_vaapi_image_get_display(GstVaapiImage *image) return image->priv->display; } +GstVaapiImageFormat +gst_vaapi_image_get_format(GstVaapiImage *image) +{ + g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), 0); + g_return_val_if_fail(image->priv->is_constructed, FALSE); + + return image->priv->format; +} + guint gst_vaapi_image_get_width(GstVaapiImage *image) { @@ -332,15 +342,6 @@ gst_vaapi_image_get_size(GstVaapiImage *image, guint *pwidth, guint *pheight) *pheight = image->priv->height; } -guint -gst_vaapi_image_get_format(GstVaapiImage *image) -{ - g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), 0); - g_return_val_if_fail(image->priv->is_constructed, FALSE); - - return image->priv->format; -} - static inline gboolean _gst_vaapi_image_is_mapped(GstVaapiImage *image) { diff --git a/gst-libs/gst/vaapi/gstvaapiimage.h b/gst-libs/gst/vaapi/gstvaapiimage.h index eb8f37b125..21d41cce46 100644 --- a/gst-libs/gst/vaapi/gstvaapiimage.h +++ b/gst-libs/gst/vaapi/gstvaapiimage.h @@ -51,6 +51,10 @@ G_BEGIN_DECLS GST_VAAPI_TYPE_IMAGE, \ GstVaapiImageClass)) +#define GST_VAAPI_IMAGE_FORMAT(img) gst_vaapi_image_get_format(img) +#define GST_VAAPI_IMAGE_WIDTH(img) gst_vaapi_image_get_width(img) +#define GST_VAAPI_IMAGE_HEIGHT(img) gst_vaapi_image_get_height(img) + typedef struct _GstVaapiImage GstVaapiImage; typedef struct _GstVaapiImagePrivate GstVaapiImagePrivate; typedef struct _GstVaapiImageClass GstVaapiImageClass; @@ -84,6 +88,9 @@ gst_vaapi_image_get_id(GstVaapiImage *image); GstVaapiDisplay * gst_vaapi_image_get_display(GstVaapiImage *image); +GstVaapiImageFormat +gst_vaapi_image_get_format(GstVaapiImage *image); + guint gst_vaapi_image_get_width(GstVaapiImage *image); @@ -93,9 +100,6 @@ gst_vaapi_image_get_height(GstVaapiImage *image); void gst_vaapi_image_get_size(GstVaapiImage *image, guint *pwidth, guint *pheight); -guint -gst_vaapi_image_get_format(GstVaapiImage *image); - gboolean gst_vaapi_image_is_mapped(GstVaapiImage *image); diff --git a/gst-libs/gst/vaapi/gstvaapisurface.c b/gst-libs/gst/vaapi/gstvaapisurface.c index 4f859f0237..76f431fcfb 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.c +++ b/gst-libs/gst/vaapi/gstvaapisurface.c @@ -55,7 +55,7 @@ static void gst_vaapi_surface_destroy(GstVaapiSurface *surface) { GstVaapiSurfacePrivate * const priv = surface->priv; - VADisplay dpy = gst_vaapi_display_get_display(priv->display); + VADisplay dpy = GST_VAAPI_DISPLAY_VADISPLAY(priv->display); VAStatus status; if (priv->surface_id != VA_INVALID_SURFACE) { @@ -95,7 +95,7 @@ gst_vaapi_surface_create(GstVaapiSurface *surface) } status = vaCreateSurfaces( - gst_vaapi_display_get_display(priv->display), + GST_VAAPI_DISPLAY_VADISPLAY(priv->display), priv->width, priv->height, format, @@ -355,7 +355,7 @@ gst_vaapi_surface_get_image(GstVaapiSurface *surface, GstVaapiImage *image) return FALSE; status = vaGetImage( - gst_vaapi_display_get_display(surface->priv->display), + GST_VAAPI_DISPLAY_VADISPLAY(surface->priv->display), surface->priv->surface_id, 0, 0, width, height, image_id @@ -385,7 +385,7 @@ gst_vaapi_surface_put_image(GstVaapiSurface *surface, GstVaapiImage *image) return FALSE; status = vaPutImage( - gst_vaapi_display_get_display(surface->priv->display), + GST_VAAPI_DISPLAY_VADISPLAY(surface->priv->display), surface->priv->surface_id, image_id, 0, 0, width, height,