mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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:
parent
1843774c0b
commit
17f21ac4db
6 changed files with 63 additions and 43 deletions
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue