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.
This commit is contained in:
Gwenole Beauchesne 2014-12-02 11:23:29 +01:00
parent 1843774c0b
commit 17f21ac4db
6 changed files with 63 additions and 43 deletions

View file

@ -1281,7 +1281,7 @@ gst_vaapi_display_flush (GstVaapiDisplay * display)
} }
/** /**
* gst_vaapi_display_get_display: * gst_vaapi_display_get_display_type:
* @display: a #GstVaapiDisplay * @display: a #GstVaapiDisplay
* *
* Returns the #GstVaapiDisplayType bound to @display. * Returns the #GstVaapiDisplayType bound to @display.

View file

@ -36,6 +36,42 @@ G_BEGIN_DECLS
#define GST_VAAPI_DISPLAY(obj) \ #define GST_VAAPI_DISPLAY(obj) \
((GstVaapiDisplay *)(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 _GstVaapiDisplayInfo GstVaapiDisplayInfo;
typedef struct _GstVaapiDisplay GstVaapiDisplay; typedef struct _GstVaapiDisplay GstVaapiDisplay;

View file

@ -240,7 +240,7 @@ gst_vaapi_display_drm_open_display (GstVaapiDisplay * display,
{ {
GstVaapiDisplayDRMPrivate *const priv = GstVaapiDisplayDRMPrivate *const priv =
GST_VAAPI_DISPLAY_DRM_PRIVATE (display); 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; const GstVaapiDisplayInfo *info;
if (!set_device_path (display, name)) if (!set_device_path (display, name))
@ -289,7 +289,7 @@ gst_vaapi_display_drm_get_display_info (GstVaapiDisplay * display,
{ {
GstVaapiDisplayDRMPrivate *const priv = GstVaapiDisplayDRMPrivate *const priv =
GST_VAAPI_DISPLAY_DRM_PRIVATE (display); 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; const GstVaapiDisplayInfo *cached_info;
/* Return any cached info even if child has its own VA display */ /* Return any cached info even if child has its own VA display */

View file

@ -33,19 +33,19 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_VAAPI_DISPLAY_CAST(display) \ #define GST_VAAPI_DISPLAY_CAST(display) \
((GstVaapiDisplay *)(display)) ((GstVaapiDisplay *) (display))
#define GST_VAAPI_DISPLAY_GET_PRIVATE(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) \ #define GST_VAAPI_DISPLAY_CLASS(klass) \
((GstVaapiDisplayClass *)(klass)) ((GstVaapiDisplayClass *) (klass))
#define GST_VAAPI_IS_DISPLAY_CLASS(klass) \ #define GST_VAAPI_IS_DISPLAY_CLASS(klass) \
((klass) != NULL) ((klass) != NULL)
#define GST_VAAPI_DISPLAY_GET_CLASS(obj) \ #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 _GstVaapiDisplayPrivate GstVaapiDisplayPrivate;
typedef struct _GstVaapiDisplayClass GstVaapiDisplayClass; typedef struct _GstVaapiDisplayClass GstVaapiDisplayClass;
@ -73,85 +73,69 @@ typedef GstVaapiTexture *(*GstVaapiDisplayCreateTextureFunc) (
/** /**
* GST_VAAPI_DISPLAY_NATIVE: * GST_VAAPI_DISPLAY_NATIVE:
* @display_: a #GstVaapiDisplay * @display: a #GstVaapiDisplay
* *
* Macro that evaluates to the native display of @display. * Macro that evaluates to the native display of @display.
* This is an internal macro that does not do any run-time type check. * This is an internal macro that does not do any run-time type check.
*/ */
#undef GST_VAAPI_DISPLAY_NATIVE #undef GST_VAAPI_DISPLAY_NATIVE
#define GST_VAAPI_DISPLAY_NATIVE(display_) \ #define GST_VAAPI_DISPLAY_NATIVE(display) \
(GST_VAAPI_DISPLAY_GET_PRIVATE (display_)->native_display) (GST_VAAPI_DISPLAY_GET_PRIVATE (display)->native_display)
/** /**
* GST_VAAPI_DISPLAY_VADISPLAY: * GST_VAAPI_DISPLAY_VADISPLAY:
* @display_: a #GstVaapiDisplay * @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. * This is an internal macro that does not do any run-time type check.
*/ */
#undef GST_VAAPI_DISPLAY_VADISPLAY #undef GST_VAAPI_DISPLAY_VADISPLAY
#define GST_VAAPI_DISPLAY_VADISPLAY(display_) \ #define GST_VAAPI_DISPLAY_VADISPLAY(display_) \
GST_VAAPI_DISPLAY_GET_PRIVATE(display_)->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_TYPE: * GST_VAAPI_DISPLAY_TYPE:
* @display: a #GstVaapiDisplay * @display: a #GstVaapiDisplay
* *
* Returns the @display type * Returns the @display type
* This is an internal macro that does not do any run-time type check.
*/ */
#undef GST_VAAPI_DISPLAY_TYPE #undef GST_VAAPI_DISPLAY_TYPE
#define GST_VAAPI_DISPLAY_TYPE(display) \ #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: * GST_VAAPI_DISPLAY_TYPES:
* @display: a #GstVaapiDisplay * @display: a #GstVaapiDisplay
* *
* Returns compatible @display types as a set of flags * 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 #undef GST_VAAPI_DISPLAY_TYPES
#define GST_VAAPI_DISPLAY_TYPES(display) \ #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: * GST_VAAPI_DISPLAY_HAS_VPP:
* @display: a @GstVaapiDisplay * @display: a @GstVaapiDisplay
* *
* Returns whether the @display supports video processing (VA/VPP) * 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 #undef GST_VAAPI_DISPLAY_HAS_VPP
#define GST_VAAPI_DISPLAY_HAS_VPP(display) \ #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: * GST_VAAPI_DISPLAY_CACHE:
* @display: a @GstVaapiDisplay * @display: a @GstVaapiDisplay
* *
* Returns the #GstVaapiDisplayCache attached to the supplied @display object. * 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 #undef GST_VAAPI_DISPLAY_CACHE
#define GST_VAAPI_DISPLAY_GET_CACHE(display) \ #define GST_VAAPI_DISPLAY_CACHE(display) \
(GST_VAAPI_DISPLAY_GET_PRIVATE (display)->cache) (GST_VAAPI_DISPLAY_GET_PRIVATE (display)->cache)
struct _GstVaapiDisplayPrivate struct _GstVaapiDisplayPrivate
{ {

View file

@ -204,7 +204,7 @@ gst_vaapi_display_wayland_open_display (GstVaapiDisplay * display,
{ {
GstVaapiDisplayWaylandPrivate *const priv = GstVaapiDisplayWaylandPrivate *const priv =
GST_VAAPI_DISPLAY_WAYLAND_GET_PRIVATE (display); 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; const GstVaapiDisplayInfo *info;
if (!set_display_name (display, name)) if (!set_display_name (display, name))
@ -263,7 +263,7 @@ gst_vaapi_display_wayland_get_display_info (GstVaapiDisplay * display,
{ {
GstVaapiDisplayWaylandPrivate *const priv = GstVaapiDisplayWaylandPrivate *const priv =
GST_VAAPI_DISPLAY_WAYLAND_GET_PRIVATE (display); 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; const GstVaapiDisplayInfo *cached_info;
/* Return any cached info even if child has its own VA display */ /* Return any cached info even if child has its own VA display */

View file

@ -197,7 +197,7 @@ gst_vaapi_display_x11_open_display (GstVaapiDisplay * base_display,
{ {
GstVaapiDisplayX11 *const display = GST_VAAPI_DISPLAY_X11_CAST (base_display); GstVaapiDisplayX11 *const display = GST_VAAPI_DISPLAY_X11_CAST (base_display);
GstVaapiDisplayX11Private *const priv = &display->priv; 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; const GstVaapiDisplayInfo *info;
if (!set_display_name (display, name)) if (!set_display_name (display, name))
@ -275,7 +275,7 @@ gst_vaapi_display_x11_get_display_info (GstVaapiDisplay * display,
{ {
GstVaapiDisplayX11Private *const priv = GstVaapiDisplayX11Private *const priv =
GST_VAAPI_DISPLAY_X11_PRIVATE (display); 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; const GstVaapiDisplayInfo *cached_info;
/* Return any cached info even if child has its own VA display */ /* Return any cached info even if child has its own VA display */