1. 17 1月, 2014 2 次提交
    • J
      Updated comments for outputs/encoders · ff1afac5
      jp9000 提交于
      Changed the comments to properly reflect the new callbacks, as I had
      forgotten to update the comments for them both.
      
      Also, changed "setbitrate" and "request_keyframe" return values to be
      boolean.
      ff1afac5
    • J
      Add preliminary output/encoder interface · 29b7d362
      jp9000 提交于
      - First, I redid the output interface for libobs.  I feel like it's
        going in a pretty good direction in terms of design.
      
        Right now, the design is so that outputs and encoders are separate.
        One or more outputs can connect to a specific encoder to receive its
        data, or the output can connect directly to raw data from libobs
        output itself, if the output doesn't want to use a designated encoder.
        Data is received via callbacks set when you connect to the encoder or
        raw output.  Multiple outputs can receive the data from a single
        encoder context if need be (such as for streaming to multiple channels
        at once, and/or recording with the same data).
      
        When an encoder is first connected to, it will connect to raw output,
        and start encoding.  Additional connections will receive that same
        data being encoded as well after that.  When the last encoder has
        disconnected, it will stop encoding.  If for some reason the encoder
        needs to stop, it will use the callback with NULL to signal that
        encoding has stopped.  Some of these things may be subject to change
        in the future, though it feels pretty good with this design so far.
        Will have to see how well it works out in practice versus theory.
      
      - Second, Started adding preliminary RTMP/x264 output plugin code.
      
        To speed things up, I might just make a direct raw->FFmpeg output to
        create a quick output plugin that we can start using for testing all
        the subsystems.
      29b7d362
  2. 14 1月, 2014 1 次提交
    • J
      Simplify media i/o interfaces · 62c2b1d7
      jp9000 提交于
      Completely revamped the entire media i/o data and handlers.  The
      original idea was to have a system that would have connecting media
      inputs and outputs, but at a certain point I realized that this was an
      unnecessary complexity for what we wanted to do.  (Also, it reminded me
      of directshow filters, and I HATE directshow with a passion, and
      wouldn't wish it upon my greatest enemy)
      
      Now, audio/video outputs are connected to directly, with better callback
      handlers, and will eventually have the ability to automatically handle
      conversions such as 4:4:4 to 4:2:0 when connecting to an input that uses
      them.  Doing this will allow the video/audio i/o handlers to also
      prevent duplicate conversion, as well as make it easier/simple to use.
      
      My true goal for this is to make output and encoder plugins as simple to
      create as possible.  I want to be able to be able to create an output
      plugin with almost no real hassle of having to worry about image
      conversions, media inputs/outputs, etc.  A plugin developer shouldn't
      have to handle that sort of stuff when he/she doesn't really need to.
      
      Plugins will be able to simply create a callback via obs_video() and/or
      obs_audio(), and they will automatically receive the audio/video data in
      the formats requested via a simple callback, without needing to do
      almost anything else at all.
      62c2b1d7
  3. 13 1月, 2014 1 次提交
  4. 12 1月, 2014 6 次提交
    • J
      Fix one minor bug with new timing code · 02a101d1
      jp9000 提交于
      When the first async video frame is used it would not set audio timing,
      moved that code into obs_source_getframe.  Also, might consider renaming
      obs_source_getframe.  "Query frame" instead perhaps?  Will sleep on it,
      might not even bother.
      02a101d1
    • J
      Add preliminary handling of timestamp invalidation · 9f1a3c31
      jp9000 提交于
      - Add preliminary (yet to be tested) handling of timestamp invalidation
        issues that can happen with specific devices, where timestamps can
        reset or go backward/forward in time with no rhyme or reason.  Spent
        the entire day just trying to figure out the best way to handle this.
      
        If both audio and video are present, it will increment a reference
        counter if video timestamps invalidate, and decrement the reference
        counter when the audio timestamps invalidate.  When the reference
        counter is not 0, it will not send audio as the audio will have
        invalid timing.  What this does is it ensures audio data will never go
        out of bounds in relation to the video, and waits for both audio and
        video timestamps to "jump" together before resuming audio.
      
      - Moved async video frame timing adjustment code into
        obs_source_getframe instead so it's automatically handled whenever
        called.
      
      - Removed the 'audio wait buffer' as it was an unnecessary complexity
        that could have had problems in the future.  Instead, audio will not
        be added until video starts for sources that have both async
        audio/video.  Audio could have buffered for too long of a time anyway,
        who knows what devices are going to do.
      
      - Fixed a minor conversion warning in audio-io.c
      9f1a3c31
    • C
      Merge pull request #26 from computerquip/upstream-merged · fc219e7d
      computerquip 提交于
      Add copyright and name to files it applies to.
      fc219e7d
    • Z
      Add copyright and name to files it applies to. · bb24591d
      Zachary Lund 提交于
      bb24591d
    • J
      Merge pull request #25 from computerquip/upstream-merged · d5f5d0ed
      Jim 提交于
      Various changes for wxGTK
      d5f5d0ed
    • Z
      Fixed os_gettime_ns to provide correct time in ns · 1deb27d5
      Zachary Lund 提交于
      1deb27d5
  5. 11 1月, 2014 4 次提交
    • J
      Clean up code in audio-io.c · 3f0b352d
      jp9000 提交于
      Clean up a little bit of code that was unnecessarily nested.  Still a
      little squishy but better than it was.
      3f0b352d
    • J
      Account for thread pauses for audio data · 4aa4858a
      jp9000 提交于
       - In the audio I/O code, if there's a pause in the program or its
         threads (especially the audio thread), it'll cause it to sample too
         much data, and increase line->base_timestamp to a potentially higher
         value than the next audio timestamp that may be added to the line.
         This would cause it to crash originally, because it expects audio
         data that is within the designated buffering limit.
      
         Because that audio data cannot be filled by that data anyway, just
         ignore the audio data until it goes back to the right timing (which
         it will as long as the code that is using the line accounts for its
         current system time)
      4aa4858a
    • J
      Detect audio timestamp jumps and reset timing · 2a893064
      jp9000 提交于
       - Often, timestamps will go "back" in time with certain..  terrible
         devices that no one should use.  When this occurs, timing is now
         reset so that the new audio comes in directly after the old audio
         seamlessly.
      2a893064
    • J
      Properly position position mixed audio data · faa7f4d2
      jp9000 提交于
       - Audio data was just being popped to the "front" of the mix buffer, so
         instead it now properly pops into the correct position in the mix
         buffer (proper mixing still needs to be implemented)
      faa7f4d2
  6. 10 1月, 2014 8 次提交
    • J
      Added a sinewave audio test source · f827ba38
      jp9000 提交于
       - Added a test audio sinewave test source that should just play a sine
         wave of the middle C note.  Using unsigned 8 bit mono to test
         ffmpeg's audio resampler, seems to work pretty good.
      
       - Fixed a boolean trap in threading.h for the event_init function, it
         now uses enum event_type, which can be EVENT_TYPE_MANUAL or
         EVENT_TYPE_AUTO, to specify whether the event is automatically reset
         or not.
      
       - Changed display names of test sources to something a little less
         vague.
      
       - Removed te whole "if timestamp is 0 just use current system time"
         when outputting source audio, if you want to use system time you
         should just use system time yourself.  Using 0 as some sort of
         "indicator" like that just makes things confusing, and prevents you
         from legitimately using 0 as a timestamp for your audio data.
      f827ba38
    • J
      Fixed bug with circlar buffer · e891b3fa
      jp9000 提交于
       - Circular buffer code wasn't correctly handling the splitting of
         newly placed data segments, the code was untested and turned out to
         just be backwards.  It now copied the data to the back and front of
         the buffer properly.
      e891b3fa
    • Z
      Added comments on why some code is disabled · 78aa456a
      Zachary Lund 提交于
      78aa456a
    • Z
      Cleaned up a bit, reverted API back to normal · 69d32725
      Zachary Lund 提交于
      69d32725
    • Z
      A few changes concerning wxGTK. · d283f24c
      Zachary Lund 提交于
      For one, I added a new member gs_window for future use.
      The member is "display" which represents our connection to X11.
      Ideally, we should use this specific connection to deal with our Window.
      For now, it's disabled. Read comment for more information.
      
      Secondly, wxGTK apparently doesn't map our window in some cases.
      This causes the window ID passed to be bad and will stop (or segfault)
      our program. This might be related to the first commit above.
      
      For now, all this commit does is realize the window manually.
      d283f24c
    • Z
    • J
      13fc0b53
    • J
      Add preliminary audio processing · 6b8e8484
      jp9000 提交于
       - Mixing still isn't implemented, but the audio system should be able
         to start up, and mix at least once audio line for the time being.
         Will have to write some test audio sources to verify things are
         working properly, and build the rest of the output functionality.
      6b8e8484
  7. 09 1月, 2014 6 次提交
  8. 08 1月, 2014 6 次提交
  9. 07 1月, 2014 6 次提交
    • J
      Handle source adding/removal better · 4fe3c472
      jp9000 提交于
       - Made it so that when a source is added or removed from a scene it
         will add a reference to sourceSceneRefs (std::unordered_map).  Each
         source adds a reference to that every time they are added to a scene,
         and releases a reference from it when they are removed from a scene.
      
         When the value reaches 0, the source is no longer in any scenes, and
         is then marked for removal and destroyed.
      
         Before, I was using the source internal reference counter, which is a
         really bad thing to do because I don't know what might actually be
         referencing it.  So using a separate discrete reference counter for
         the number of scenes it's in is better in this case.
      4fe3c472
    • J
      Removed unnecessary sizers from forms (homeworld) · 509a3481
      jp9000 提交于
       - Homeworld apparently removed a number of unnecessary sizers from the
         basic UI window form to reduce wx resize computations.
      509a3481
    • J
      Fixed debug extension check · bf371437
      jp9000 提交于
       - Check the actual debug extension instead of checking GL 4.0 support;
         it appears that despite having GL 4.0 support, AMD does not implement
         the standard debug extensions even when the *_CONTEXT_DEBUG_BIT_ARB
         flag is set on the context.
      
       - Also, fixed a place where spaces where used for indents instead of a
         tab.
      bf371437
    • J
      Fixed debug GL functions on windows (amend) · 156009cc
      jp9000 提交于
       - Removed the dependency on windows.h for windows.  I feel it's an
         unnecessarily large dependency to have to add to all source files
         when the only thing that's needed to make the windows version compile
         the debug functions is just the __stdcall call convention keyword.
      
         On top of increasing compile time due to the large number of headers
         it includes from all the windows API headers, it also adds a lot of
         potential name conflicts, as I was getting a number of name conflicts
         for lots of names like near/far, which were used in old legacy 16bit
         windows code.
      156009cc
    • Z
      Fixed APIENTRY quirk with GLEW · 8073b0ec
      Zachary Lund 提交于
      8073b0ec
    • J
      Merge pull request #21 from computerquip/master · a89a8151
      Jim 提交于
      Various Changes to OpenGL intialization
      a89a8151