Add preliminary audio processing

 - 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.
Merge branch 'master' of https://github.com/jp9000/obs-studio
Reverted previous changes and added a hopeful solution for lack of window realization
A few changes concerning wxGTK.

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.
Cleaned up a bit, reverted API back to normal
Added comments on why some code is disabled
Fixed bug with circlar buffer

 - 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.
Added a sinewave audio test source

 - 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.
Properly position position mixed audio data

 - 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)
Detect audio timestamp jumps and reset timing

 - 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.
Account for thread pauses for audio data

 - 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)
Clean up code in audio-io.c

Clean up a little bit of code that was unnecessarily nested.  Still a
little squishy but better than it was.
Fixed os_gettime_ns to provide correct time in ns
Merge pull request #25 from computerquip/upstream-merged

Various changes for wxGTK
Add copyright and name to files it applies to.
Merge pull request #26 from computerquip/upstream-merged

Add copyright and name to files it applies to.
Add preliminary handling of timestamp invalidation

- 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
Fix one minor bug with new timing code

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.