Commit Graph

19 Commits (c6712ab46256075e4cde6e6fa1e79fcf93250501)

Author SHA1 Message Date
Palana 7f3d61a35d Fix an issue with display capture shutdown
Holding the lock in destroy_display_stream can result in a deadlock in
display_stream_update since cb4595e512
2014-05-14 20:50:31 +02:00
Palana 29c74efba6 Add log message for dropped display stream frames 2014-05-11 21:47:34 +02:00
Palana cb4595e512 Reduce lock holding time for display stream and guarantee update
With the previous locking strategy some display captures would sometimes
not process multiple frames in a row if multiple display captures were
active
2014-05-11 21:43:32 +02:00
Palana d1b2596b67 Move display stream update handler logic out of init_display_stream 2014-05-11 21:14:40 +02:00
Palana 626addd08b Move display capture texture update to video_tick 2014-05-11 21:10:40 +02:00
Palana 8e3d2ebbdd Allow hiding the cursor for Display Capture 2014-04-16 17:23:08 +02:00
Palana 785d81ffe2 Fix #66 Display Capture for HiDPI displays
kCGDisplayStreamSourceRect takes points rather than pixels
2014-04-16 17:21:57 +02:00
Palana e378ec8e4f Properly bridge CF object so ARC can deal with it 2014-04-14 23:02:53 +02:00
jp9000 1bca7e0a3e Improve properties API
Improve the properties API so that it can actually respond somewhat to
user input.  Maybe later this might be further improved or replaced with
something script-based.

When creating a property, you can now add a callback to that property
that notifies when the property has been changed in the user interface.
Return true if you want the properties to be refreshed, or false if not.
Though now that I think about it I doubt there would ever be a case
where you would have this callback and *not* refresh the properties.

Regardless, this allows functions to change the values of properties or
settings, or enable/disable/hide other property controls from view
dynamically.
2014-04-04 00:30:37 -07:00
Palana a439177a58 Release IOSurface only after it is no longer in use (e.g. by a texture) 2014-03-26 01:24:54 +01:00
Palana 7707773f7c Add properties to osx display capture
Also add support for capturing displays that are not the main display as
preparation for moving the code from test-plugins into a proper plugin
in the future
2014-03-23 21:06:24 +01: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 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
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 4fd4b12c84 Add example monitor capture for OSX (need to clean up (CMake) files) 2014-01-17 02:38:35 +01:00