1. 11 3月, 2014 6 次提交
    • F
      Fixed usage of event functions · 32c8cd00
      fryshorts 提交于
      The event functions got renamed in obs.
      32c8cd00
    • F
      c0ab8fad
    • J
      Fix semaphore mac code and mac plugin · 5e1cac68
      jp9000 提交于
      Didn't convert the event names and didn't have the right mac includes
      5e1cac68
    • J
      Fix audio streaming and mac semaphores · 585fd8f9
      jp9000 提交于
      ...The reason why audio didn't work was because I overwrote the bitrate
      values.
      
      As for semaphores, mac doesn't support unnamed semaphores without using
      mach semaphores.  So, I just implemented a semaphore wrapper for each
      OS.
      585fd8f9
    • J
      CoreAudio: fix properties for input/output · 80683787
      jp9000 提交于
      Also, check that audio devices are available before setting defaults
      80683787
    • J
      Add preliminary streaming code for testing · 02a07ea0
      jp9000 提交于
       - Add some temporary streaming code using FFmpeg.  FFmpeg itself is not
         very ideal for streaming; lack of direct control of the sockets and
         no framedrop handling means that FFmpeg is definitely not something
         you want to use without wrapper code.  I'd prefer writing my own
         network framework in this particular case just because you give away
         so much control of the network interface.  Wasted an entire day
         trying to go through FFmpeg issues.
      
         There's just no way FFmpeg should be used for real streaming (at
         least without being patched or submitting some sort of patch, but I'm
         sort of feeling "meh" on that idea)
      
         I had to end up writing multiple threads just to handle both
         connecting and writing, because av_interleaved_write_frame blocks
         every call, stalling the main encoder thread, and thus also stalling
         draw signals.
      
       - Add some temporary user interface for streaming settings.  This is
         just temporary for the time being.  It's in the outputs section of
         the basic-mode settings
      
       - Make it so that dynamic arrays do not free all their data when the
         size just happens to be reduced to 0.  This prevents constant
         reallocation when an array keeps going from 1 item to 0 items.  Also,
         it was bad to become dependent upon that functionality.  You must now
         always explicitly call "free" on it to ensure the data is free, and
         that's how it should be.  Implicit functionality can lead to
         confusion and maintainability issues.
      02a07ea0
  2. 08 3月, 2014 2 次提交
    • J
      Activate user-selected audio devices · f2ee9507
      jp9000 提交于
       - Fix a bug where the initial audio data insertion would cause all
         audio data to unintentionally clear (mixed up < and > operators, damn
         human error)
      
       - Fixed a potential interdependant lock scenario with channel mutex
         locks and graphics mutex locks.  The main video thread could lock the
         graphics mutex and then while in the graphics mutex could lock the
         channels mutex.  Meanwhile in another thread, the channel mutex could
         get locked, and then the graphics mutex would get locked, causing a
         deadlock.
      
         The best way to deal with this is to not let mutexes lock within
         other mutexes, but sometimes it's difficult to avoid such as in the
         main video thread.
      
       - Audio devices should now be functional, and the devices in the audio
         settings can now be changed as desired.
      f2ee9507
    • J
      WASAPI: Change some errors messages to warnings · 2c3a3f4e
      jp9000 提交于
      There shouldn't be errors if the actual source has successfully been
      created, just warnings.
      2c3a3f4e
  3. 07 3月, 2014 1 次提交
    • J
      Add a way to get default settings · 7d48dbb1
      jp9000 提交于
       - Implement a means of obtaining default settings for an
         input/output/encoder.  obs_source_defaults for example will return
         the default settings for a particular source type.
      
       - Because C++ doesn't have designated initializers, use functions in
         the WASAPI plugin to register the sources instead.
      7d48dbb1
  4. 06 3月, 2014 2 次提交
    • J
      Load up the lists of audio devices in settings · 2448d0f2
      jp9000 提交于
      It will now load up a the list of audio input/output devices in the
      combo boxes in audio settings.
      2448d0f2
    • J
      Reimplement monitor capture · 4f7ab552
      jp9000 提交于
       - Implement windows monitor capture (code is so much cleaner than in
         OBS1).  Will implement duplication capture later
      
       - Add GDI texture support to d3d11 graphics library
      
       - Fix precision issue with sleep timing, you have to call
         timeBeginPeriod otherwise windows sleep will be totally erratic.
      4f7ab552
  5. 04 3月, 2014 3 次提交
    • J
      WASAPI: Check the HRESULT values with FAILED · 3415960d
      jp9000 提交于
      I can't believe I did !res there.  Well I suppose I can believe it, but
      still.
      3415960d
    • J
      CoreAudio: Separate enumeration code · bec8a09b
      jp9000 提交于
      The enumeration code being up at the top was making things quite messy,
      so I split that code out to a separate set of files.
      bec8a09b
    • J
      Add WASAPI audio capture · 34858825
      jp9000 提交于
       - Add WASAPI audio capture for windows, input and output
      
       - Check for null pointer in os_dlopen
      
       - Add exception-safe 'WinHandle' and 'CoTaskMemPtr' helper classes that
         will automatically call CloseHandle on handles and call CoTaskMemFree
         on certain types of memory returned from windows functions
      
       - Changed the wide <-> MBS/UTF8 conversion functions so that you use
         buffers (like these functions are *supposed* to behave), and changed
         the ones that allocate to a different naming scheme to be safe
      34858825
  6. 03 3月, 2014 3 次提交
    • J
      CoreAudio: Don't reconnect if no output devices · 2fd57ed7
      jp9000 提交于
      Somehow this code didn't get included with the last commit.
      2fd57ed7
    • J
      CoreAudio: Fail if no output device found · 91644fbf
      jp9000 提交于
      Also, don't have it repeat trying to reconnect if no devices are found
      91644fbf
    • J
      Split output/input audio capture sources · 9c6da6f5
      jp9000 提交于
       - Split input and output audio captures so that they're different
         sources.  This allows easier handling and enumeration of audio
         devices without having to do some sort of string processing.
      
         This way the user interface code can handle this a bit more easily,
         and so that it doesn't confuse users either.  This should be done for
         all audio capture sources for all operating systems.  You don't have
         to duplicate any code, you just need to create input/output wrapper
         functions to designate the audio as input or output before creation.
      
       - Make it detect soundflower and wavtap devices as mac "output" devices
         (even though they're actually input) for the mac output capture, and
         make it so that users can select a default output capture and
         automatically use soundflower or wavtap.
      
         I'm not entirely happy about having to do this, but because mac is
         designed this way, this is really the only way to handle it that
         makes it easier for users and UI code to deal with.
      
         Note that soundflower and wavtap are still also designated as input
         devices, so will still show up in input device enumeration.
      
       - Remove pragma messages because they were kind polluting the other
         compiler messages and just getting in the way.  In the future we can
         just do a grep for TODO to find them.
      
       - Redo list property again, this time using a safer internal array,
         rather than requiring sketchy array inputs.  Having functions handle
         everything behind the scenes is much safer.
      
       - Remove the reference counter debug log code, as it was included
         unintentionally in a commit.
      9c6da6f5
  7. 01 3月, 2014 2 次提交
    • J
      CoreAudio: Detect default device change · f716de13
      jp9000 提交于
      If the default device changes, set the reconnect interval to 200
      milliseconds so it pretty much immediately tries to reinitialize the
      audio with the newly selected default device.  Otherwise, use 2000
      millisecond intervals, and assume disconnection.
      
      Also, reduced FFmpeg logging to just regular FFmpeg information rather
      than everything FFmpeg logs.
      f716de13
    • J
      Be more consistent about log levels · 771eac60
      jp9000 提交于
      LOG_ERROR should be used in places where though recoverable (or at least
      something that can be handled safely), was unexpected, and may affect
      the user/application.
      
      LOG_WARNING should be used in places where it's not entirely unexpected,
      is recoverable, and doesn't really affect the user/application.
      771eac60
  8. 28 2月, 2014 3 次提交
  9. 27 2月, 2014 7 次提交
    • J
      Fix audio startup (CoreAudio) · 9236b940
      jp9000 提交于
      Forgot to add a '!'.
      9236b940
    • J
      Remove redundant connect message · 9e8c0032
      jp9000 提交于
      9e8c0032
    • J
      Fix a memory leak in ca_warn (CoreAudio) · 702c364c
      jp9000 提交于
      702c364c
    • J
      Fix more failure handling for CoreAudio · 1a5220ac
      jp9000 提交于
      Actually, if initializing failed at all, it would never properly
      uninitialize because the 'initialized' variable was never set until the
      very end.  Instead, set the "initialized" flag from the beginning to
      ensure initialization.
      1a5220ac
    • J
      Fix a case where audio wouldn't free correctly · c519933e
      jp9000 提交于
      If coreaudio_start failed, it wouldn't free the audio data properly.
      Fixed that issue.
      c519933e
    • J
      Fix device disconnect detection for CoreAudio · 4c19a60e
      jp9000 提交于
      These address structures are very confusing and I wish apple designed
      better system APIs.
      4c19a60e
    • J
      Add mac audio capture · 33dc028c
      jp9000 提交于
       - Add CoreAudio device input capture for mac audio capturing.  The code
         should cover just about everything for capturing mac input device
         audio.  Because of the way mac audio is designed, users may have no
         choice but to obtain the open source soundflower software to capture
         their mac's desktop audio.  It may be necessary for us to distribute
         it with the program as well.
      
       - Hide event backend
      
       - Use win32 events for windows
      
       - Allow timed waits for events
      
       - Fix a few warnings
      33dc028c
  10. 24 2月, 2014 3 次提交
  11. 19 2月, 2014 1 次提交
    • J
      Implement automatic video scaling (if requested) · f2d4de3c
      jp9000 提交于
      Add a scaler interface (defaults to swscale), and if a separate output
      wants to use a different scale or format than the default output format,
      allow a scaler instance to be created automatically for that output,
      which will then receive the new scaled output.
      f2d4de3c
  12. 18 2月, 2014 2 次提交
  13. 17 2月, 2014 1 次提交
    • J
      Make a number of key optimizations · 2dbbffe4
      jp9000 提交于
       - Changed glMapBuffer to glMapBufferRange to allow invalidation.  Using
         just glMapBuffer alone was causing some unacceptable stalls.
      
       - Changed dynamic buffers from GL_DYNAMIC_WRITE to GL_STREAM_WRITE
         because I had misunderstood the OpenGL specification
      
       - Added _OPENGL and _D3D11 builtin preprocessor macros to effects to
         allow special processing if needed
      
       - Added fmod support to shaders (NOTE: D3D and GL do not function
         identically with negative numbers when using this.  Positive numbers
         however function identically)
      
       - Created a planar conversion shader that converts from packed YUV to
         planar 420 right on the GPU without any CPU processing.  Reduces
         required GPU download size to approximately 37.5% of its normal rate
         as well.  GPU usage down by 10 entire percentage points despite the
         extra required pass.
      2dbbffe4
  14. 15 2月, 2014 2 次提交
  15. 12 2月, 2014 1 次提交
    • J
      Revamp API and start using doxygen · 8e81d8be
      jp9000 提交于
      The API used to be designed in such a way to where it would expect
      exports for each individual source/output/encoder/etc.  You would export
      functions for each and it would automatically load those functions based
      on a specific naming scheme from the module.
      
      The idea behind this was that I wanted to limit the usage of structures
      in the API so only functions could be used.  It was an interesting idea
      in theory, but this idea turned out to be flawed in a number of ways:
      
       1.) Requiring exports to create sources/outputs/encoders/etc meant that
           you could not create them by any other means, which meant that
           things like faruton's .net plugin would become difficult.
      
       2.) Export function declarations could not be checked, therefore if you
           created a function with the wrong parameters and parameter types,
           the compiler wouldn't know how to check for that.
      
       3.) Required overly complex load functions in libobs just to handle it.
           It makes much more sense to just have a load function that you call
           manually.  Complexity is the bane of all good programs.
      
       4.) It required that you have functions of specific names, which looked
           and felt somewhat unsightly.
      
      So, to fix these issues, I replaced it with a more commonly used API
      scheme, seen commonly in places like kernels and typical C libraries
      with abstraction.  You simply create a structure that contains the
      callback definitions, and you pass it to a function to register that
      definition (such as obs_register_source), which you call in the
      obs_module_load of the module.
      
      It will also automatically check the structure size and ensure that it
      only loads the required values if the structure happened to add new
      values in an API change.
      
      The "main" source file for each module must include obs-module.h, and
      must use OBS_DECLARE_MODULE() within that source file.
      
      Also, started writing some doxygen documentation in to the main library
      headers.  Will add more detailed documentation as I go.
      8e81d8be
  16. 11 2月, 2014 1 次提交