mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
vaapisink: add "use-glx" property for OpenGL rendering.
Now that VA/GLX capable buffers are generated by default on X11, thus depending on a VA/GLX display, we stil want to use vaPutSurface() for rendering since it is faster. Anyway, OpenGL rendering in vaapisink was only meant for testing and enabling "fancy" effects to play with. This has no real value. So, disable OpenGL rendering by default.
This commit is contained in:
parent
2fafbd7b64
commit
ece5cb2d83
2 changed files with 25 additions and 5 deletions
|
@ -153,6 +153,7 @@ enum {
|
|||
PROP_DISPLAY_TYPE,
|
||||
PROP_FULLSCREEN,
|
||||
PROP_SYNCHRONOUS,
|
||||
PROP_USE_GLX,
|
||||
PROP_USE_REFLECTION,
|
||||
PROP_ROTATION,
|
||||
};
|
||||
|
@ -1007,18 +1008,21 @@ gst_vaapisink_show_frame(GstBaseSink *base_sink, GstBuffer *src_buffer)
|
|||
GST_WARNING("could not update subtitles");
|
||||
|
||||
switch (sink->display_type) {
|
||||
#if USE_GLX
|
||||
case GST_VAAPI_DISPLAY_TYPE_GLX:
|
||||
success = gst_vaapisink_show_frame_glx(sink, surface, flags);
|
||||
break;
|
||||
#endif
|
||||
#if USE_DRM
|
||||
case GST_VAAPI_DISPLAY_TYPE_DRM:
|
||||
success = TRUE;
|
||||
break;
|
||||
#endif
|
||||
#if USE_GLX
|
||||
case GST_VAAPI_DISPLAY_TYPE_GLX:
|
||||
if (!sink->use_glx)
|
||||
goto put_surface_x11;
|
||||
success = gst_vaapisink_show_frame_glx(sink, surface, flags);
|
||||
break;
|
||||
#endif
|
||||
#if USE_X11
|
||||
case GST_VAAPI_DISPLAY_TYPE_X11:
|
||||
put_surface_x11:
|
||||
success = gst_vaapisink_put_surface(sink, surface, flags);
|
||||
break;
|
||||
#endif
|
||||
|
@ -1164,6 +1168,9 @@ gst_vaapisink_set_property(
|
|||
case PROP_SYNCHRONOUS:
|
||||
sink->synchronous = g_value_get_boolean(value);
|
||||
break;
|
||||
case PROP_USE_GLX:
|
||||
sink->use_glx = g_value_get_boolean(value);
|
||||
break;
|
||||
case PROP_USE_REFLECTION:
|
||||
sink->use_reflection = g_value_get_boolean(value);
|
||||
break;
|
||||
|
@ -1196,6 +1203,9 @@ gst_vaapisink_get_property(
|
|||
case PROP_SYNCHRONOUS:
|
||||
g_value_set_boolean(value, sink->synchronous);
|
||||
break;
|
||||
case PROP_USE_GLX:
|
||||
g_value_set_boolean(value, sink->use_glx);
|
||||
break;
|
||||
case PROP_USE_REFLECTION:
|
||||
g_value_set_boolean(value, sink->use_reflection);
|
||||
break;
|
||||
|
@ -1256,6 +1266,15 @@ gst_vaapisink_class_init(GstVaapiSinkClass *klass)
|
|||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
#if USE_GLX
|
||||
g_object_class_install_property
|
||||
(object_class,
|
||||
PROP_USE_GLX,
|
||||
g_param_spec_boolean("use-glx",
|
||||
"OpenGL rendering",
|
||||
"Enables OpenGL rendering",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property
|
||||
(object_class,
|
||||
PROP_USE_REFLECTION,
|
||||
|
|
|
@ -91,6 +91,7 @@ struct _GstVaapiSink {
|
|||
guint foreign_window : 1;
|
||||
guint fullscreen : 1;
|
||||
guint synchronous : 1;
|
||||
guint use_glx : 1;
|
||||
guint use_reflection : 1;
|
||||
guint use_overlay : 1;
|
||||
guint use_rotation : 1;
|
||||
|
|
Loading…
Reference in a new issue