1. 15 Mar, 2021 2 commits
  2. 10 Mar, 2021 2 commits
    • Guillaume Desmottes's avatar
      audioaggregator: fix input_buffer ownership · 42b4ed92
      Guillaume Desmottes authored and Tim-Philipp Müller's avatar Tim-Philipp Müller committed
      The way pad->priv->input_buffer reference was managed was pretty
      spurious:
      - it was overridden without unrefing it, which could potentially lead to
        leaks.
      - we were unreffing it while keeping the pointer around, which could
        potentially lead to use-after-free or double-free.
      
      As priv->input_buffer is actually no longer used outside of the
      aggregate() method, remove it from pad->priv to simplify the code and
      prevent the issues desribed above.
      
      Fix a single buffer leak when shutting down the pipeline as the buffer
      returned from gst_aggregator_pad_drop_buffer() was never unreffed.
      
      Part-of: <!1062>
      42b4ed92
    • Guillaume Desmottes's avatar
      audioaggregator: fix input buffer when converting · 48416f80
      Guillaume Desmottes authored and Tim-Philipp Müller's avatar Tim-Philipp Müller committed
      This code path is meant to convert the current buffer to the new format
      on update. It was using priv->input_buffer as input which is either
      priv->buffer or a converted version of it.
      Use priv->buffer instead as priv->input_buffer may no longer be a valid
      reference.
      
      Part-of: <!1062>
      48416f80
  3. 26 Feb, 2021 1 commit
  4. 25 Feb, 2021 2 commits
  5. 24 Feb, 2021 1 commit
  6. 19 Feb, 2021 1 commit
  7. 17 Feb, 2021 3 commits
    • Tim-Philipp Müller's avatar
      uridecodebin3: make caps property work · 82c52582
      Tim-Philipp Müller authored
      The caps set on uridecodebin3 via the "caps" property
      were never passed to the internal decodebin3, so did
      absolutely nothing.
      
      Fixes #837
      
      Part-of: <!1038>
      82c52582
    • Alicia Boya García's avatar
      videodecoder: Fix racy critical when pool negotiation occurs during flush · b944a254
      Alicia Boya García authored and Tim-Philipp Müller's avatar Tim-Philipp Müller committed
      I found a rather reproducible race in a WebKit LayoutTest when a player
      was intantiated and a VP8/9 video was loaded, then torn down after
      getting the video dimensions from the caps.
      
      The crash occurs during the handling of the first frame by gstvpxdec.
      The following actions happen sequentially leading to a crash.
      
      (MT=Main Thread, ST=Streaming Thread)
      
      MT: Sets pipeline state to NULL, which deactivates vpxdec's srcpad,
          which in turn sets its FLUSHING flag.
      
      ST: gst_vpx_dec_handle_frame() -- which is still running -- calls
          gst_video_decoder_allocate_output_frame(); this in turn calls
          gst_video_decoder_negotiate_unlocked() which fails because the
          srcpad is FLUSHING. As a direct consequence of the negotiation
          failure, a pool is NOT set.
      
          gst_video_decoder_negotiate_unlocked() still assumes there is a
          pool, crashing in a critical in gst_buffer_pool_acquire_buffer()
          a couple statements later.
      
      This patch fixes the bug by returning != GST_FLOW_OK when the
      negotiation fails. If the srcpad is FLUSHING, GST_FLOW_FLUSHING is
      returned, otherwise GST_FLOW_ERROR is used.
      
      Part-of: <!1037>
      b944a254
    • Jan Alexander Steffens's avatar
      libs: audio: Fix gst_audio_buffer_truncate meta handling · ee0f9de6
      Jan Alexander Steffens authored and Tim-Philipp Müller's avatar Tim-Philipp Müller committed
      In the non-interleaved case, it made `buffer` writable but then changed
      the meta of the non-writable buffer.
      
      Part-of: <!1036>
      ee0f9de6
  8. 30 Jan, 2021 1 commit
  9. 28 Jan, 2021 1 commit
  10. 14 Jan, 2021 1 commit
  11. 13 Jan, 2021 3 commits
  12. 12 Jan, 2021 1 commit
  13. 05 Jan, 2021 1 commit
  14. 04 Jan, 2021 1 commit
    • Tim-Philipp Müller's avatar
      tagdemux: resize and trim buffer in place to fix interaction with oggdemux · a89b4757
      Tim-Philipp Müller authored
      Elements operating in pull mode may optionally pass a buffer to
      pull_range that should be filled with the data. The only element
      that does that at the moment is oggdemux operating in pull mode.
      
      tagdemux currently creates a sub-buffer whenever a buffer pulled
      from upstream (filesrc, usually) needs to be trimmed. This creates
      a new buffer, however, so disregards any passed-in buffer from a
      downstream oggdemux.
      
      This would cause assertion failures and playback problems for
      ogg files that contain ID3 tags at the end.
      
      Fixes #848
      
      Part-of: <!995>
      a89b4757
  15. 01 Jan, 2021 1 commit
    • Mathieu Duponchelle's avatar
      compositor/blend: fix blending of subsampled components · 0fdc1ca8
      Mathieu Duponchelle authored and Tim-Philipp Müller's avatar Tim-Philipp Müller committed
      The correct way to determine the byte offset at a certain yoffset
      in a subsampled component is to shift the yoffset by the component's
      hsub
      
      This fixes out-of-bounds memory accesses and visible artefacts,
      example pipeline with the samples from #802:
      
      gst-launch-1.0 compositor name=vmixer sink_1::xpos=1910 sink_1::ypos=1080 ! \
          videoconvert ! videorate ! xvimagesink \
        filesrc location=VID_20200723_203606.mp4 ! decodebin name=demux1 ! \
          queue ! videoflip method=vertical-flip ! vmixer. \
        filesrc location=bridgeoverstubbledwater.mp4 ! decodebin name=demux2 ! \
          queue ! vmixer.
      
      Part-of: <!989>
      0fdc1ca8
  16. 31 Dec, 2020 2 commits
    • Mathieu Duponchelle's avatar
      appsrc: fix signal documentation · a85b149f
      Mathieu Duponchelle authored and Tim-Philipp Müller's avatar Tim-Philipp Müller committed
      Part-of: <!993>
      a85b149f
    • Edward Hervey's avatar
      videoaggregator: Pop out old buffers on timeout · 8149de13
      Edward Hervey authored and Tim-Philipp Müller's avatar Tim-Philipp Müller committed
      This situation happens in the situation where an input stream has a framerate
      exceeding the timeout latency (Ex: 1fps with a latency of 500ms) and an input
      stream greater than output framerate (ex: 60fps in, 30 fps out).
      
      The problem that would happen is that we would timeout, but then buffers from
      the fast input stream would only be popped out one by one.... until a buffer
      reaches the low-framerate input stream at which point they would quickly be
      popped out/used. The resulting output would be "slow ... fast ... slow ... fast"
      of that input fast stream.
      
      In order to avoid this situation, whenever we detect a late buffer, check if
      there's a next one and re-check with that one.
      
      Part-of: <!991>
      8149de13
  17. 15 Dec, 2020 1 commit
  18. 14 Dec, 2020 1 commit
    • Jordan Petridіs's avatar
      libvisual: workaround clang warning · a26d82ba
      Jordan Petridіs authored and Tim-Philipp Müller's avatar Tim-Philipp Müller committed
      libvisual api expects a priv data pointer to be passed, though we know its
      going to be `GstDebugLevel`.
      
      ```
      ../subprojects/gst-plugins-base/ext/libvisual/plugin.c:33:39: error: cast to smaller integer type 'GstDebugLevel' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast]
       GST_CAT_LEVEL_LOG (libvisual_debug, (GstDebugLevel) (priv), NULL, "%s - %s",
      ```
      
      Part-of: <!976>
      a26d82ba
  19. 11 Dec, 2020 1 commit
    • Edward Hervey's avatar
      decodebin3: Release selection lock when pushing EOS · ba3ed444
      Edward Hervey authored and Tim-Philipp Müller's avatar Tim-Philipp Müller committed
      We can't keep the lock otherwise this would lock other actions. In order to keep
      it safe, we grab a list of peer pads to send EOS to with the lock taken, then
      send to the peer pads with the lock released.
      
      Also make sure the selection lock is taken for another call to this function
      
      Fixes #847
      
      Part-of: <!973>
      ba3ed444
  20. 06 Dec, 2020 2 commits
  21. 05 Dec, 2020 5 commits
  22. 04 Dec, 2020 5 commits
    • Mart Raudsepp's avatar
      gl/eagl: Fix automatic resize behaviour · e30272d3
      Mart Raudsepp authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      !681
      added a layoutSubViews, which never gets called, because it should have been
      called layoutSubviews (non-capital "v"). However after fixing that, it still
      doesn't work correctly, because window_width/height values are immediately
      updated and then draw_cb will never trigger the resize path, because the
      values are already up to date.
      Update the values inside the resize path again instead, so the check for
      entering the resize path is logically always correct.
      This makes the layoutSubviews unnecessary, as it only updated the internal
      size values prematurely, so it is deleted instead of method naming fixed.
      
      These changes were originally done to avoid accessing UIKit objects on the
      main thread, but no additional accesses are added here, only internal
      private variable assignments under the same draw_lock, so there should be
      no threading issues reintroduced.
      
      Part-of: <!960>
      e30272d3
    • Mart Raudsepp's avatar
      gl/eagl: Fix resize condition check in draw_cb to not get called unnecessarily · 0854d168
      Mart Raudsepp authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      A CGSize contains CGFloat values (a typedef to double or float), which means
      that the values aren't equal, despite it being equal after they are cast to
      int by assigning them to window_height/width private members. This leads to
      excessive gst_gl_window_resize calls on each frame, at least if the CGFloat
      value has a .5 decimal value, e.g. 103.5.
      Fix it by storing them as CGFloat instead of gint.
      
      Part-of: <!960>
      0854d168
    • Matthew Waters's avatar
      video/converter: increase the number of cache lines for resampling · 630e1e78
      Matthew Waters authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      The exising hardcoded max default does not account for the possible
      -1 offset when retrieving lines for resampling.  As a result, when
      another chain has the same number of cache lines (4), the resample
      operation would be attempting to generate 5 lines with a cache size
      of 4 and would overwrite the first cache line.
      
      Fixes #821
      
      Part-of: <!959>
      630e1e78
    • He Junyan's avatar
      gluploadelement: Avoid race condition of base class' context. · 5f4e2cd1
      He Junyan authored and Sebastian Dröge's avatar Sebastian Dröge committed
      The base class' context may change, we should use the common API
      with lock to access it, rather than the just directly access the
      struct field.
      
      Part-of: <!921>
      5f4e2cd1
    • He Junyan's avatar
      gluploadelement: Avoid race condition in propose_allocation(). · b5bd6b6f
      He Junyan authored and Sebastian Dröge's avatar Sebastian Dröge committed
      The inside upload and context may have race condition in the function
      of propose_allocation(). They may be destroyed while this function is
      stilling using it.
      
      Part-of: <!921>
      b5bd6b6f
  23. 02 Dec, 2020 1 commit