1. 02 Apr, 2020 1 commit
  2. 01 Apr, 2020 4 commits
    • Nicolas Dufresne's avatar
      task: Introduce gst_task_resume() API · e272ae28
      Nicolas Dufresne authored
      This new API allow resuming a task if it was paused, while leaving it to
      stopped stated if it was stopped or not started yet. This new API can be
      useful for callback driver workflow, where you basically want to pause and
      resume the task when buffers are notified while avoiding the race with a
      gst_task_stop() coming from another thread.
      e272ae28
    • Mathieu Duponchelle's avatar
      gst-launch: go back down to GST_STATE_NULL in one step. · c682579c
      Mathieu Duponchelle authored
      Going through each state on the way back down to GST_STATE_NULL
      can cause deadlocks, for example:
      
      gst-launch-1.0 audiotestsrc ! valve drop=true ! autoaudiosink
      
      ctrl + C
      
      Hangs forever when going to PAUSED, because the "final" state is
      ASYNC, and the sink blocks waiting for a preroll buffer.
      
      Going straight to NULL addresses this issue, and also helps
      making teardown faster when piping sparse streams to a
      sync sink.
      c682579c
    • Jan Schmidt's avatar
      baseparse: Fix upstream read caching · e906197c
      Jan Schmidt authored
      When running in pull mode (for e.g. mp3 reading),
      baseparse currently reads 64KB from upstream, then mp3parse
      consumes typically around 417/418 bytes of it. Then
      on the next loop, it will read a full fresh 64KB again,
      which is a big waste.
      
      Fix the read loop to use the available cache buffer first
      before going for more data, until the cache drops to < 1KB.
      
      Fixes #518
      e906197c
    • Jan Schmidt's avatar
      baseparse: Fix typo · 35136dc9
      Jan Schmidt authored
      35136dc9
  3. 31 Mar, 2020 1 commit
  4. 28 Mar, 2020 1 commit
  5. 26 Mar, 2020 6 commits
  6. 24 Mar, 2020 2 commits
  7. 23 Mar, 2020 2 commits
    • Jan Alexander Steffens's avatar
      gststructure: Fix gst_structure_take ownership handling · a20ff6aa
      Jan Alexander Steffens authored
      The old code would leave a dangling pointer in oldstr_ptr if two threads
      attempted to take the same structure into the same location at the same
      time:
      
      1. First "oldstr == newstr" check (before the loop) fails.
      2. Compare-and-exchange fails, due to a second thread completing the
         same gst_structure_take.
      3. Second "oldstr == newstr" check (in the loop) succeeds, loop breaks.
      4. "oldstr" check succeeds, old structure gets freed.
      5. oldstr_ptr now contains a dangling pointer.
      
      This shouldn't happen in code that handles ownership sanely, so check
      that we don't try to do this and complain loudly.
      
      Also simplify the function by using a do-while loop, like
      gst_mini_object_take.
      
      !413
      a20ff6aa
    • Jan Alexander Steffens's avatar
      gstdeviceproviderfactory: Remove volatile from provider storage · e45f187d
      Jan Alexander Steffens authored
      Avoids a few compiler warnings:
      
      ../subprojects/gstreamer/gst/gstdeviceproviderfactory.c: In function ‘gst_device_provider_factory_finalize’:
      ../subprojects/gstreamer/gst/gstdeviceproviderfactory.c:96:12: warning: assignment discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers]
         96 |   provider = g_atomic_pointer_get (&factory->provider);
            |            ^
      ../subprojects/gstreamer/gst/gstdeviceproviderfactory.c: In function ‘gst_device_provider_factory_get’:
      ../subprojects/gstreamer/gst/gstdeviceproviderfactory.c:276:19: warning: assignment discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers]
        276 |   device_provider = g_atomic_pointer_get (&newfactory->provider);
            |                   ^
      ../subprojects/gstreamer/gst/gstdeviceproviderfactory.c:309:21: warning: assignment discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers]
        309 |     device_provider = g_atomic_pointer_get (&newfactory->provider);
            |
      
      !414
      e45f187d
  8. 22 Mar, 2020 2 commits
  9. 20 Mar, 2020 1 commit
  10. 19 Mar, 2020 1 commit
    • Edward Hervey's avatar
      gstvalue: Avoid expensive fallback on intersection · cd751c2d
      Edward Hervey authored
      The type checks at the end of `gst_value_intersect` to call the flagset
      intersection are relatively expensive.
      
      If we already know that:
      * There was a compare function but it didn't return GST_VALUE_EQUAL
      * AND none of the registered intersect functions failed
      
      Then we know they can't intersect and can return early.
      
      Trims ~20% of the instruction calls
      cd751c2d
  11. 18 Mar, 2020 6 commits
    • Edward Hervey's avatar
      gstvalue: Optimize some list<=>list functions · 34b6929a
      Edward Hervey authored
      For subtracting a list from another, the previous implementation would
      do a double subtraction of one from another (which would create temporary
      arrays/values which would then be discarded). Instead iterate and do
      the comparision directly.
      
      For intersecting a list with another, we can directly iterate both at
      once and therefore avoid doing a *full* check of all values of the list
      against all other values of the list.
      34b6929a
    • Edward Hervey's avatar
      gstvalue: Inline GstValueList/GstValueArray · 917dd088
      Edward Hervey authored
      This tries to inline as much as possible array/list and its contents
      in order to avoid double allocation/freeing. This also improves the
      locality of data.
      
      The internal value is still API/ABI compatible with the *public*
      GArray structure. This allows READ-ONLY backwards compatibility with
      any external users that assume that the content of a list/array value
      is backed by a GArray.
      917dd088
    • Miguel París Díaz's avatar
      bufferlist: foreach: always remove as parent if buffer is changed · 2ef0fd18
      Miguel París Díaz authored
      In case the buffer is not writable, the parent (the BufferList) is not
      removed before calling func. So if it is changed, the parent (the BufferList)
      of the previous buffer should be removed after calling func.
      2ef0fd18
    • Edward Hervey's avatar
      bufferlist: Add check for overflow · 1e9dcac0
      Edward Hervey authored
      1e9dcac0
    • Edward Hervey's avatar
      gststructure: Optimize pre-allocation of structures · 5318a038
      Edward Hervey authored
      For all the structure creation using valist/varargs we calculate
      the number of fields we will need to store. This ensures all callers
      will end up with a single allocation.
      5318a038
    • Edward Hervey's avatar
      gststructure: Inline array and contents · 1b568fa0
      Edward Hervey authored
      Instead of having 3 allocations:
      * One for GstStructure
      * One for GArray
      * One for the array *within* GArray
      
      We try to limit this to a single allocation, inlining everything. This
      reduces the number of micro-allocations and improves locality of data
      access.
      1b568fa0
  12. 14 Mar, 2020 1 commit
  13. 13 Mar, 2020 1 commit
  14. 12 Mar, 2020 2 commits
  15. 11 Mar, 2020 1 commit
  16. 09 Mar, 2020 6 commits
  17. 05 Mar, 2020 1 commit
  18. 03 Mar, 2020 1 commit