2 * gstvaapisink.c - VA-API video sink
4 * Copyright (C) 2010-2011 Splitted-Desktop Systems
5 * Copyright (C) 2011-2012 Intel Corporation
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; either version 2.1
10 * of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301 USA
24 * SECTION:gstvaapisink
25 * @short_description: A VA-API based videosink
27 * vaapisink renders video frames to a drawable (X #Window) on a local
28 * display using the Video Acceleration (VA) API. The element will
29 * create its own internal window and render into it.
34 #include <gst/video/video.h>
35 #include <gst/video/videocontext.h>
36 #include <gst/vaapi/gstvaapivideobuffer.h>
37 #include <gst/vaapi/gstvaapivideosink.h>
38 #include <gst/vaapi/gstvaapidisplay_x11.h>
39 #include <gst/vaapi/gstvaapiwindow_x11.h>
41 # include <gst/vaapi/gstvaapidisplay_glx.h>
42 # include <gst/vaapi/gstvaapiwindow_glx.h>
45 /* Supported interfaces */
46 #include <gst/interfaces/xoverlay.h>
48 #include "gstvaapisink.h"
49 #include "gstvaapipluginutil.h"
51 #define GST_PLUGIN_NAME "vaapisink"
52 #define GST_PLUGIN_DESC "A VA-API based videosink"
54 GST_DEBUG_CATEGORY_STATIC(gst_debug_vaapisink);
55 #define GST_CAT_DEFAULT gst_debug_vaapisink
57 /* ElementFactory information */
58 static const GstElementDetails gst_vaapisink_details =
63 "Gwenole Beauchesne <gwenole.beauchesne@intel.com>");
65 /* Default template */
66 static GstStaticPadTemplate gst_vaapisink_sink_factory =
67 GST_STATIC_PAD_TEMPLATE(
71 GST_STATIC_CAPS(GST_VAAPI_SURFACE_CAPS));
74 gst_vaapisink_implements_iface_init(GstImplementsInterfaceClass *iface);
77 gst_vaapisink_video_context_iface_init(GstVideoContextInterface *iface);
80 gst_vaapisink_xoverlay_iface_init(GstXOverlayClass *iface);
82 G_DEFINE_TYPE_WITH_CODE(
86 G_IMPLEMENT_INTERFACE(GST_TYPE_IMPLEMENTS_INTERFACE,
87 gst_vaapisink_implements_iface_init);
88 G_IMPLEMENT_INTERFACE(GST_TYPE_VIDEO_CONTEXT,
89 gst_vaapisink_video_context_iface_init);
90 G_IMPLEMENT_INTERFACE(GST_TYPE_X_OVERLAY,
91 gst_vaapisink_xoverlay_iface_init));
102 #define DEFAULT_DISPLAY_TYPE GST_VAAPI_DISPLAY_TYPE_ANY
104 /* GstImplementsInterface interface */
107 gst_vaapisink_implements_interface_supported(
108 GstImplementsInterface *iface,
112 return (type == GST_TYPE_VIDEO_CONTEXT ||
113 type == GST_TYPE_X_OVERLAY);
117 gst_vaapisink_implements_iface_init(GstImplementsInterfaceClass *iface)
119 iface->supported = gst_vaapisink_implements_interface_supported;
122 /* GstVaapiVideoSink interface */
125 gst_vaapisink_set_video_context(GstVideoContext *context, const gchar *type,
128 GstVaapiSink *sink = GST_VAAPISINK (context);
129 gst_vaapi_set_display (type, value, &sink->display);
133 gst_vaapisink_video_context_iface_init(GstVideoContextInterface *iface)
135 iface->set_context = gst_vaapisink_set_video_context;
138 /* GstXOverlay interface */
141 gst_vaapisink_ensure_window_xid(GstVaapiSink *sink, guintptr window_id);
144 gst_vaapisink_show_frame(GstBaseSink *base_sink, GstBuffer *buffer);
147 gst_vaapisink_xoverlay_set_window_handle(GstXOverlay *overlay, guintptr window)
149 GstVaapiSink * const sink = GST_VAAPISINK(overlay);
151 /* Disable GLX rendering when vaapisink is using a foreign X
152 window. It's pretty much useless */
153 if (sink->display_type == GST_VAAPI_DISPLAY_TYPE_GLX)
154 sink->display_type = GST_VAAPI_DISPLAY_TYPE_X11;
156 sink->foreign_window = TRUE;
157 gst_vaapisink_ensure_window_xid(sink, window);
161 gst_vaapisink_xoverlay_set_render_rectangle(
162 GstXOverlay *overlay,
169 GstVaapiSink * const sink = GST_VAAPISINK(overlay);
170 GstVaapiRectangle * const display_rect = &sink->display_rect;
174 display_rect->width = width;
175 display_rect->height = height;
177 GST_DEBUG("render rect (%d,%d):%ux%u",
178 display_rect->x, display_rect->y,
179 display_rect->width, display_rect->height);
183 gst_vaapisink_xoverlay_expose(GstXOverlay *overlay)
185 GstBaseSink * const base_sink = GST_BASE_SINK(overlay);
188 buffer = gst_base_sink_get_last_buffer(base_sink);
190 gst_vaapisink_show_frame(base_sink, buffer);
191 gst_buffer_unref(buffer);
196 gst_vaapisink_xoverlay_iface_init(GstXOverlayClass *iface)
198 iface->set_window_handle = gst_vaapisink_xoverlay_set_window_handle;
199 iface->set_render_rectangle = gst_vaapisink_xoverlay_set_render_rectangle;
200 iface->expose = gst_vaapisink_xoverlay_expose;
204 gst_vaapisink_destroy(GstVaapiSink *sink)
206 g_clear_object(&sink->texture);
207 g_clear_object(&sink->display);
209 gst_caps_replace(&sink->caps, NULL);
212 /* Checks whether a ConfigureNotify event is in the queue */
213 typedef struct _ConfigureNotifyEventPendingArgs ConfigureNotifyEventPendingArgs;
214 struct _ConfigureNotifyEventPendingArgs {
222 configure_notify_event_pending_cb(Display *dpy, XEvent *xev, XPointer arg)
224 ConfigureNotifyEventPendingArgs * const args =
225 (ConfigureNotifyEventPendingArgs *)arg;
227 if (xev->type == ConfigureNotify &&
228 xev->xconfigure.window == args->window &&
229 xev->xconfigure.width == args->width &&
230 xev->xconfigure.height == args->height)
233 /* XXX: this is a hack to traverse the whole queue because we
234 can't use XPeekIfEvent() since it could block */
239 configure_notify_event_pending(
246 ConfigureNotifyEventPendingArgs args;
249 args.window = window;
251 args.height = height;
254 /* XXX: don't use XPeekIfEvent() because it might block */
256 gst_vaapi_display_x11_get_display(GST_VAAPI_DISPLAY_X11(sink->display)),
258 configure_notify_event_pending_cb, (XPointer)&args
263 static inline gboolean
264 gst_vaapisink_ensure_display(GstVaapiSink *sink)
266 return gst_vaapi_ensure_display(sink, &sink->display, &sink->display_type);
270 gst_vaapisink_ensure_render_rect(GstVaapiSink *sink, guint width, guint height)
272 GstVaapiRectangle * const display_rect = &sink->display_rect;
273 guint num, den, display_par_n, display_par_d;
276 /* Return success if caps are not set yet */
280 GST_DEBUG("ensure render rect within %ux%u bounds", width, height);
282 gst_vaapi_display_get_pixel_aspect_ratio(
284 &display_par_n, &display_par_d
286 GST_DEBUG("display pixel-aspect-ratio %d/%d",
287 display_par_n, display_par_d);
289 success = gst_video_calculate_display_ratio(
291 sink->video_width, sink->video_height,
292 sink->video_par_n, sink->video_par_d,
293 display_par_n, display_par_d
297 GST_DEBUG("video size %dx%d, calculated ratio %d/%d",
298 sink->video_width, sink->video_height, num, den);
300 display_rect->width = gst_util_uint64_scale_int(height, num, den);
301 if (display_rect->width <= width) {
302 GST_DEBUG("keeping window height");
303 display_rect->height = height;
306 GST_DEBUG("keeping window width");
307 display_rect->width = width;
308 display_rect->height =
309 gst_util_uint64_scale_int(width, den, num);
311 GST_DEBUG("scaling video to %ux%u", display_rect->width, display_rect->height);
313 g_assert(display_rect->width <= width);
314 g_assert(display_rect->height <= height);
316 display_rect->x = (width - display_rect->width) / 2;
317 display_rect->y = (height - display_rect->height) / 2;
319 GST_DEBUG("render rect (%d,%d):%ux%u",
320 display_rect->x, display_rect->y,
321 display_rect->width, display_rect->height);
325 static inline gboolean
326 gst_vaapisink_ensure_window(GstVaapiSink *sink, guint width, guint height)
328 GstVaapiDisplay * const display = sink->display;
331 switch (sink->display_type) {
333 case GST_VAAPI_DISPLAY_TYPE_GLX:
334 sink->window = gst_vaapi_window_glx_new(display, width, height);
337 case GST_VAAPI_DISPLAY_TYPE_X11:
338 sink->window = gst_vaapi_window_x11_new(display, width, height);
341 GST_ERROR("unsupported display type %d", sink->display_type);
345 gst_x_overlay_got_window_handle(
347 gst_vaapi_window_x11_get_xid(GST_VAAPI_WINDOW_X11(sink->window))
350 return sink->window != NULL;
354 gst_vaapisink_ensure_window_xid(GstVaapiSink *sink, guintptr window_id)
357 unsigned int width, height, border_width, depth;
361 if (!gst_vaapisink_ensure_display(sink))
364 gst_vaapi_display_lock(sink->display);
366 gst_vaapi_display_x11_get_display(GST_VAAPI_DISPLAY_X11(sink->display)),
369 &x, &y, &width, &height, &border_width, &depth
371 gst_vaapi_display_unlock(sink->display);
373 if ((width != sink->window_width || height != sink->window_height) &&
374 !configure_notify_event_pending(sink, xid, width, height)) {
375 if (!gst_vaapisink_ensure_render_rect(sink, width, height))
377 sink->window_width = width;
378 sink->window_height = height;
382 gst_vaapi_window_x11_get_xid(GST_VAAPI_WINDOW_X11(sink->window)) == xid)
385 g_clear_object(&sink->window);
387 switch (sink->display_type) {
389 case GST_VAAPI_DISPLAY_TYPE_GLX:
390 sink->window = gst_vaapi_window_glx_new_with_xid(sink->display, xid);
393 case GST_VAAPI_DISPLAY_TYPE_X11:
394 sink->window = gst_vaapi_window_x11_new_with_xid(sink->display, xid);
397 GST_ERROR("unsupported display type %d", sink->display_type);
400 return sink->window != NULL;
404 gst_vaapisink_start(GstBaseSink *base_sink)
406 GstVaapiSink * const sink = GST_VAAPISINK(base_sink);
408 return gst_vaapisink_ensure_display(sink);
412 gst_vaapisink_stop(GstBaseSink *base_sink)
414 GstVaapiSink * const sink = GST_VAAPISINK(base_sink);
416 g_clear_object(&sink->window);
417 g_clear_object(&sink->display);
423 gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
425 GstVaapiSink * const sink = GST_VAAPISINK(base_sink);
426 GstStructure * const structure = gst_caps_get_structure(caps, 0);
427 guint win_width, win_height, display_width, display_height;
428 gint video_width, video_height, video_par_n = 1, video_par_d = 1;
432 if (!gst_structure_get_int(structure, "width", &video_width))
434 if (!gst_structure_get_int(structure, "height", &video_height))
436 sink->video_width = video_width;
437 sink->video_height = video_height;
439 gst_video_parse_caps_pixel_aspect_ratio(caps, &video_par_n, &video_par_d);
440 sink->video_par_n = video_par_n;
441 sink->video_par_d = video_par_d;
442 GST_DEBUG("video pixel-aspect-ratio %d/%d", video_par_n, video_par_d);
444 gst_caps_replace(&sink->caps, caps);
446 if (!gst_vaapisink_ensure_display(sink))
449 gst_vaapi_display_get_size(sink->display, &display_width, &display_height);
450 if (sink->foreign_window) {
451 win_width = sink->window_width;
452 win_height = sink->window_height;
454 else if (sink->fullscreen ||
455 video_width > display_width || video_height > display_height) {
456 win_width = display_width;
457 win_height = display_height;
460 win_width = video_width;
461 win_height = video_height;
465 if (!sink->foreign_window || sink->fullscreen)
466 gst_vaapi_window_set_size(sink->window, win_width, win_height);
469 gst_vaapi_display_lock(sink->display);
470 gst_x_overlay_prepare_xwindow_id(GST_X_OVERLAY(sink));
471 gst_vaapi_display_unlock(sink->display);
474 if (!gst_vaapisink_ensure_window(sink, win_width, win_height))
476 gst_vaapi_window_set_fullscreen(sink->window, sink->fullscreen);
477 gst_vaapi_window_show(sink->window);
478 gst_vaapi_window_get_size(sink->window, &win_width, &win_height);
480 sink->window_width = win_width;
481 sink->window_height = win_height;
482 GST_DEBUG("window size %ux%u", win_width, win_height);
484 return gst_vaapisink_ensure_render_rect(sink, win_width, win_height);
489 render_background(GstVaapiSink *sink)
491 /* Original code from Mirco Muller (MacSlow):
492 <http://cgit.freedesktop.org/~macslow/gl-gst-player/> */
493 GLfloat fStartX = 0.0f;
494 GLfloat fStartY = 0.0f;
495 GLfloat fWidth = (GLfloat)sink->window_width;
496 GLfloat fHeight = (GLfloat)sink->window_height;
498 glClear(GL_COLOR_BUFFER_BIT);
501 /* top third, darker grey to white */
502 glColor3f(0.85f, 0.85f, 0.85f);
503 glVertex3f(fStartX, fStartY, 0.0f);
504 glColor3f(0.85f, 0.85f, 0.85f);
505 glVertex3f(fStartX + fWidth, fStartY, 0.0f);
506 glColor3f(1.0f, 1.0f, 1.0f);
507 glVertex3f(fStartX + fWidth, fStartY + fHeight / 3.0f, 0.0f);
508 glColor3f(1.0f, 1.0f, 1.0f);
509 glVertex3f(fStartX, fStartY + fHeight / 3.0f, 0.0f);
511 /* middle third, just plain white */
512 glColor3f(1.0f, 1.0f, 1.0f);
513 glVertex3f(fStartX, fStartY + fHeight / 3.0f, 0.0f);
514 glVertex3f(fStartX + fWidth, fStartY + fHeight / 3.0f, 0.0f);
515 glVertex3f(fStartX + fWidth, fStartY + 2.0f * fHeight / 3.0f, 0.0f);
516 glVertex3f(fStartX, fStartY + 2.0f * fHeight / 3.0f, 0.0f);
518 /* bottom third, white to lighter grey */
519 glColor3f(1.0f, 1.0f, 1.0f);
520 glVertex3f(fStartX, fStartY + 2.0f * fHeight / 3.0f, 0.0f);
521 glColor3f(1.0f, 1.0f, 1.0f);
522 glVertex3f(fStartX + fWidth, fStartY + 2.0f * fHeight / 3.0f, 0.0f);
523 glColor3f(0.62f, 0.66f, 0.69f);
524 glVertex3f(fStartX + fWidth, fStartY + fHeight, 0.0f);
525 glColor3f(0.62f, 0.66f, 0.69f);
526 glVertex3f(fStartX, fStartY + fHeight, 0.0f);
532 render_frame(GstVaapiSink *sink)
534 const guint x1 = sink->display_rect.x;
535 const guint x2 = sink->display_rect.x + sink->display_rect.width;
536 const guint y1 = sink->display_rect.y;
537 const guint y2 = sink->display_rect.y + sink->display_rect.height;
539 glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
542 glTexCoord2f(0.0f, 0.0f); glVertex2i(x1, y1);
543 glTexCoord2f(0.0f, 1.0f); glVertex2i(x1, y2);
544 glTexCoord2f(1.0f, 1.0f); glVertex2i(x2, y2);
545 glTexCoord2f(1.0f, 0.0f); glVertex2i(x2, y1);
551 render_reflection(GstVaapiSink *sink)
553 const guint x1 = sink->display_rect.x;
554 const guint x2 = sink->display_rect.x + sink->display_rect.width;
555 const guint y1 = sink->display_rect.y;
556 const guint rh = sink->display_rect.height / 5;
557 GLfloat ry = 1.0f - (GLfloat)rh / (GLfloat)sink->display_rect.height;
561 glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
562 glTexCoord2f(0.0f, 1.0f); glVertex2i(x1, y1);
563 glTexCoord2f(1.0f, 1.0f); glVertex2i(x2, y1);
565 glColor4f(1.0f, 1.0f, 1.0f, 0.0f);
566 glTexCoord2f(1.0f, ry); glVertex2i(x2, y1 + rh);
567 glTexCoord2f(0.0f, ry); glVertex2i(x1, y1 + rh);
573 gst_vaapisink_show_frame_glx(
575 GstVaapiSurface *surface,
579 GstVaapiWindowGLX * const window = GST_VAAPI_WINDOW_GLX(sink->window);
583 gst_vaapi_window_glx_make_current(window);
584 if (!sink->texture) {
585 sink->texture = gst_vaapi_texture_new(
593 goto error_create_texture;
595 if (!gst_vaapi_texture_put_surface(sink->texture, surface, flags))
596 goto error_transfer_surface;
598 target = gst_vaapi_texture_get_target(sink->texture);
599 texture = gst_vaapi_texture_get_id(sink->texture);
600 if (target != GL_TEXTURE_2D || !texture)
603 if (sink->use_reflection)
604 render_background(sink);
607 glBindTexture(target, texture);
609 if (sink->use_reflection) {
611 glRotatef(20.0f, 0.0f, 1.0f, 0.0f);
612 glTranslatef(50.0f, 0.0f, 0.0f);
615 if (sink->use_reflection) {
617 glTranslatef(0.0, (GLfloat)sink->display_rect.height + 5.0f, 0.0f);
618 render_reflection(sink);
623 glBindTexture(target, 0);
625 gst_vaapi_window_glx_swap_buffers(window);
629 error_create_texture:
631 GST_DEBUG("could not create VA/GLX texture");
634 error_transfer_surface:
636 GST_DEBUG("could not transfer VA surface to texture");
642 static inline gboolean
643 gst_vaapisink_show_frame_x11(
645 GstVaapiSurface *surface,
649 if (!gst_vaapi_window_put_surface(sink->window, surface,
650 NULL, &sink->display_rect, flags)) {
651 GST_DEBUG("could not render VA surface");
658 gst_vaapisink_show_frame(GstBaseSink *base_sink, GstBuffer *buffer)
660 GstVaapiSink * const sink = GST_VAAPISINK(base_sink);
661 GstVaapiVideoBuffer * const vbuffer = GST_VAAPI_VIDEO_BUFFER(buffer);
662 GstVaapiSurface *surface;
665 GstVideoOverlayComposition * const composition =
666 gst_video_buffer_get_overlay_composition(buffer);
668 if (sink->display != gst_vaapi_video_buffer_get_display (vbuffer)) {
669 g_clear_object(&sink->display);
670 sink->display = g_object_ref (gst_vaapi_video_buffer_get_display (vbuffer));
674 return GST_FLOW_UNEXPECTED;
676 surface = gst_vaapi_video_buffer_get_surface(vbuffer);
678 return GST_FLOW_UNEXPECTED;
680 GST_DEBUG("render surface %" GST_VAAPI_ID_FORMAT,
681 GST_VAAPI_ID_ARGS(gst_vaapi_surface_get_id(surface)));
683 flags = gst_vaapi_video_buffer_get_render_flags(vbuffer);
685 if (!gst_vaapi_surface_set_subpictures_from_composition(surface,
687 GST_WARNING("could not update subtitles");
689 switch (sink->display_type) {
691 case GST_VAAPI_DISPLAY_TYPE_GLX:
692 success = gst_vaapisink_show_frame_glx(sink, surface, flags);
695 case GST_VAAPI_DISPLAY_TYPE_X11:
696 success = gst_vaapisink_show_frame_x11(sink, surface, flags);
699 GST_ERROR("unsupported display type %d", sink->display_type);
703 return success ? GST_FLOW_OK : GST_FLOW_UNEXPECTED;
707 gst_vaapisink_query(GstBaseSink *base_sink, GstQuery *query)
709 GstVaapiSink *sink = GST_VAAPISINK(base_sink);
710 GST_DEBUG ("sharing display %p", sink->display);
711 return gst_vaapi_reply_to_query (query, sink->display);
715 gst_vaapisink_finalize(GObject *object)
717 gst_vaapisink_destroy(GST_VAAPISINK(object));
719 G_OBJECT_CLASS(gst_vaapisink_parent_class)->finalize(object);
723 gst_vaapisink_set_property(
730 GstVaapiSink * const sink = GST_VAAPISINK(object);
733 case PROP_DISPLAY_TYPE:
734 sink->display_type = g_value_get_enum(value);
736 case PROP_FULLSCREEN:
737 sink->fullscreen = g_value_get_boolean(value);
739 case PROP_SYNCHRONOUS:
740 sink->synchronous = g_value_get_boolean(value);
742 case PROP_USE_REFLECTION:
743 sink->use_reflection = g_value_get_boolean(value);
746 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
752 gst_vaapisink_get_property(
759 GstVaapiSink * const sink = GST_VAAPISINK(object);
762 case PROP_DISPLAY_TYPE:
763 g_value_set_enum(value, sink->display_type);
765 case PROP_FULLSCREEN:
766 g_value_set_boolean(value, sink->fullscreen);
768 case PROP_SYNCHRONOUS:
769 g_value_set_boolean(value, sink->synchronous);
771 case PROP_USE_REFLECTION:
772 g_value_set_boolean(value, sink->use_reflection);
775 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
781 gst_vaapisink_class_init(GstVaapiSinkClass *klass)
783 GObjectClass * const object_class = G_OBJECT_CLASS(klass);
784 GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
785 GstBaseSinkClass * const basesink_class = GST_BASE_SINK_CLASS(klass);
786 GstPadTemplate *pad_template;
788 GST_DEBUG_CATEGORY_INIT(gst_debug_vaapisink,
789 GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC);
791 object_class->finalize = gst_vaapisink_finalize;
792 object_class->set_property = gst_vaapisink_set_property;
793 object_class->get_property = gst_vaapisink_get_property;
795 basesink_class->start = gst_vaapisink_start;
796 basesink_class->stop = gst_vaapisink_stop;
797 basesink_class->set_caps = gst_vaapisink_set_caps;
798 basesink_class->preroll = gst_vaapisink_show_frame;
799 basesink_class->render = gst_vaapisink_show_frame;
800 basesink_class->query = gst_vaapisink_query;
802 gst_element_class_set_details_simple(
804 gst_vaapisink_details.longname,
805 gst_vaapisink_details.klass,
806 gst_vaapisink_details.description,
807 gst_vaapisink_details.author
810 pad_template = gst_static_pad_template_get(&gst_vaapisink_sink_factory);
811 gst_element_class_add_pad_template(element_class, pad_template);
812 gst_object_unref(pad_template);
814 g_object_class_install_property
817 g_param_spec_enum("display",
819 "display type to use",
820 GST_VAAPI_TYPE_DISPLAY_TYPE,
821 GST_VAAPI_DISPLAY_TYPE_ANY,
822 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
825 g_object_class_install_property
828 g_param_spec_boolean("use-reflection",
830 "Enables OpenGL reflection effect",
835 g_object_class_install_property
838 g_param_spec_boolean("fullscreen",
840 "Requests window in fullscreen state",
845 * GstVaapiSink:synchronous:
847 * When enabled, runs the X display in synchronous mode. Note that
848 * this is used only for debugging.
850 g_object_class_install_property
853 g_param_spec_boolean("synchronous",
855 "Toggles X display synchronous mode",
861 gst_vaapisink_init(GstVaapiSink *sink)
864 sink->display = NULL;
866 sink->window_width = 0;
867 sink->window_height = 0;
868 sink->texture = NULL;
869 sink->video_width = 0;
870 sink->video_height = 0;
871 sink->video_par_n = 1;
872 sink->video_par_d = 1;
873 sink->foreign_window = FALSE;
874 sink->fullscreen = FALSE;
875 sink->synchronous = FALSE;
876 sink->display_type = DEFAULT_DISPLAY_TYPE;
877 sink->use_reflection = FALSE;