1. 22 May, 2019 1 commit
  2. 11 Oct, 2014 4 commits
    • George Kiagiadakis's avatar
      waylandsink: take into account the case where a pool may be destroyed together with GstWlDisplay · 3058fe8d
      George Kiagiadakis authored
      There are two cases covered here:
      1) The GstWlDisplay forces the release of the last buffer and the pool
         gets destroyed in this context, which means it unregisters all the
         other buffers from the GstWlDisplay as well and the display->buffers
         hash table gets corrupted because it is iterating.
      2) The pool and its buffers get destroyed concurrently from another
         thread while GstWlDisplay is finalizing and many things get corrupted.
      3058fe8d
    • George Kiagiadakis's avatar
      waylandsink: stack the video subsurface into another subsurface that covers... · 5b1c5dbf
      George Kiagiadakis authored
      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.
      5b1c5dbf
    • George Kiagiadakis's avatar
      waylandsink: remove the ugly gst_wl_display_stop() now that this mechanism is not needed anymore · 4377a5d7
      George Kiagiadakis authored
      Because we no longer have a custom buffer pool that holds a reference
      to the display, there is no way for a cyclic reference to happen like
      before, so we no longer need to explicitly call a function from the
      display to release the wl_buffers.
      
      However, the general mechanism of registering buffers to the display
      and forcibly releasing them when the display is destroyed is still
      needed to avoid potential memory leaks. The comment in wlbuffer.c
      is updated to reflect the current situation.
      4377a5d7
    • George Kiagiadakis's avatar
      waylandsink: rework the mechanism for keeping buffers out of the pool until wl_buffer::release · 9807d58b
      George Kiagiadakis authored
      This also removes the GstWlMeta and adds a wrapper class for wl_buffer
      which is saved in the GstBuffer qdata instead of being a GstMeta.
      
      The motivation behind this is mainly to allow attaching wl_buffers on
      GstBuffers that have not been allocated inside the GstWaylandBufferPool,
      so that if for example an upstream element is sending us a buffer
      from a different pool, which however does not need to be copied
      to a buffer from our pool because it may be a hardware buffer
      (hello dmabuf!), we can create a wl_buffer directly from it and first,
      attach it on it so that we don't have to re-create a wl_buffer every
      time the same GstBuffer arrives and second, force the whole mechanism
      for keeping the buffer out of the pool until there is a wl_buffer::release
      on that foreign GstBuffer.
      9807d58b