0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

479 Commits

Author SHA1 Message Date
jp9000
3f0b352d7f 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.
2014-01-10 19:21:32 -07:00
jp9000
4aa4858ac7 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)
2014-01-10 19:03:21 -07:00
jp9000
2a89306420 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.
2014-01-10 12:45:53 -07:00
jp9000
faa7f4d20e 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)
2014-01-10 11:55:54 -07:00
jp9000
f827ba38ef 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.
2014-01-09 22:10:04 -07:00
jp9000
e891b3fae8 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.
2014-01-09 22:02:11 -07:00
Zachary Lund
78aa456a7b Added comments on why some code is disabled 2014-01-09 21:04:52 -06:00
Zachary Lund
69d32725d2 Cleaned up a bit, reverted API back to normal 2014-01-09 21:04:52 -06:00
Zachary Lund
d283f24cbb 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.
2014-01-09 21:04:52 -06:00
Zachary Lund
350c34881a Reverted previous changes and added a hopeful solution for lack of window realization 2014-01-09 21:04:52 -06:00
jp9000
13fc0b536c Merge branch 'master' of https://github.com/jp9000/obs-studio 2014-01-09 19:09:40 -07:00
jp9000
6b8e84844a 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.
2014-01-09 19:08:20 -07:00
Palana
5ee0f0edd7 fix typo in obs_helper.cmake 2014-01-09 03:53:34 +01:00
Palana
351c4bfe1d add cmake plugin helpers 2014-01-09 02:37:43 +01:00
jp9000
1b555c1c17 Merge branch 'master' of https://github.com/jp9000/obs-studio 2014-01-08 18:08:50 -07:00
jp9000
21fd6cd2f5 Use recursive mutex for user sources and displays
- Using a recursive mutex fixes issues where objects need to enter the
   main libobs sources mutex while already within the mutex in the same
   thread.  Otherwise it would keep getting locked on itself on
   destruction.
2014-01-08 18:07:04 -07:00
Palana
642d0dfca7 fix osx bundle loading of required resources 2014-01-09 01:17:38 +01:00
jp9000
f3dc5227e9 Apply volume before inserting into circular buffer
- Apply the volume specified with the audio data packet before
   inserting the audio data into the circular buffer.  Added functions
   for multiplying the volume with all the different audio bit depths.
   (Could probably be greatly optmimized later)
2014-01-08 16:41:40 -07:00
jp9000
aac09ca31a Merge branch 'master' of https://github.com/jp9000/obs-studio 2014-01-07 23:22:00 -07:00
Jim
0b7497d6df Merge pull request #23 from Ceropean/master
Use XGetErrorText() instead of our own table
2014-01-07 20:18:32 -08:00
Jim
f8f3956b57 Merge pull request #24 from computerquip/master
Another attempt to fix ARB_debug_output, hopefully the last one.
2014-01-07 16:26:55 -08:00
Zachary Lund
d3dab077cb Another attempt to fix ARB_debug_output, hopefully the last one. 2014-01-07 18:24:04 -06:00
Ján Mlynek
ecadb4faae Use XGetErrorText() instead of our own table
This fixes segfaults when the error code is not in the table
2014-01-07 20:35:19 +01:00
jp9000
3838abe1f4 Implement volumes for sources
- Added a volume variable to the obs_source structure and implemented
   functions for manipulating source volume.

 - Added a volume variable to the audio_data structure so that the
   volume will be applied when mixing.
2014-01-07 11:03:15 -07:00
jp9000
4fe3c47216 Handle source adding/removal better
- 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.
2014-01-06 20:20:18 -07:00
jp9000
509a3481da Removed unnecessary sizers from forms (homeworld)
- Homeworld apparently removed a number of unnecessary sizers from the
   basic UI window form to reduce wx resize computations.
2014-01-06 20:17:54 -07:00
jp9000
bf371437b3 Fixed debug extension check
- 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.
2014-01-06 19:02:19 -07:00
jp9000
156009cc0c Fixed debug GL functions on windows (amend)
- 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.
2014-01-06 17:36:19 -07:00
Zachary Lund
8073b0ecd4 Fixed APIENTRY quirk with GLEW 2014-01-06 17:51:45 -06:00
Jim
a89a8151d5 Merge pull request #21 from computerquip/master
Various Changes to OpenGL intialization
2014-01-06 15:32:09 -08:00
jp9000
f4ebc44844 Updated VS2013 project dependencies
- Made is so that libobs is now marked as a dependency for the main
   application project 'obs'.
2014-01-06 08:50:07 -07:00
Jim
121f4a3ae9 Merge pull request #20 from benklett/time
Revert "Merge pull request #19 from asgeirom/master"
2014-01-05 21:58:20 -08:00
Zachary Lund
840c1cfd65 I removed GL-specific extension checking to a platform independent file.
I also fixed autoconf to find wxWidgets 2.9 without user intervention
Removed unused code and added more organization
2014-01-05 23:50:32 -06:00
Benjamin Klettbach
ab1d4588e2 Revert "Merge pull request #19 from asgeirom/master"
This reverts commit 27ccb09473, reversing
changes made to b7eccedf8a.
2014-01-06 06:29:08 +01:00
jp9000
e9d1d66b8a Make it so that created scenes are selected
- When a scene is created it now is automatically selected and switched
   to.
2014-01-05 21:38:28 -07:00
Zachary Lund
4aef1d00d1 Change _DEBUG coverage a bit 2014-01-05 19:55:19 -06:00
Palana
7fa7af6c03 check for signalled event before pthread_cond_wait-ing
fixes a deadlock in obs_free_video/obs_video_thread where
video_output_stop would signal the update event before obs_video_thread
enters video_output_wait (the thread calling obs_free_video would
block on pthread_join and obs_video_thread would block on
pthread_cond_wait)
2014-01-06 02:04:32 +01:00
jp9000
25acf095ab Remove from list based upon data, not string
- Added an extra comment regarding source removal

 - Made is so that when a scene item is removed from the sources list
   box, it removes the item based upon the GetClientData rather than by
   its string name.  This is done because there may be duplicate sources
   in a particular scene, and it's important to remove the right one.
2014-01-04 19:26:15 -07:00
jp9000
717a2538f4 Implement source removal via GUI
- When the remove source tool icon is clicked, it will now remove the
   source from the scene.

 - Fixed a bug where the scene item removal callback would add the scene
   item to the list instead of removing it.

 - Changed AddSourcePopup to AddSourcePopupMenu.  Name actually confused
   me once despite being the writer, so it was clearly a bad name.
2014-01-04 18:53:02 -07:00
jp9000
dcde1dcf2a Implemented adding sources to scenes via GUI
Sources can now be added to scenes via user interface.  It's a little
convoluted because everything has to work through OBS signals to ensure
that plugins/etc can modify the scenes/sources exernally.

  Also, when switching scenes, it will properly list sources for the
scene you changed to.
2014-01-04 13:53:36 -07:00
jp9000
41a73ceeea Added WX_UTF8 macro
The WX_UTF8 macro is primarily for convenience so you can input a
UTF-8 string into a wxWidgets function without having to do
wxString(string, wxConvUTF8) each time.
2014-01-04 13:50:16 -07:00
jp9000
a2a8a5f148 Added add/remove signals to scenes
Scenes will now signal via their source when an item has been added
or removed from them.

  "add" - Item added to the scene.
  Parameters:  "scene": Scene that the item was added to.
               "item":  Item that was added.

  "remove" - Item removed from the scene.
  Parameters:  "scene": Scene that the item was removed from.
               "item":  Item that was removed.
2014-01-04 13:47:48 -07:00
jp9000
968f5fed32 Added some return-style functions to calldata.h
When using signal callbacks, there is rarely a need to check to see if
the callback paramters are actually validl; in those cases, if they are
invalid, then the signal is being used incorrectly.  The calldata_get*
functions are meant to be used more for when using dynamic function
calls rather than when using signals.  The calldata_get* functions made
it so that you have to declare your varaibles, and then call that
function to assign that value to those variables, which was slightly
annoying to constantly have to do over and over.

  Therefore I created a few extra functions for returning the value
without having to check for validity.  Although you would think this
would be an issue for maintaining, keep in mind that these functions
return base types.  Admittedly, these functions are merely for
convenience.
2014-01-04 13:28:27 -07:00
Jim
27ccb09473 Merge pull request #19 from asgeirom/master
Adding <linux/time.h> for CLOCK_REALTIME define.
2014-01-04 04:28:31 -08:00
Asgeir Mortensen
c95f133fac Adding <linux/time.h> for CLOCK_REALTIME define. 2014-01-04 10:29:06 +01:00
Zachary Lund
fee0d9a8f3 Minor style fixup 2014-01-04 01:37:00 -06:00
Zachary Lund
8df5293be1 Added GLX version check and assures context is set to none on failure.
Fixed the location glewExperimental was being set to just before glewInit() (where it should be).
2014-01-04 01:29:37 -06:00
Zachary Lund
ffd80449d3 Added gl_update (does nothing for now).
Fix previous commit..
2014-01-04 00:50:40 -06:00
Zachary Lund
3dc2024c8f Remove enable statements. This should be done in platform-independent code using GLEW. 2014-01-04 00:42:23 -06:00
Zachary Lund
94f88c82cf Added OpenGL debug callback support and context changes.
1. We no longer hardcode a 3.2 profile. It chooses the latest profile that fits out description.
2. I added three tables and macros to help with the offsets compared to the variables to help reading. Read comments for more info.
3. I added glewExperimental being set. What a dumb "feature". It doesn't help anything...
2014-01-03 23:14:35 -06:00