1. 03 1月, 2015 7 次提交
  2. 31 12月, 2014 6 次提交
    • J
      libobs: Redesign/optimize frame encoding handling · 11106c2f
      jp9000 提交于
      Previously, the design for the interaction between the encoder thread
      and the graphics thread was that the encoder thread would signal to the
      graphics thread when to start drawing each frame.  The original idea
      behind this was to prevent mutually cascading stalls of encoding or
      graphics rendering (i.e., if rendering took too long, then encoding
      would have to catch up, then rendering would have to catch up again, and
      so on, cascading upon each other).  The ultimate goal was to prevent
      encoding from impacting graphics and vise versa.
      
      However, eventually it was realized that there were some fundamental
      flaws with this design.
      
      1. Stray frame duplication.  You could not guarantee that a frame would
         render on time, so sometimes frames would unintentionally be lost if
         there was any sort of minor hiccup or if the thread took too long to
         be scheduled I'm guessing.
      
      2. Frame timing in the rendering thread was less accurate.  The only
         place where frame timing was accurate was in the encoder thread, and
         the graphics thread was at the whim of thread scheduling.  On higher
         end computers it was typically fine, but it was just generally not
         guaranteed that a frame would be rendered when it was supposed to be
         rendered.
      
      So the solution (originally proposed by r1ch and paibox) is to instead
      keep the encoding and graphics threads separate as usual, but instead of
      the encoder thread controlling the graphics thread, the graphics thread
      now controls the encoder thread.  The encoder thread keeps a limited
      cache of frames, then the graphics thread copies frames in to the cache
      and increments a semaphore to schedule the encoder thread to encode that
      data.
      
      In the cache, each frame has an encode counter.  If the frame cache is
      full (e.g., the encoder taking too long to return frames), it will not
      cache a new frame, but instead will just increment the counter on the
      last frame in the cache to schedule that frame to encode again, ensuring
      that frames are on time and reducing CPU usage by lowering video
      complexity.  If the graphics thread takes too long to render a frame,
      then it will add that frame with the count value set to the total amount
      of frames that were missed (actual legitimately duplicated frames).
      
      Because the cache gives many frames of breathing room for the encoder to
      encode frames, this design helps improve results especially when using
      encoding presets that have higher complexity and CPU usage, minimizing
      the risk of needlessly skipped or duplicated frames.
      
      I also managed to sneak in what should be a bit of an optimization to
      reduce copying of frame data, though how much of an optimization it
      ultimately ends up being is debatable.
      
      So to sum it up, this commit increases accuracy of frame timing,
      completely removes stray frame duplication, gives better results for
      higher complexity encoding presets, and potentially optimizes the frame
      pipeline a tiny bit.
      11106c2f
    • J
      libobs: Fix bug with frame output handling · 11dd7912
      jp9000 提交于
      The boolean variables which stored whether frames have been
      rendered/downloaded/converted/etc were not being reset when video
      restarted, causing frames to not be sent in the correct order whenever
      video was reset.  This could lead to minor desync of video/audio.
      11dd7912
    • J
      obs-outputs: Fix FLV corruption bug · a7d2450d
      jp9000 提交于
      The 'sent_headers' member variable of the FLV output would not be reset
      when the output was restarted, causing important data to not be written,
      thus creating an invalid FLV file.
      a7d2450d
    • J
      libobs: Fix potential crash on output stop · 24428033
      jp9000 提交于
      In certain circumstances where the output was stopping, and where data
      took a long enough time to send (such as when using an encoding preset
      that causes high CPU usage), the output would sometimes still send data
      even after it was stopped, typically causing the output to crash.
      24428033
    • J
      libobs/media-io: Add frame copying function · 8e154982
      jp9000 提交于
      8e154982
    • J
      libobs/media-io: Add #pragma once to video-frame.h · 5d0551eb
      jp9000 提交于
      5d0551eb
  3. 30 12月, 2014 1 次提交
  4. 29 12月, 2014 1 次提交
  5. 28 12月, 2014 15 次提交
    • J
      libobs: Fix force mono channel count · caa62510
      jp9000 提交于
      I unintentionally made it use obs_source::sample_info instead of using
      the actual target channel count, which is designated by the OBS output
      sampler info.  obs_source::sample_info is actually used to indicate the
      currently set sampler information for incoming samples.  So if a source
      is outputting 5.1 channel 48khz audio, and OBS is running at stereo
      44.1khz, then the obs_source::sample_info value would be set to
      5.1/48khz, not the other way around.  It indicates what the source
      itself is running at, not what OBS is running at.
      
      I suppose the variable needs a better name because even I used it
      incorrectly despite actually having been the one who wrote it.
      caa62510
    • J
      UI: Add advanced audio properties dialog · 6fc52dfb
      jp9000 提交于
      This dialog gives options such as increasing audio past 100%, forcing
      the audio of a source to mono, and setting the audio sync offset of a
      source (which was an oft-requested feature)
      6fc52dfb
    • J
      libobs: Remove inline on a function · ce6a1146
      jp9000 提交于
      The copy_audio_data function really shouldn't be inlined because it's
      being called twice.  It's somewhat unnecessary, I think I left it inline
      by accident.
      ce6a1146
    • J
      libobs: Add flag to force source audio to mono · 63c43b64
      jp9000 提交于
      This flag is actually useful under a number of circumstances, and has
      been requested a number of times.
      63c43b64
    • J
      libobs: Refactor source volume transition design · c431ac6a
      jp9000 提交于
      This changes the way source volume handles transitioning between being
      active and inactive states.
      
      The previous way that transitioning handled volume was that it set the
      presentation volume of the source and all of its sub-sources to 0.0 if
      the source was inactive, and 1.0 if active.  Transition sources would
      then also set the presentation volume for sub-sources to whatever their
      transitioning volume was.  However, the problem with this is that the
      design didn't take in to account if the source or its sub-sources were
      active anywhere else, so because of that it would break if that ever
      happened, and I didn't realize that when I was designing it.
      
      So instead, this completely overhauls the design of handling
      transitioning volume.  Each frame, it'll go through all sources and
      check whether they're active or inactive and set the base volume
      accordingly.  If transitions are currently active, it will actually walk
      the active source tree and check whether the source is in a
      transitioning state somewhere.
      
       - If the source is a sub-source of a transition, and it's not active
         outside of the transition, then the transition will control the
         volume of the source.
      
       - If the source is a sub-source of a transition, but it's also active
         outside of the transition, it'll defer to whichever is louder.
      
      This also adds a new callback to the obs_source_info structure for
      transition sources, get_transition_volume, which is called to get the
      transitioning volume of a sub-source.
      c431ac6a
    • J
      libobs: Keep transition reference counter · 10f89886
      jp9000 提交于
      The reason to keep a reference counter for transitions is due to an
      optimization I'm planning on when calculating transition volumes.  I'm
      planning on walking the source tree to be able to calculate the current
      base volume of a source, but *only* if there are transitions active,
      because the only time that the volume can be anything other than 1.0
      or 0.0 is when there are active transitions, which may change the base
      volume of a source.
      10f89886
    • J
      (API Change) libobs: Add _FLAG to source flags · 6eab6cef
      jp9000 提交于
      Changes OBS_SOURCE_UNBUFFERED to OBS_SOURCE_FLAG_UNBUFFERED to make
      naming a bit better for source flags.
      6eab6cef
    • J
      libobs: Save/load source audio sync and flags · fb09db43
      jp9000 提交于
      When a source is being saved, include the audio sync as well as the
      flags.
      fb09db43
    • J
      libobs: Do not set presentation volume on children · 48210d41
      jp9000 提交于
      When the presentation volume is set for a source, it's set for all of
      its children and their children.  The original intention for doing this
      was to be able to use it for transitioning, but honestly it's just bad
      design, and I feel there are better ways to handle transitioning volume.
      48210d41
    • J
      libobs: Add 'audio_sync' source signal · fb6f8721
      jp9000 提交于
      Adds a signal is called when the sync offset has changed for a source.
      fb6f8721
    • J
      libobs: Prevent infinite source recursion · e29a1fd3
      jp9000 提交于
      Changed the design from using obs_source::enum_refs to just simply
      preventing infinite source recursion in general, rather than allowing it
      through the enum_refs variable.  obs_source_add_child has been changed
      so that it now returns a boolean, and if the function fails, it means
      that the child cannot be added due to that potential recursion.
      e29a1fd3
    • J
      libobs: Remove unused audio level source vars · 1ed4c2a9
      jp9000 提交于
      These variables are no longer used by sources anymore, as they were
      removed in favor of the new source audio control handlers.
      1ed4c2a9
    • J
      libobs: Fix a few warnings · c72284f3
      jp9000 提交于
      Two integers are needlessly converted to floating points for what should
      be an integer operation.  One of those floats is then used for another
      integer operation later, where the original integer value should have
      been used.  So essentially there was an int -> float -> int conversion
      going on, which could lead to potential loss of data due to floating
      point precision.
      
      There were also some general 64bit -> 32bit conversion warnings.
      c72284f3
    • J
      Merge pull request #316 from fryshorts/qt-stuff · 3816c5a0
      Jim 提交于
      obs: Refactor network requests.
      3816c5a0
    • J
      Merge pull request #319 from skwerlman/patch-1 · 5a5f8659
      Jim 提交于
      fixed debian source install instructions
      5a5f8659
  6. 27 12月, 2014 2 次提交
  7. 25 12月, 2014 6 次提交
    • F
      obs: Refactor network requests. · ca8ac4e8
      fryshorts 提交于
      Remove unneeded class members for request and buffer handling.
      Let Qt do all the hard work here, keeping track of requests and
      associated data.
      ca8ac4e8
    • E
      Fix minor grammar errors in README · c6ad237b
      Emil Sayahi 提交于
      c6ad237b
    • J
      libobs: Implement obs_source_active · 5875434a
      jp9000 提交于
      ..Apparently I left this function unimplemented.  This function just
      returns whether a source is currently active or not.
      5875434a
    • J
      libobs: Fix export declaration name · 78c2129f
      jp9000 提交于
      obs_encoder_getdisplayname declaration was not changed to match the
      definition (obs_encoder_get_display_name) when the API consistency
      update occurred.
      78c2129f
    • J
      Merge pull request #314 from raincomplex/master · b4535713
      Jim 提交于
      Mark windows changed on Expose
      b4535713
    • R
      Mark windows changed on Expose · 01491a96
      raincomplex 提交于
      On i3wm, windows aren't unmapped when switching away from a window's
      workspace, but it does cause OBS to lose the capture. Because
      switching back will not trigger a MapNotify, the capture fails to
      restart unless you resize or move the window (ConfigureNotify). An
      Expose event is fired by the wm, however, so catching this correctly
      restarts the capture.
      01491a96
  8. 23 12月, 2014 1 次提交
  9. 22 12月, 2014 1 次提交
    • F
      UI: Fix bug with xinerama on linux · 20863c5e
      fryshorts 提交于
      Refactor the screen enumeration code a little to make sure xinerama is present
      and active before using it. If the extension is present but not active it will
      no longer fail.
      20863c5e