Commit graph

11 commits

Author SHA1 Message Date
George Kiagiadakis
5b1c5dbf99 waylandsink: stack the video subsurface into another subsurface that covers the whole render rectangle
The main reason behind this is that when the video caps change and the video
subsurface needs to resize and change position, the wl_subsurface.set_position
call needs a commit in its parent in order to take effect. Previously,
the parent was the application's surface, over which there is no control.
Now, the parent is inside the sink, so we can commit it and change size smoothly.

As a side effect, this also allows the sink to draw its black borders on
its own, without the need for the application to do that. And another side
effect is that this can now allow resizing the sink when it is in top-level
mode and have it respect the aspect ratio.
2014-10-11 14:57:14 +02:00
George Kiagiadakis
bda600ed92 waylandsink: improve the way the video size is passed to wlwindow and also improve the code for window creation 2014-06-17 13:51:29 +02:00
George Kiagiadakis
cffb38993d waylandsink: move surface resizing logic to the GstWlWindow and make it be called from the main thread 2014-06-17 13:51:28 +02:00
George Kiagiadakis
61e077155b waylandsink: cleanup GstWlWindow a bit after the overlaying semantics change
* own_surface is not needed anymore
* gst_wl_window_from_surface is not used externally anymore
* many initializations to 0 are not needed (GObject does them)
2014-06-17 13:51:27 +02:00
George Kiagiadakis
07f671fcaf waylandsink: create and maintain the subsurface inside the sink
This means that the given surface in set_window_handle can now be
the window's top-level surface on top of which waylandsink creates
its own subsurface for rendering the video.

This has many advantages:
* We can maintain aspect ratio by overlaying the subsurface in
  the center of the given area and fill the parent surface's area
  black in case we need to draw borders (instead of adding another
  subsurface inside the subsurface given from the application,
  so, less subsurfaces)
* We can more easily support toolkits without subsurfaces (see gtk)
* We can get properly use gst_video_overlay_set_render_rectangle
  as our api to set the video area size from the application and
  therefore remove gst_wayland_video_set_surface_size.
2014-06-17 13:51:27 +02:00
George Kiagiadakis
bd5ad17e58 waylandsink: drop width/height arguments from gst_wl_window_new_from_surface() 2014-06-17 13:51:27 +02:00
George Kiagiadakis
0187be8e0c waylandsink: add G_BEGIN/END_DECLS on all headers for consistency 2014-06-17 13:51:27 +02:00
George Kiagiadakis
87949dcb07 waylandsink: remove unused functions 2014-06-17 13:51:26 +02:00
George Kiagiadakis
086ac4ee81 waylandsink: Use wl_scaler/wl_viewport to scale the surface in the compositor/hardware 2014-06-17 13:51:25 +02:00
George Kiagiadakis
e56f305274 waylandsink: implement the GstVideoOverlay & GstWaylandVideo interfaces
This is the initial implementation, without the GstVideoOverlay.expose()
method. It only implements using an external (sub)surface and resizing
it with GstWaylandVideo.
2014-06-17 13:51:24 +02:00
George Kiagiadakis
ae6aebd9d5 waylandsink: split window-related code out to a new GstWlWindow class
GstWlWindow also has API ready to support subsurfaces.
2014-06-17 13:51:22 +02:00