Commit Graph

480 Commits (7de89813651d8fdc8d3aa538f400458dd6ee1546)

Author SHA1 Message Date
jp9000 a27f2fbb3a Fix potentially uninitialized variable warnings 2014-07-12 11:59:46 -07:00
jp9000 f675c8029f Fix 'unused parameter' warnings on windows 2014-07-12 11:59:07 -07:00
Palana 9e65c1af78 Log OS name and version on OSX 2014-07-12 20:33:58 +02:00
Palana 75bba68a03 Fix obs-cocoa CPU cores log output
According to http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-vol-2a-manual.html
the cores_per_package and logical_per_package returns the maximum number
of (logical) cores addressable per package instead of the actual number
of (logical) cores
2014-07-12 20:33:58 +02:00
jp9000 ad6b70e938 Add null pointer checks to platform functions
It's a sad day when I realize that I did not add any null pointer
checking to any of the functions in this file.  Discovered it while
checking all the different languages, happened when there was a missing
locale file for a certain module that hadn't had the language uploaded
yet.
2014-07-12 04:48:16 -07:00
jp9000 76ff395aed Log system information on startup 2014-07-12 00:31:42 -07:00
jp9000 aed8f54f1a libobs: Add macro for default module locale
These macros are used as easy helper functions to load/unload module
locale that's based upon the text_lookup system.  You simple place the
OBS_MODULE_USE_DEFAULT_LOCALE macro once in the module, call
OBS_MODULE_FREE_DEFAULT LOCALE in obs_module_unload, and then
call obs_module_text anywhere in your module where you need to look up
text.

By default, it will look for a locale directory in your module's data
directory, and look for language files within it (INI locale format)
2014-07-11 17:26:24 -07:00
jp9000 ac760efb57 libobs: Add function for default module locale
This function is used to simplify the process when using the default
locale handling for modules.  It will automatically search in the plugin
data directory associated with the specific module specified, load the
default locale text (for example english if its default language is
english), and then it will load the set locale on top of the default
locale, which will cause text to use the default locale if the desired
locale text is not found.
2014-07-11 17:26:23 -07:00
Jim 83c041e14f Merge pull request #152 from BtbN/cmake_fixes
Cmake fixes
2014-07-10 20:43:23 -07:00
Timo R 85fd6863e2 Fix missing initialization
Found by compiling with gcc 4.8, which shows a warning for use in the
inlined function called in that function.

Closes #155
2014-07-10 18:17:06 +02:00
BtbN d09f6dae1f Don't hardcode include directory for plugins 2014-07-10 14:38:46 +02:00
Timo R a53c75f67e Add forgotten obs.hpp header to CMakeLists 2014-07-10 14:37:50 +02:00
jp9000 6e4a79a640 libobs: Use the correct module unload function 2014-07-09 20:44:12 -07:00
jp9000 3d1c132989 Add statistics functions to outputs
Total bytes, total frames, and frames dropped.  Total frames is
generated automatically, but total bytes and total dropped frames are
returned via callbacks.
2014-07-06 17:36:44 -07:00
jp9000 64074e9fda Add counting of total video frames to outputs
Before it would assign the encoder/media callbacks directly to the
output's callbacks, so instead of doing that, it now goes through
intermediary functions for the sake of counting the frames.
2014-07-06 17:36:44 -07:00
jp9000 41f1ad32f2 Remove unused function 2014-07-05 16:16:32 -07:00
jp9000 b060d86614 If reconnecting, ignore the disconnect code
Usually if you are reconnecting after network outage, it will give a
different code (such as OBS_OUTPUT_CONNECT_FAILED).  So, if already
reconnecting, ignore the code unless it's OBS_OUTPUT_SUCCESS.
2014-07-05 15:01:10 -07:00
jp9000 0781d86a2b Implement CPU usage monitoring functions 2014-07-04 23:03:26 -07:00
jp9000 6db5458f22 Define magickcore macros to remove warnings 2014-07-04 11:34:15 -07:00
jp9000 9fc05e2a1d Set default values for blend state structure 2014-07-03 14:19:34 -07:00
jp9000 57cfd4f991 Implement function to reset blend state
I was implementing a pushing/popping attributes function like with GL,
but I realized that for our particular purposes (and actually for most
purposes) its usage was somewhat..  niche.  I may still implement
pushing/popping of attributes in the future, though right now I feel
using a function to reset the state is sufficient for our purposes.
2014-07-03 14:11:30 -07:00
jp9000 d4cf9db638 Remove unnecessary context initialization code
There was no need to call the context free function in the
initialization function, and it's safer to just initialize the memory to
0 before using (which also negates the need for da_init)
2014-07-02 21:05:46 -07:00
jp9000 87475cdf89 Add rename cache for thread safety
This just ensures that if an obs object is renamed that the pointer to
older names will still be valid.  Prevents renames from causing any
invalid memory access.

When the obs object is destroyed, so are the cached names.
2014-07-02 20:58:30 -07:00
jp9000 4f2a731acf Implement reconnecting
The core itself now provides reconnection options (enabled by default, 2
second timeout between reconnects, 20 retries max until actual
disconnection occurs).  This will make things easier for both module
developers and UI developers.

Reconnecting treats the stream as though it were still active, and
signals are sent when reconnecting and upon successful reconnection.

Need to implement user interface information for reconnections.
2014-07-02 20:39:39 -07:00
jp9000 267af930ab Add obs_output_getname
This will get the user-defined name of the output (if any)
2014-07-01 16:29:38 -07:00
jp9000 c7bb73fe07 Implement high encoder CPU usage handling
This implements the 'frame skipping' mechanism to forcibly cause frames
to be duplicated in order to reduce encoder complexity so the encoder
can catch up to the video, otherwise it will continue to be
progressively behind and will cause a desync of the video.

Typically, if a user gets this issue, they should turn down their
settings.  For the love of god do not tell them that 'frames are
skipping', just tell them that CPU usage is high, and that they should
consider turning down their settings.
2014-07-01 11:01:22 -07:00
jp9000 dc27cb2051 Add signal for renaming sources 2014-06-30 00:05:35 -07:00
jp9000 d098087b06 Set default blend function to srcalpa/invsrcalpha 2014-06-29 11:43:52 -07:00
jp9000 7e06af1aa8 Don't use swscale if format is supported 2014-06-29 10:57:20 -07:00
jp9000 f313aaa5a6 Fix bug magickcore file loading freeze
This seemed to happen if the 'file' variable was NULL.  For some reason,
magickcore would just totally freeze.
2014-06-28 18:52:13 -07:00
BtbN 17a9fcaafb Use propper ffmpeg compatiblity instead of relying on deprecated functions 2014-06-28 20:54:14 +02:00
BtbN ed9d5b1d63 Add ImageMagic/Libavcodec find logic 2014-06-28 20:37:57 +02:00
jp9000 8b0315ada6 Use older FFmpeg API functions for AVFrame
Compatibility with older FFmpeg versions may be broken if the av_frame_*
functions are used instead of the avcodec_* equivalents.
2014-06-28 11:12:25 -07:00
jp9000 bcd8d5d346 Add MagickCore image file support to the core
MagickCore is provided here as an alternative to FFmpeg in case FFmpeg
is not easily supported (for example, debian-based linux distros).

NOTE: Cmake configuration needs to be changed in order to allow
MagickCore image support.
2014-06-28 10:12:58 -07:00
jp9000 32b4d12fe3 Add FFmpeg image file support to the core 2014-06-28 10:12:58 -07:00
jp9000 4812a6130c libobs: Fill in rest of 'path' property code
A path should have a filter, default search directory, and a way to
indicate whether or not a directory or file is desired.
2014-06-28 10:12:57 -07:00
jp9000 7b12133af3 Use uint8_t* instead of void* for texture data
NOTE: In texture_setimage, I had to move variables to the top of the
scope because microsoft's C compiler will give the legacy C90 error of:
'illegal use of this type as an expression'.

To sum it up, microsoft's C compiler is still utter garbage.
2014-06-28 10:12:57 -07:00
jp9000 3af33e11b7 Fix 'potentially uninitialized' warning on var 2014-06-27 21:37:40 -07:00
jp9000 e44addccb0 Rename GS_ERROR_MODULENOTFOUND
Rename GS_ERROR_MODULENOTFOUND to GS_ERROR_MODULE_NOT_FOUND
2014-06-27 15:16:29 -07:00
jp9000 dbb9124bf6 Remove 'effect' param from effect param funcs
Similar to the shader functions, the effect parameter functions take
the effect as a parameter.  However, the effect parameter is pretty
pointless, because the effect parameter.. parameter stores the effect
pointer interally.
2014-06-25 22:24:27 -07:00
jp9000 d76c775126 Remove unused 'shader' param from effect funcs 2014-06-25 19:54:07 -07:00
jp9000 caf8ca9ba8 Remove 'shader' param from shader param functions 2014-06-25 19:50:08 -07:00
jp9000 27010a2f56 Add a 'flush' command to graphics subsystem
...I'm actually concerned that I went a bit overkill trying to prevent
backwards compatibility issues with this abstraction design, because
this is a large number of files that have to be modified just to add a
single graphics subsystem export.  Someone's going to strangle me, and
when you know that someone might strangle you, that means that you did
something wrong.  We'll have to look in to simplifying this in the
future without killing backward compatibility safety.
2014-06-25 19:32:34 -07:00
jp9000 749cff2e3a Fix device_copy_texture_region export formatting 2014-06-25 18:45:27 -07:00
jp9000 77edf6f263 Remove unused parameter for texture file loading 2014-06-25 18:34:23 -07:00
jp9000 16f45e7244 Remove unused texture file loading functions
Getting cubemaps and volume textures from file is very unlikely to ever
happen for our purposes.
2014-06-25 18:33:03 -07:00
Palana 603c87cd8f Fix b(w)strdup_n returning NULL for empty strings 2014-06-25 23:18:18 +02:00
Jim 2ea50cab36 Merge pull request #124 from jp9000/new-locale-handling
Update to new module locale API
2014-06-25 12:58:05 -07:00
jp9000 1abf91577e Add module callbacks for loading locale data
The module callback obs_module_set_locale will be called after loading
the module, and any time the locale is manually changed via core API.

When this function is called, the module is expected to load new text
lookup values for all the text it uses based upon the current locale.
2014-06-25 12:37:06 -07:00
jp9000 0b4a259e56 Remove 'locale' parameter from all callbacks
The locale parameter was a mistake, because it puts extra needless
burden upon the module developer to have to handle this variable for
each and every single callback function.  The parameter is being removed
in favor of a single centralized module callback function that
specifically updates locale information for a module only when needed.
2014-06-25 12:36:26 -07:00