From 17f21ac4dbbb258fadee36ecadbeb08df74a025a Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Tue, 2 Dec 2014 11:23:29 +0100 Subject: [PATCH] display: cosmetics (helper macros, new internal API names). Add more helper macros to the top-level GstVaapiDisplay interfaces. Rename a few others used internally for improved consistency. --- gst-libs/gst/vaapi/gstvaapidisplay.c | 2 +- gst-libs/gst/vaapi/gstvaapidisplay.h | 36 +++++++++++++ gst-libs/gst/vaapi/gstvaapidisplay_drm.c | 4 +- gst-libs/gst/vaapi/gstvaapidisplay_priv.h | 56 +++++++------------- gst-libs/gst/vaapi/gstvaapidisplay_wayland.c | 4 +- gst-libs/gst/vaapi/gstvaapidisplay_x11.c | 4 +- 6 files changed, 63 insertions(+), 43 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index 232a34c836..5fa5ffd33f 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay.c @@ -1281,7 +1281,7 @@ gst_vaapi_display_flush (GstVaapiDisplay * display) } /** - * gst_vaapi_display_get_display: + * gst_vaapi_display_get_display_type: * @display: a #GstVaapiDisplay * * Returns the #GstVaapiDisplayType bound to @display. diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.h b/gst-libs/gst/vaapi/gstvaapidisplay.h index e7e1935be5..288b516f5c 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.h +++ b/gst-libs/gst/vaapi/gstvaapidisplay.h @@ -36,6 +36,42 @@ G_BEGIN_DECLS #define GST_VAAPI_DISPLAY(obj) \ ((GstVaapiDisplay *)(obj)) +/** + * GST_VAAPI_DISPLAY_TYPE: + * @display: a #GstVaapiDisplay + * + * Returns the @display type + */ +#define GST_VAAPI_DISPLAY_TYPE(display) \ + gst_vaapi_display_get_display_type (GST_VAAPI_DISPLAY (display)) + +/** + * GST_VAAPI_DISPLAY_VADISPLAY: + * @display_: a #GstVaapiDisplay + * + * Macro that evaluates to the #VADisplay of @display. + */ +#define GST_VAAPI_DISPLAY_VADISPLAY(display) \ + gst_vaapi_display_get_display (GST_VAAPI_DISPLAY (display)) + +/** + * GST_VAAPI_DISPLAY_LOCK: + * @display: a #GstVaapiDisplay + * + * Locks @display + */ +#define GST_VAAPI_DISPLAY_LOCK(display) \ + gst_vaapi_display_lock (GST_VAAPI_DISPLAY (display)) + +/** + * GST_VAAPI_DISPLAY_UNLOCK: + * @display: a #GstVaapiDisplay + * + * Unlocks @display + */ +#define GST_VAAPI_DISPLAY_UNLOCK(display) \ + gst_vaapi_display_unlock (GST_VAAPI_DISPLAY (display)) + typedef struct _GstVaapiDisplayInfo GstVaapiDisplayInfo; typedef struct _GstVaapiDisplay GstVaapiDisplay; diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_drm.c b/gst-libs/gst/vaapi/gstvaapidisplay_drm.c index be748b9f0d..b42fe402ce 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_drm.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay_drm.c @@ -240,7 +240,7 @@ gst_vaapi_display_drm_open_display (GstVaapiDisplay * display, { GstVaapiDisplayDRMPrivate *const priv = GST_VAAPI_DISPLAY_DRM_PRIVATE (display); - GstVaapiDisplayCache *const cache = GST_VAAPI_DISPLAY_GET_CACHE (display); + GstVaapiDisplayCache *const cache = GST_VAAPI_DISPLAY_CACHE (display); const GstVaapiDisplayInfo *info; if (!set_device_path (display, name)) @@ -289,7 +289,7 @@ gst_vaapi_display_drm_get_display_info (GstVaapiDisplay * display, { GstVaapiDisplayDRMPrivate *const priv = GST_VAAPI_DISPLAY_DRM_PRIVATE (display); - GstVaapiDisplayCache *const cache = GST_VAAPI_DISPLAY_GET_CACHE (display); + GstVaapiDisplayCache *const cache = GST_VAAPI_DISPLAY_CACHE (display); const GstVaapiDisplayInfo *cached_info; /* Return any cached info even if child has its own VA display */ diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_priv.h b/gst-libs/gst/vaapi/gstvaapidisplay_priv.h index c4967b12dd..895f6dacf7 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_priv.h +++ b/gst-libs/gst/vaapi/gstvaapidisplay_priv.h @@ -33,19 +33,19 @@ G_BEGIN_DECLS #define GST_VAAPI_DISPLAY_CAST(display) \ - ((GstVaapiDisplay *)(display)) + ((GstVaapiDisplay *) (display)) #define GST_VAAPI_DISPLAY_GET_PRIVATE(display) \ - (&GST_VAAPI_DISPLAY_CAST(display)->priv) + (&GST_VAAPI_DISPLAY_CAST (display)->priv) #define GST_VAAPI_DISPLAY_CLASS(klass) \ - ((GstVaapiDisplayClass *)(klass)) + ((GstVaapiDisplayClass *) (klass)) #define GST_VAAPI_IS_DISPLAY_CLASS(klass) \ - ((klass) != NULL) + ((klass) != NULL) #define GST_VAAPI_DISPLAY_GET_CLASS(obj) \ - GST_VAAPI_DISPLAY_CLASS(GST_VAAPI_MINI_OBJECT_GET_CLASS(obj)) + GST_VAAPI_DISPLAY_CLASS (GST_VAAPI_MINI_OBJECT_GET_CLASS (obj)) typedef struct _GstVaapiDisplayPrivate GstVaapiDisplayPrivate; typedef struct _GstVaapiDisplayClass GstVaapiDisplayClass; @@ -73,85 +73,69 @@ typedef GstVaapiTexture *(*GstVaapiDisplayCreateTextureFunc) ( /** * GST_VAAPI_DISPLAY_NATIVE: - * @display_: a #GstVaapiDisplay + * @display: a #GstVaapiDisplay * * Macro that evaluates to the native display of @display. * This is an internal macro that does not do any run-time type check. */ #undef GST_VAAPI_DISPLAY_NATIVE -#define GST_VAAPI_DISPLAY_NATIVE(display_) \ - (GST_VAAPI_DISPLAY_GET_PRIVATE (display_)->native_display) +#define GST_VAAPI_DISPLAY_NATIVE(display) \ + (GST_VAAPI_DISPLAY_GET_PRIVATE (display)->native_display) /** * GST_VAAPI_DISPLAY_VADISPLAY: * @display_: a #GstVaapiDisplay * - * Macro that evaluates to the #VADisplay of @display. + * Macro that evaluates to the #VADisplay of @display_. * This is an internal macro that does not do any run-time type check. */ #undef GST_VAAPI_DISPLAY_VADISPLAY #define GST_VAAPI_DISPLAY_VADISPLAY(display_) \ - GST_VAAPI_DISPLAY_GET_PRIVATE(display_)->display - -/** - * GST_VAAPI_DISPLAY_LOCK: - * @display: a #GstVaapiDisplay - * - * Locks @display - */ -#undef GST_VAAPI_DISPLAY_LOCK -#define GST_VAAPI_DISPLAY_LOCK(display) \ - gst_vaapi_display_lock(GST_VAAPI_DISPLAY_CAST(display)) - -/** - * GST_VAAPI_DISPLAY_UNLOCK: - * @display: a #GstVaapiDisplay - * - * Unlocks @display - */ -#undef GST_VAAPI_DISPLAY_UNLOCK -#define GST_VAAPI_DISPLAY_UNLOCK(display) \ - gst_vaapi_display_unlock(GST_VAAPI_DISPLAY_CAST(display)) + (GST_VAAPI_DISPLAY_GET_PRIVATE (display_)->display) /** * GST_VAAPI_DISPLAY_TYPE: * @display: a #GstVaapiDisplay * * Returns the @display type + * This is an internal macro that does not do any run-time type check. */ #undef GST_VAAPI_DISPLAY_TYPE #define GST_VAAPI_DISPLAY_TYPE(display) \ - GST_VAAPI_DISPLAY_GET_PRIVATE(display)->display_type + (GST_VAAPI_DISPLAY_GET_PRIVATE (display)->display_type) /** * GST_VAAPI_DISPLAY_TYPES: * @display: a #GstVaapiDisplay * * Returns compatible @display types as a set of flags + * This is an internal macro that does not do any run-time type check. */ #undef GST_VAAPI_DISPLAY_TYPES #define GST_VAAPI_DISPLAY_TYPES(display) \ - gst_vaapi_display_get_display_types(GST_VAAPI_DISPLAY_CAST(display)) + gst_vaapi_display_get_display_types (GST_VAAPI_DISPLAY_CAST (display)) /** * GST_VAAPI_DISPLAY_HAS_VPP: * @display: a @GstVaapiDisplay * * Returns whether the @display supports video processing (VA/VPP) + * This is an internal macro that does not do any run-time type check. */ #undef GST_VAAPI_DISPLAY_HAS_VPP #define GST_VAAPI_DISPLAY_HAS_VPP(display) \ - gst_vaapi_display_has_video_processing(GST_VAAPI_DISPLAY_CAST(display)) + gst_vaapi_display_has_video_processing (GST_VAAPI_DISPLAY_CAST (display)) /** * GST_VAAPI_DISPLAY_CACHE: * @display: a @GstVaapiDisplay * * Returns the #GstVaapiDisplayCache attached to the supplied @display object. + * This is an internal macro that does not do any run-time type check. */ -#undef GST_VAAPI_DISPLAY_GET_CACHE -#define GST_VAAPI_DISPLAY_GET_CACHE(display) \ - (GST_VAAPI_DISPLAY_GET_PRIVATE (display)->cache) +#undef GST_VAAPI_DISPLAY_CACHE +#define GST_VAAPI_DISPLAY_CACHE(display) \ + (GST_VAAPI_DISPLAY_GET_PRIVATE (display)->cache) struct _GstVaapiDisplayPrivate { diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c b/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c index d7c5c1ffb3..d859840a4a 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c @@ -204,7 +204,7 @@ gst_vaapi_display_wayland_open_display (GstVaapiDisplay * display, { GstVaapiDisplayWaylandPrivate *const priv = GST_VAAPI_DISPLAY_WAYLAND_GET_PRIVATE (display); - GstVaapiDisplayCache *const cache = GST_VAAPI_DISPLAY_GET_CACHE (display); + GstVaapiDisplayCache *const cache = GST_VAAPI_DISPLAY_CACHE (display); const GstVaapiDisplayInfo *info; if (!set_display_name (display, name)) @@ -263,7 +263,7 @@ gst_vaapi_display_wayland_get_display_info (GstVaapiDisplay * display, { GstVaapiDisplayWaylandPrivate *const priv = GST_VAAPI_DISPLAY_WAYLAND_GET_PRIVATE (display); - GstVaapiDisplayCache *const cache = GST_VAAPI_DISPLAY_GET_CACHE (display); + GstVaapiDisplayCache *const cache = GST_VAAPI_DISPLAY_CACHE (display); const GstVaapiDisplayInfo *cached_info; /* Return any cached info even if child has its own VA display */ diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_x11.c b/gst-libs/gst/vaapi/gstvaapidisplay_x11.c index 9d4dfd0553..e9d193a76f 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_x11.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay_x11.c @@ -197,7 +197,7 @@ gst_vaapi_display_x11_open_display (GstVaapiDisplay * base_display, { GstVaapiDisplayX11 *const display = GST_VAAPI_DISPLAY_X11_CAST (base_display); GstVaapiDisplayX11Private *const priv = &display->priv; - GstVaapiDisplayCache *const cache = GST_VAAPI_DISPLAY_GET_CACHE (display); + GstVaapiDisplayCache *const cache = GST_VAAPI_DISPLAY_CACHE (display); const GstVaapiDisplayInfo *info; if (!set_display_name (display, name)) @@ -275,7 +275,7 @@ gst_vaapi_display_x11_get_display_info (GstVaapiDisplay * display, { GstVaapiDisplayX11Private *const priv = GST_VAAPI_DISPLAY_X11_PRIVATE (display); - GstVaapiDisplayCache *const cache = GST_VAAPI_DISPLAY_GET_CACHE (display); + GstVaapiDisplayCache *const cache = GST_VAAPI_DISPLAY_CACHE (display); const GstVaapiDisplayInfo *cached_info; /* Return any cached info even if child has its own VA display */