Commit Graph

565 Commits (3f3a587f483358f42be11a62fcd47ca6bcaad868)

Author SHA1 Message Date
BtbN 0b7ef499c5 Add relative plugin dest obsconfig.h define 2014-07-26 14:07:14 +02:00
BtbN cac6ad1822 Move config values from the commandline to obsconfig.h 2014-07-26 14:07:14 +02:00
jp9000 3ab7d4f9fd Minor fix to formatting in call_module_load 2014-07-24 14:56:50 -07:00
jp9000 57dcf49757 Fix NULL pointer dereference with text lookups 2014-07-24 00:27:15 -07:00
jp9000 c9e225d719 Prevent loading image files with null/empty paths 2014-07-24 00:25:59 -07:00
jp9000 6d89dde0da Fix dstr_end bug (it's len - 1)
Somewhat of an embarassing fix.  Using 'len' will just return the null
terminator.
2014-07-23 20:16:37 -07:00
jp9000 dc42ac0012 Add dstr_end function to get the last character 2014-07-23 17:53:27 -07:00
Palana 77bb225910 Add OBS_TEXT_MULTILINE for text obs properties 2014-07-21 04:31:19 +02:00
jp9000 778cc2b318 (API Change) obs_reset_video: Use return codes
Changed API functions:
libobs: obs_reset_video

Before, video initialization returned a boolean, but "failed" is too
little information, if it fails due to lack of device capabilities or
bad video device parameters, the front-end needs to know that.

The OBS Basic UI has also been updated to reflect this API change.
2014-07-20 18:25:57 -07:00
jp9000 89a5bdbcf1 Add gs_device_type function
This allows a programatic way of determining the type of graphics module
currently active.
2014-07-20 16:23:03 -07:00
jp9000 a446dd74af Add gs_device_name function
This returns the name of the device, "Direct3D 11" or "OpenGL"
respectively.
2014-07-20 15:31:45 -07:00
Jim 45c58f55c1 Merge pull request #162 from fryshorts/fixes
Implement system information on linux
2014-07-18 23:54:22 -07:00
BtbN 415a698bac Add support for build time dependency copying 2014-07-19 01:38:42 +02:00
BtbN 38c2fc87aa Move all data into the subdir it belongs to
Completely removes the build dir in favor of cmake based build layouting
2014-07-19 01:38:41 +02:00
BtbN 973435cb52 Move config include path, so it works for the exported target 2014-07-17 21:32:31 +02:00
BtbN 3b26db389d Fix Jansson dependency importing 2014-07-17 18:13:25 +02:00
jp9000 5da8d14570 Fix update checck bug
Fix bug where updates for windows would check for mac updates and vise
versa.

(I am ashamed)
2014-07-17 07:03:27 -07:00
jp9000 a5a7ba4650 Update to 0.4.1 2014-07-17 06:25:37 -07:00
Palana bd2b4c91b6 libobs/media-io: Handle VIDEO_CS_DEFAULT in video_format_get_parameters 2014-07-16 22:39:00 +02:00
fryshorts 14e1549f7a Add system information for linux
This adds support for printing system information on linux.
2014-07-15 20:02:09 +02:00
fryshorts 0fa123dc47 Small coding style fixes 2014-07-15 20:01:39 +02:00
HomeWorld 6b284d9e58 Fix audio meters so that volume is applied linearly. 2014-07-14 21:12:53 +03:00
HomeWorld 336c3821fc Corrected a math mistake in obs_source.c calc_volume_levels. 2014-07-14 19:24:04 +03:00
jp9000 f801348a33 Add MAKE_SEMANTIC_VERSION macro 2014-07-13 23:55:46 -07:00
jp9000 73c7248cdb Fix 'missing braces' warning 2014-07-13 12:44:33 -07:00
jp9000 115d8da4bd Update version to 0.4.0 2014-07-13 12:38:44 -07:00
jp9000 70559b98a0 Fix bug where bmem.h wasn't always included 2014-07-13 11:34:56 -07:00
Palana 850d92bac0 libobs: Add config_has_(user|default)_value functions
Similar to obs_data_has_(user_value|default|autoselect), these allow
library users to distinguish between user config values and default
values
2014-07-13 19:10:38 +02:00
jp9000 893746f487 Log audio/video settings 2014-07-13 05:02:44 -07:00
jp9000 dde9caface Fix potentially dereferenced null pointer 2014-07-13 05:01:53 -07:00
jp9000 413641a11f Log when any libobs objects are created/destroyed 2014-07-13 05:01:02 -07:00
jp9000 322f148c9c Remove duplicate include 2014-07-13 02:59:14 -07:00
jp9000 1570e53364 Add obs_encoder_getname function 2014-07-13 02:58:55 -07:00
jp9000 0c135d9804 Remove duplicate function declaration 2014-07-13 01:21:20 -07:00
jp9000 52c0d223fd Change dstr_init_strref to dstr_init_copy_strref 2014-07-13 01:20:53 -07:00
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
jp9000 74b4743bce Remove 'locale' from properties
Having the value stored here is somewhat pointless, so this is one step
in fixing the locale handling.  Locale should be handled by the modules
themselves with their own loaded locale lookup information.
2014-06-25 12:36:26 -07:00
jp9000 899f053034 Add API for setting/getting current locale
This API is used to set the current locale for libobs, which it will set
for all modules when a module is loaded or specifically when the locale
is manually changed.
2014-06-25 12:36:17 -07:00
Palana 070f6cb6a6 Add DStr move assignment operator 2014-06-25 17:00:02 +02:00
Palana 5afedb1092 Fix DStr move constructor
Previously dstr_move would try to free the uninitialized value in
DStr::str::array
2014-06-25 17:00:01 +02:00
Palana 113454a2c8 Fix export for obs_property_list_item_remove 2014-06-25 15:29:00 +02:00
jp9000 8aa49cc9ad Remove unused graphics subsystem functions
These functions were mostly related to being able to set true fullscreen
mode -- however, this has no place for our purposes, and these functions
were just sitting empty and unused, so they should be removed.

Besides, fullscreen mode only applies to the windows operating system.
2014-06-25 01:54:32 -07:00
jp9000 f4e7a893c5 Remove 'rebuild' variable from vertexbuffer_flush
This variable is currently somewhat pointless, I was originally going to
use it to tell the graphics subsystem to completely rebuild the internal
vertex buffers, but it would be bad/inefficient to allow that
functionality.
2014-06-25 01:54:32 -07:00
Palana c2bb95250b Add obs-data autoselect functions
These are meant to reflect auto-detection configuration changes that
should not be written to the config, for example, frame rate changes
for a camera where the (user-/config-file-)configured frame rate isn't
available but a similar frame rate can be automatically chosen
2014-06-22 01:32:09 +02:00
Palana 7f172eb1b4 Change semantics of obs-data default values
Default values are now permanently stored in the obs_data_items and
can be accessed via the new get_default functions

Also default values are no longer serialized to JSON to ease transition
to new default values
2014-06-22 01:32:09 +02:00
Palana a6b52156b2 Move obs-data accessor value handling logic into static helper functions 2014-06-22 01:32:09 +02:00
Palana 7cbc260f90 Unify obs_data_set* and obs_data_item_set* funtion implementations 2014-06-22 01:32:09 +02:00
Palana 92e9284270 Refactor obs-data internals to forward reallocation results to callers 2014-06-22 01:32:09 +02:00
Palana 0d77dc702d Refactor set_item(_def) to only look up items if no item is supplied 2014-06-22 01:32:09 +02:00
Palana 23e2f623f9 Unify obs_data_set* and obs_data_set_default_* function implementations 2014-06-22 01:32:08 +02:00
Palana f29f4d8009 Unify obs_data_get* and obs_data_item_get* functions handling 2014-06-22 01:32:08 +02:00