Skip to content
  • Matthew Waters's avatar
    gst/systemclock: wait on each entry individually · 6f9a63a1
    Matthew Waters authored
    Problem:
    multiple aggregator elements (audiomixer, compositor) in a live
    pipeline use a lot of CPU waiting each other up.  This is because
    of the previously unused clock entry unscheduling during regular
    operation.
    
    Clock entry unscheduling has the potential to wake up every clock entry
    waiting using the system clock which may be a large number.
    
    Solution:
    Implement waiting per entry and only wakeup the unscheduled entry.
    
    While this may be possible using GCond, theoretically GCond only gives
    us microsecond accuracy and uses relative waits in a number of places.
    We can unfortunately do better poking at the platform specifics
    ourselves by using futexes on linux and pthread on other unix.  Windows
    may have a possible implementation using Waitable timers but that is
    not implemented here and instead falls back to the GCond implementation.
    GCond waits on Windows is still as accurate as the previous GstPoll-based
    implementation.
    6f9a63a1