diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-05-27 13:17:31 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-05-27 16:07:15 +0200 |
commit | 71ab07d9c6ef2268078e8448c81e82e33470fce8 (patch) | |
tree | 9a0a13e2edb8a771b01c5d325f854fdabcf79486 /gst-libs/gst/vaapi/gstvaapidisplay_priv.h | |
parent | c957823e8a504dc116c3aaca35c6949a87908bea (diff) | |
download | gst-vaapi-71ab07d9c6ef2268078e8448c81e82e33470fce8.tar.gz |
display: make it possible to lookup the display cache by type.
Make it possible to add extra an extra filter to most of display cache
lookup functions so that the GstVaapiDisplay instance can really match
a compatible and existing display by type, instead of relying on extra
string tags (e.g. "X11:" prefix, etc.).
Diffstat (limited to 'gst-libs/gst/vaapi/gstvaapidisplay_priv.h')
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidisplay_priv.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_priv.h b/gst-libs/gst/vaapi/gstvaapidisplay_priv.h index 24bf7517..0608f428 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_priv.h +++ b/gst-libs/gst/vaapi/gstvaapidisplay_priv.h @@ -96,6 +96,16 @@ typedef void (*GstVaapiDisplayGetSizeMFunc)(GstVaapiDisplay *display, #define GST_VAAPI_DISPLAY_UNLOCK(display) \ gst_vaapi_display_unlock(GST_VAAPI_DISPLAY_CAST(display)) +/** + * GST_VAAPI_DISPLAY_TYPES: + * @display: a #GstVaapiDisplay + * + * Returns compatible @display types as a set of flags + */ +#undef GST_VAAPI_DISPLAY_TYPES +#define GST_VAAPI_DISPLAY_TYPES(display) \ + gst_vaapi_display_get_display_types(GST_VAAPI_DISPLAY_CAST(display)) + struct _GstVaapiDisplayPrivate { GstVaapiDisplay *parent; GRecMutex mutex; @@ -145,6 +155,9 @@ struct _GstVaapiDisplayClass { /*< private >*/ GstVaapiMiniObjectClass parent_class; + /*< protected >*/ + guint display_types; + /*< public >*/ GstVaapiDisplayInitFunc init; GstVaapiDisplayBindFunc bind_display; @@ -176,6 +189,15 @@ gst_vaapi_display_new(const GstVaapiDisplayClass *klass, GstVaapiDisplayCache * gst_vaapi_display_get_cache(void); +static inline guint +gst_vaapi_display_get_display_types(GstVaapiDisplay *display) +{ + const GstVaapiDisplayClass * const dpy_class = + GST_VAAPI_DISPLAY_GET_CLASS(display); + + return dpy_class->display_types; +} + /* Inline reference counting for core libgstvaapi library */ #ifdef GST_VAAPI_CORE #define gst_vaapi_display_ref_internal(display) \ |