diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-07-25 09:16:02 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-07-25 14:37:11 +0200 |
commit | 437bc925f66b4f6bede4078203a6f8b72449e973 (patch) | |
tree | 2d1beacef630a687b85a987c127e9ec6c0b58d5b /gst/vaapi | |
parent | 411b970f8a35fd92f3196a7f12feeb45e7a887c1 (diff) |
display: add display types.
Move display types from gstvaapipluginutil.* to gstvaapidisplay.* so that
we could simplify characterization of a GstVaapiDisplay. Also rename "auto"
type to "any", and add a "display-type" attribute.
Diffstat (limited to 'gst/vaapi')
-rw-r--r-- | gst/vaapi/gstvaapipluginutil.c | 28 | ||||
-rw-r--r-- | gst/vaapi/gstvaapipluginutil.h | 19 | ||||
-rw-r--r-- | gst/vaapi/gstvaapisink.c | 4 |
3 files changed, 5 insertions, 46 deletions
diff --git a/gst/vaapi/gstvaapipluginutil.c b/gst/vaapi/gstvaapipluginutil.c index a0921343..ad8ce88c 100644 --- a/gst/vaapi/gstvaapipluginutil.c +++ b/gst/vaapi/gstvaapipluginutil.c @@ -71,7 +71,7 @@ gst_vaapi_ensure_display( ) { GstVaapiDisplayType display_type = - display_type_ptr ? *display_type_ptr : GST_VAAPI_DISPLAY_TYPE_AUTO; + display_type_ptr ? *display_type_ptr : GST_VAAPI_DISPLAY_TYPE_ANY; GstVaapiDisplay *display; GstVideoContext *context; const DisplayMap *m; @@ -89,7 +89,7 @@ gst_vaapi_ensure_display( /* If no neighboor, or application not interested, use system default */ for (m = g_display_map; m->type_str != NULL; m++) { - if (display_type != GST_VAAPI_DISPLAY_TYPE_AUTO && + if (display_type != GST_VAAPI_DISPLAY_TYPE_ANY && display_type != m->type) continue; @@ -104,7 +104,7 @@ gst_vaapi_ensure_display( display = NULL; } - if (display_type != GST_VAAPI_DISPLAY_TYPE_AUTO) + if (display_type != GST_VAAPI_DISPLAY_TYPE_ANY) break; } @@ -232,25 +232,3 @@ gst_vaapi_append_surface_caps(GstCaps *out_caps, GstCaps *in_caps) } return TRUE; } - -GType -gst_vaapi_display_type_get_type(void) -{ - static GType g_type = 0; - - static const GEnumValue display_types[] = { - { GST_VAAPI_DISPLAY_TYPE_AUTO, - "Auto detection", "auto" }, - { GST_VAAPI_DISPLAY_TYPE_X11, - "VA/X11 display", "x11" }, -#if USE_GLX - { GST_VAAPI_DISPLAY_TYPE_GLX, - "VA/GLX display", "glx" }, -#endif - { 0, NULL, NULL }, - }; - - if (!g_type) - g_type = g_enum_register_static("GstVaapiDisplayType", display_types); - return g_type; -} diff --git a/gst/vaapi/gstvaapipluginutil.h b/gst/vaapi/gstvaapipluginutil.h index fd535201..64aa8e9e 100644 --- a/gst/vaapi/gstvaapipluginutil.h +++ b/gst/vaapi/gstvaapipluginutil.h @@ -26,25 +26,6 @@ #include <gst/vaapi/gstvaapidisplay.h> -/** - * GstVaapiDisplayType: - * @GST_VAAPI_DISPLAY_TYPE_AUTO: Automatic detection of the display type. - * @GST_VAAPI_DISPLAY_TYPE_X11: VA/X11 display. - * @GST_VAAPI_DISPLAY_TYPE_GLX: VA/GLX display. - */ -typedef enum _GstVaapiDisplayType GstVaapiDisplayType; -enum _GstVaapiDisplayType { - GST_VAAPI_DISPLAY_TYPE_AUTO = 0, - GST_VAAPI_DISPLAY_TYPE_X11, - GST_VAAPI_DISPLAY_TYPE_GLX, -}; - -#define GST_VAAPI_TYPE_DISPLAY_TYPE \ - gst_vaapi_display_type_get_type() - -GType -gst_vaapi_display_type_get_type(void) G_GNUC_CONST; - G_GNUC_INTERNAL gboolean gst_vaapi_ensure_display( diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c index 7a992193..ff43a065 100644 --- a/gst/vaapi/gstvaapisink.c +++ b/gst/vaapi/gstvaapisink.c @@ -99,7 +99,7 @@ enum { PROP_USE_REFLECTION }; -#define DEFAULT_DISPLAY_TYPE GST_VAAPI_DISPLAY_TYPE_AUTO +#define DEFAULT_DISPLAY_TYPE GST_VAAPI_DISPLAY_TYPE_ANY /* GstImplementsInterface interface */ @@ -818,7 +818,7 @@ gst_vaapisink_class_init(GstVaapiSinkClass *klass) "display type", "display type to use", GST_VAAPI_TYPE_DISPLAY_TYPE, - GST_VAAPI_DISPLAY_TYPE_AUTO, + GST_VAAPI_DISPLAY_TYPE_ANY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); #if USE_GLX |