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

53 Commits

Author SHA1 Message Date
jp9000
c232ebde15 Implement a few more audio options/functions
Implement a few audio options in to the user interface as well as a few
inline audio functions in audio-io.h.

Make it so ffmpeg plugin automatically converts to the desired format.

Use regular interleaved float internally for audio instead of planar
float.
2014-02-23 16:27:19 -07:00
jp9000
966b943d5b Remove majority of warnings
There were a *lot* of warnings, managed to remove most of them.

Also, put warning flags before C_FLAGS and CXX_FLAGS, rather than after,
as -Wall -Wextra was overwriting flags that came before it.
2014-02-14 15:13:36 -07:00
jp9000
ed6acbb988 ..and the OSX test program 2014-02-12 13:05:41 -07:00
jp9000
a41d4b1c05 Fix the OSX test source
Used the wrong function name with the video_render value.  This is what
I get for not compiling it on mac first.
2014-02-12 13:01:21 -07:00
jp9000
8e81d8be56 Revamp API and start using doxygen
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.
2014-02-12 08:04:50 -07:00
jp9000
c38a10dac5 Fix memory leak in OSX test code 2014-02-10 09:49:29 -08:00
jp9000
b067440f73 Use bzalloc instead of bmalloc then memset
Reduces needless code repetition and still allows for proper memory
alignment.  Cleans up the code a bit.
2014-02-09 12:34:07 -07:00
jp9000
6c92cf5841 Implement output, improve video/audio subsystems
- Fill in the rest of the FFmpeg test output code for testing so it
   actually properly outputs data.

 - Improve the main video subsystem to be a bit more optimal and
   automatically output I420 or NV12 if needed.

 - Fix audio subsystem insertation and byte calculation.  Now it will
   seamlessly insert new audio data in to the audio stream based upon
   its timestamp value.  (Be extremely cautious when using floating
   point calculations for important things like this, and always round
   your values and check your values)

 - Use 32 byte alignment in case of future optimizations and export a
   function to get the current alignment.

 - Make os_sleepto_ns return true if slept, false if the time has
   already been passed before the call.

 - Fix sinewave output so that it actually properly calculates a middle
   C sinewave.

 - Change the use of row_bytes to linesize (also makes it a bit more
   consistent with FFmpeg's naming as well)
2014-02-09 05:51:06 -07:00
jp9000
3d6d43225f Add planar audio support, improve test output
- Add planar audio support.  FFmpeg and libav use planar audio for many
  encoders, so it was somewhat necessary to add support in libobs
  itself.

- Improve/adjust FFmpeg test output plugin.  The exports were somewhat
  messed up (making me rethink how exports should be done).  Not yet
  functional; it handles video properly, but it still does not handle
  audio properly.

- Improve planar video code.  The planar video code was not properly
  accounting for row sizes for each plane.  Specifying row sizes for
  each plane has now been added.  This will also make it more compatible
  with FFmpeg/libav.

- Fixed a bug where callbacks wouldn't create properly in audio-io and
  video-io code.

- Implement 'blogva' function to allow for va_list usage with libobs
  logging.
2014-02-07 03:03:54 -07:00
BtbN
e53825f1c3 Remove autotools files and update INSTALL file 2014-02-02 22:45:05 +01:00
Palana
13db68433d Improve multi instance support for osx desktop capture
Fixes behavior with multiple desktop captures in the same scene

Also create the dispatch_queue without a name to prevent name collisions
2014-01-29 19:42:36 +01:00
Palana
fdfd96b783 Rename osx desktop capture functions to fix dynamic loading 2014-01-28 23:14:02 +01:00
Palana
e430652d0f Add explicit Cocoa dependency for osx desktop capture test
Fixes build due to missing objective c functions on some configurations
2014-01-28 23:14:01 +01:00
jp9000
7e58fecc86 Check iosurf dependency in test-input cmake files 2014-01-28 00:06:46 -07:00
jp9000
95154f33c8 Fix cmake files for non-mac targets (broke it) 2014-01-27 23:53:44 -07:00
jp9000
0b87391ac8 Merge branch 'osx-monitor-capture' of https://github.com/jp9000/obs-studio 2014-01-27 23:39:37 -07:00
BtbN
45ec80fb7d Full rewrite of all CMakeLists
CMake now works on all platforms
2014-01-24 18:56:32 +01:00
BtbN
8fa309c96e Clean old cmake files 2014-01-24 01:46:36 +01:00
Palana
4fd4b12c84 Add example monitor capture for OSX (need to clean up (CMake) files) 2014-01-17 02:38:35 +01: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
Palana
351c4bfe1d add cmake plugin helpers 2014-01-09 02:37:43 +01:00
Zachary Lund
80b8176e29 GLX implementation and *nix-specific file handling implementation
I added gl-x11 which allows compatibility with X11 (Xlib-based) and GLX.
I also added various functions to handle file finding based on FHS.
Various changes to autotools to both install files correctly and to configure correctly.
2014-01-02 18:20:58 -06:00
jp9000
c129cc37cb update API and implement preliminary ability to add sources to scenes 2013-12-30 06:56:39 -07:00
jp9000
c4af3e2a75 change obs_scene_destroy to obs_scene_release, add ability to add scenes, fix name dialog sizing 2013-12-29 08:54:06 -07:00
jp9000
e5ef03954e added name dialog code, moved 'using namespace std;' out of headers and into source files 2013-12-29 04:40:53 -07:00
jp9000
cec94b042e implement scene adding callbacks, make a few API tweaks 2013-12-28 05:33:16 -07:00
Zachary Lund
5f5404f8cb Fixes issues with autoconf
In particular, it removes any deprecated functionality
wxWidgets only documents their deprecated m4 macros and gives a poor example
Also to note in regard to wxWidgets, I removed any unneeded libraries from the linker line.

Any warning messages provided by autoconf has been supressed in the most appropriate manner possible.
2013-12-27 16:41:01 -06:00
jp9000
922eb7b8e8 make direct filter rendering optional (can be useful for certain cases) 2013-12-22 02:03:40 -07:00
jp9000
19c4ee995e add major optimization to filter processing, and as a nice side effect, make it easier to create new filters and sources 2013-12-22 01:30:18 -07:00
jp9000
95a7da2d4c add names to sources, use 'id' for the internal source identifier names rather than 'name' 2013-12-20 17:23:19 -07:00
Palana
4939cad9e5 made osx test raii helpers more user friendly 2013-12-16 01:58:57 +01:00
Palana
a692027648 changed osx test for arc compatibility 2013-12-16 01:45:31 +01:00
Palana
003dbfef73 compile osx test with -fobjc-arc 2013-12-09 19:23:16 +01:00
Matthew McNamara
a76a5937df Updated CMakeLists with new effect file locations, added cmake & xcode build folders to gitignore 2013-12-07 21:05:31 +01:00
Palana
e6017ec1ba changed allocation counter to uint64_t
also avoids format string confusion for bnum_allocs
2013-12-07 17:39:43 +01:00
Palana
e230b0e984 updated include paths (CMake+osxtest) and function prototype (osxtest)
fixes compilation with changes from e5c99175c5
2013-11-29 20:58:29 +01:00
jp9000
e5c99175c5 fixed some build issues on non-windows systems 2013-11-26 23:07:27 -07:00
jp9000
58810f9806 changed gs_draw_sprite to allow custom sizes, added output textures to the core, and adjusted the test code to accommodate the changes 2013-11-26 22:26:14 -07:00
jp9000
409b011a8e cleaned up main internal data structure design, changed to reference counting for sources to ensure safe destruction of source objects from all parts of the system, added some service-related stuff for testing 2013-11-20 15:00:16 -07:00
Palana
ec411fe046 added cmake build files 2013-11-14 18:36:46 +01:00
Palana
d7a04aea8c added osx cocoa support files 2013-11-14 18:31:18 +01:00
jp9000
146e9a7dbd added support for jansson, added new output files, made some adjustments to the API, fixed a UI subclass issue 2013-11-13 06:24:20 -07:00
jp9000
8847d11e8e adjust file locations to be more portable 2013-11-01 14:33:00 -07:00
jp9000
a6a6118c04 finish up most of the source audio stuff and rename some variables/structs/enum to be a bit more consistent 2013-10-31 10:28:47 -07:00
jp9000
676a0bd67d update build system to autotools (finally) 2013-10-29 23:21:40 -07:00
jp9000
ab08c2c3f2 fixed a minor bug in the gl shader parser 2013-10-29 06:01:19 -07:00
jp9000
d2ba08e46b add frame flipping code 2013-10-26 15:05:51 -07:00
jp9000
18834c6a45 some static analysis cleanup 2013-10-17 17:21:42 -07:00
jp9000
dfa2dc6eab fix up the rest of the GL code, add glew to project, add makefiles for opengl, fix makefiles so that it can be built with gcc, update project files to automatically output to the build directory 2013-10-16 23:31:18 -07:00
jp9000
9570f0b8d7 change names, fix some bugs, minor GL/D3D fixes, update tests, fix effect files, output a little more debug information 2013-10-14 12:37:52 -07:00