Commit Graph

543 Commits (ad5e147da2c53f3a0688dd5b97f2ff03a7ccd9c2)

Author SHA1 Message Date
fryshorts ad5e147da2 fixed build problems with older ffmpeg versions
changed includes to not use ffmpeg internal headers
2014-02-15 17:32:33 +01:00
jp9000 1570fa75b9 Fix variable placement, not safe with goto usage 2014-02-14 18:23:21 -07:00
jp9000 30af7dc211 Optimize GL staging surface and fix mac issue
Staging surfaces with GL originally copied to a texture and then
downloaded that copied texture, but I realized that there was really no
real need to do that.  Now instead they'll copy directly from the
texture that's given to them rather than copying to a buffer first.

Secondly, hopefully fix the mac issue where the only way to perform an
asynchronous texture download is via FBOs and glReadPixels.  It's a
really dumb issue with macs and the amount of "gotchas" and non-standard
internal GL functionaly on mac is really annoying.
2014-02-14 18:13:25 -07:00
jp9000 1ed146f6aa Fix bug with linux build
...Screw it.  %llu it is.
2014-02-14 16:12:45 -07:00
jp9000 971faf09d5 Fix inttypes.h usage
...I neglected to put a '%' character before using the PRI* macros.
2014-02-14 16:05:52 -07:00
jp9000 8b8217f68e Fix a some more linux/GCC specific warnings 2014-02-14 15:56:01 -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 4bc282f5e9 Rename obs_viewport to obs_view
I felt like the name could cause a bit of confusion with typical
graphics viewports, so I just changed it to view instead.
2014-02-13 10:21:16 -07:00
jp9000 9a63ff462a Added more paths to gitignore for building 2014-02-13 09:12:27 -07:00
jp9000 515f44be8e Revamp rendering system to allow custom rendering
Originally, the rendering system was designed to only display sources
and such, but I realized there would be a flaw; if you wanted to render
the main viewport in a custom way, or maybe even the entire application
as a graphics-based front end, you wouldn't have been able to do that.

Displays have now been separated in to viewports and displays.  A
viewport is used to store and draw sources, a display is used to handle
draw callbacks.  You can even use displays without using viewports to
draw custom render displays containing graphics calls if you wish, but
usually they would be used in combination with source viewports at
least.

This requires a tiny bit more work to create simple source displays, but
in the end its worth it for the added flexibility and options it brings.
2014-02-13 08:58:31 -07:00
jp9000 88519f0889 Add a bit more documentation
- Add bit more documentation to some of the main headers

- Fix alignment for the size of the name string of a obs_data_item.
2014-02-13 05:27:35 -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 526f8d4b61 Move enum obs_source_type to obs-source.h 2014-02-12 12:57:51 -07:00
jp9000 05b936e527 Make some admends to obs-source.h documentation 2014-02-12 08:38:49 -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 524ff94912 Move alignment code to obs_reset_video
It wasn't properly being set for the graphics textures as well, so it
would end up causing SSE to crash due to alignment
2014-02-11 05:12:36 -07:00
jp9000 6346662f19 I shouldn't have committed before compiling
Note to self - compile before committing.
2014-02-11 04:24:41 -07:00
jp9000 0a9440afdf Align output width to 16 byte alignment
The 444->420 conversion function will crash if you don't align the
output width to a 16 byte boundry.
2014-02-11 04:19:34 -07:00
jp9000 c38a10dac5 Fix memory leak in OSX test code 2014-02-10 09:49:29 -08:00
jp9000 d4ad1d5c10 Use AVI instead of MP4 for testing
The codecs used for AVI seem to have less of an impact than the MP4
codecs at the moment.
2014-02-10 10:37:47 -07:00
jp9000 1b8bd57dac Do test recording to a specified file
It will now output to a a filename that you specify when you click the
record button.  This is just for testing.
2014-02-10 10:22:35 -07:00
jp9000 590a486343 Updated cmake files for ffmpeg plugin
Also, fixed an enum name issue.  No clue why visual
studio actually compiled that without warnings/errors
2014-02-10 07:14:51 -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 6ffcd5e74e Implement FBO blit texture copy
This trick uses FBOs to allow for copying textures without the need for
special texture copy functions.
2014-02-09 11:37:22 -07:00
jp9000 9879eead83 Fix a couple of warnings 2014-02-09 08:53:19 -08:00
jp9000 8aa2b01eb9 Fix __attribute__ usage
Requires two sets of parentheses, not one.  ...I think
2014-02-09 08:10:53 -07:00
jp9000 29fb9cc9f4 Fix FORCE_INLINE macro
Accidentally put the code within a _MSC_VER #ifdef, causing the macro to
not be found on non-VC compilers
2014-02-09 08:06:34 -07:00
jp9000 20fd2c82dc Fix UTF-8 signature detection
The signature detection code when reading UTF-8 files was causing the
UTF-8 strings read from file to allocate more data than they were
supposed to, causing the last 3 bytes to be garbage
2014-02-09 08:01:08 -07:00
jp9000 4be4dd735e Use force inlining of YUV conversion functions
Force inling of the 444->420 conversion functions because their CPU
usage goes up pretty heavily without it when compiling without
optimizations
2014-02-09 07:59:00 -07:00
jp9000 e4921074c1 Fix texture_setimage
Was mapping the data without unmapping the data, causing the data to
become locked
2014-02-09 06:24:21 -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
Zachary Lund 4461281a3b Merge branch 'master' of https://github.com/jp9000/obs-studio 2014-02-08 16:02:44 -06:00
Zachary Lund cd9c4b39d0 We only really require GLX 1.3. Also fixed version check to be more appropriate. 2014-02-08 02:52:55 -06: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
Zachary Lund 9a2b662935 Changed version checks... I got most of them wrong. 2014-02-06 17:49:12 -06:00
Zachary Lund 11c40ba6cd Minor adjustment to code. ARB version of debug_output doesn't use GL_DEBUG_OUTPUT 2014-02-06 01:57:14 -06:00
Zachary Lund 72c156f549 Corrected a version check which caused crashes on non-4.3 profiles. 2014-02-06 01:41:55 -06:00
Zachary Lund fe1adfceec Broke Windows, here's a fix. 2014-02-06 01:29:07 -06:00
Zachary Lund 5c3b56807a Fixed gl-subsystem.c to reflect changes to GL loader API. 2014-02-06 00:25:15 -06:00
Zachary Lund 019d8d83ee Messed with GL loader some more.
I've branched well off of upstream glloadgen since they don't appear to be very active in between GL versions.

1) Changed how the address finder functions are set to be more sane.
2) Added *all* possible extensions. For the lulz.
3) Fixed a retarded bug in IsVersionGEQ.
4) Slapped myself for not seeing IsVersionGEQ bug earlier. Most important change.
2014-02-06 00:20:03 -06:00
jp9000 021d9522ea Eliminate more trailing whitespace from gl-x11.c 2014-02-05 21:33:55 -07:00
jp9000 8219a64958 Remove trailing whitespace from gl-x11.c (OCD) 2014-02-05 21:31:03 -07:00
jp9000 89cfbdc033 Improve naming scheme of libobs core structures 2014-02-05 21:03:06 -07:00
jp9000 ab4ab95790 Implement output scaling/conversion/downloading
- Implement texture scaling/conversion/downloading for the main view so
  we can finally start getting data to output.

  Also, redesign how it works a bit, it will now properly wait one full
  frame for each step in the process:  rendering the main texture,
  scaling the main texture to an output texture, staging/downloading the
  ouput texture, and then outputting that staged data.  This way, the
  GPU will have more than enough time to fully complete each step.

- Fix a bug with OpenGL plugin's texture staging function.  Was using
  glBindBuffer instead of what should have been used:  glBindTexture.

- Change the naming scheme of the variables in default.effect.  It's now
  named with the idea of just "color matrix" in mind instead of "yuv
  matrix", and instead of DrawRGBToYUV, it's now just DrawMatrix.
2014-02-05 20:36:21 -07:00
Palana 4867644776 Add wrappers for obs_data_t and obs_data_array_t 2014-02-03 05:39:25 +01:00
Palana a2cd42abf0 Remove external ref count visibilty from obs_data_* as well 2014-02-03 05:39:25 +01:00
Palana 935fa62db6 Add missing return type to function 2014-02-03 05:39:25 +01:00
jp9000 cc9b7ae6c5 Remove m4 directory (No longer in use) 2014-02-02 18:38:07 -07:00
Palana ac23df500a Remove external ref count visibility
The returned ref count was never used and the returned value doesn't
actually confer any meaning in a multithreaded environment
2014-02-03 02:34:06 +01:00