Commit Graph

594 Commits (59f2a6ac5a6911a9c3300ce432cc269cb8e18b1c)

Author SHA1 Message Date
jp9000 e42af67128 (API Change) Split obs_source_gettype
Changed:
- obs_source_gettype
To:
- enum obs_source_type obs_source_get_type(obs_source_t source);
- const char *obs_source_get_id(obs_source_t source);

This function was inconsistent for a number of reasons.  First, it
returns both the ID and the type of source (input/transition/filter),
which is inconsistent with the name of "get type".  Secondly, the
'squishy' naming convention which has just turned out to be bad
practice and causes inconsistencies.  So it's now replaced with two
functions that just return the type and the ID.
2014-08-08 11:04:44 -07:00
jp9000 0961af6e66 (API Change) Rename source_audio structure
Rename source_audio to obs_source_audio to make it more consistent with
the rest of the API
2014-08-08 11:04:44 -07:00
jp9000 45eec06891 (API Change) Rename filtered_audio structure
Reanmed filtered_audio to obs_audio_data, to improve the naming and
prefix with obs_ for the sake with consistency with the rest of the API
2014-08-08 11:04:44 -07:00
jp9000 4d1272e6e2 (API Change) Rename allow_direct_render enum
For the sake of consistency, changed allow_direct_render to
obs_allow_direct_render
2014-08-08 11:04:43 -07:00
jp9000 d2b4f82637 (API Change) Rename order_movement
Prefix with obs_ for the sake of consistency

Renamed enums:
- order_movement (now obs_order_movement)

Affected functions:
- obs_source_filter_setorder
- obs_sceneitem_setorder
2014-08-08 11:04:43 -07:00
jp9000 4122a5b9b5 (API Change) Rename 'source_frame' + related
For the sake of naming consistency with the rest of obs.h, prefix this
structure and associated functions with obs_.

Renamed structures:
- struct source_frame (now obs_source_frame)

Renamed functions:
- source_frame_init (now obs_source_frame_init)
- source_frame_free (now obs_source_frame_free)
- source_frame_create (now obs_source_frame_create)
- source_frame_destroy (now obs_source_frame_destroy)

Affected functions:
- obs_source_output_video
- obs_source_get_frame
- obs_source_release_frame
2014-08-08 11:04:42 -07:00
jp9000 7b402245dc (API Change) Rename obs_source_get(/release)frame
Renamed functions:
- obs_source_getframe (rename to obs_source_get_frame)
- obs_source_releaseframe (rename to obs_source_release_frame)

For the sake of consistency and helping to get rid of the "squishy
function name" issue
2014-08-08 11:04:42 -07:00
jp9000 24bd82a09c (API Change) Rename obs_sceneitem_info structure
Change obs_sceneitem_info structure to obs_transform_info - this
structure will not just be used with scene items in the future.
2014-08-08 11:04:42 -07:00
jp9000 2f21e2a450 Remove duplicate 'strref_isempty' 2014-08-08 10:50:37 -07:00
jp9000 84c7e665bd Fix function typo (obs_data_get_autoselect_bool) 2014-08-05 11:01:45 -07:00
jp9000 b203f36130 Fix automatic scaling bug
The bug here is that when conversion is active, the source video frame
is initialized with the destination height/width/format instead of the
source height/width/format.
2014-08-01 09:37:44 -07:00
Palana 1abde3d476 Preserve source data for sources with unknown source ids 2014-07-29 20:06:36 +02:00
Palana e123c9c062 Clarify source creation error message 2014-07-29 17:11:49 +02:00
jp9000 53aa0a60d5 Check for duplicate sources/outputs/encoders/etc
With the recent change to module handling by BtbN, I felt that having
this information might be useful in case someone is actually using make
install to set up their libraries.
2014-07-28 16:15:09 -07:00
jp9000 cd2c75a05d Rename get_encoder_info for consistency
Sources/Outputs/Services all use a find_* naming scheme, so it felt out
of place for the encoder to use a different naming scheme.
2014-07-28 16:13:04 -07:00
jp9000 e87ed914f8 Add API functions to get information about modules 2014-07-27 17:29:11 -07:00
jp9000 892fdea83e Remove macro to free locale
This functionality can now be handled automatically because locale can
now be freed seaparately from obs_module_unload with
obs_module_free_locale, which is called automatically when the module is
being freed.
2014-07-27 17:29:10 -07:00
jp9000 f0ac19abba Remove version parameter from obs_module_load
Replaced by obs_get_version() API
2014-07-27 17:29:10 -07:00
jp9000 59ea3becf2 (API Change) Refactor module handling
Changed API:
- char *obs_find_plugin_file(const char *sub_path);

  Changed to: char *obs_module_file(const char *file);

  Cahnge it so you no longer need to specify a sub-path such as:
  obs_find_plugin_file("module_name/file.ext")

  Instead, now automatically handle the module data path so all you need
  to do is:
  obs_module_file("file.ext")

- int obs_load_module(const char *name);

  Changed to: int obs_open_module(obs_module_t *module,
                                  const char *path,
                                  const char *data_path);
              bool obs_init_module(obs_module_t module);

  Change the module loading API so that if the front-end chooses, it can
  load modules directly from a specified path, and associate a data
  directory with it on the spot.

  The module will not be initialized immediately; obs_init_module must
  be called on the module pointer in order to fully initialize the
  module.  This is done so a module can be disabled by the front-end if
  the it so chooses.

New API:
- void obs_add_module_path(const char *bin, const char *data);

  These functions allow you to specify new module search paths to add,
  and allow you to search through them, or optionally just load all
  modules from them.  If the string %module% is included, it will
  replace it with the module's name when that string is used as a
  lookup.  Data paths are now directly added to the module's internal
  storage structure, and when obs_find_module_file is used, it will look
  up the pointer to the obs_module structure and get its data directory
  that way.

  Example:
  obs_add_module_path("/opt/obs/my-modules/%module%/bin",
                      "/opt/obs/my-modules/%module%/data");

  This would cause it to additionally look for the binary of a
  hypthetical module named "foo" at /opt/obs/my-modules/foo/bin/foo.so
  (or libfoo.so), and then look for the data in
  /opt/obs/my-modules/foo/data.

  This gives the front-end more flexibility for handling third-party
  plugin modules, or handling all plugin modules in a custom way.

- void obs_find_modules(obs_find_module_callback_t callback, void
                        *param);

  This searches the existing paths for modules and calls the callback
  function when any are found.  Useful for plugin management and custom
  handling of the paths by the front-end if desired.

- void obs_load_all_modules(void);

  Search through the paths and both loads and initializes all modules
  automatically without custom handling.

- void obs_enum_modules(obs_enum_module_callback_t callback,
                        void *param);

  Enumerates currently opened modules.
2014-07-27 17:29:10 -07:00
jp9000 c2a0b9c00d Change macro to MODULE_MISSING_EXPORTS for clarity
This is a bit more clear than MODULE_FUNCTION_NOT_FOUND.
2014-07-27 17:28:35 -07:00
jp9000 16f2475046 Add functions to specify OS module extensions 2014-07-27 17:28:35 -07:00
BtbN 1098c75d34 Search for plugins without lib prefix
Fixes #213
2014-07-28 01:25:18 +02:00
jp9000 c5c8cba74d Fix incompatible pointer type warning
Well, needless to say I'm very happy this didn't end up exploding.  I'm
surprised GCC and clang let this through.
2014-07-27 14:33:37 -07:00
jp9000 ee4a93b47b Add function to get current core version
The version macro that modules use to compile versus the actual core
version that may be in use may be different, so this is a way to compare
them to check for compatibility issues later on.
2014-07-27 13:27:02 -07:00
jp9000 24afd26d5d Output total frames and percentage skipped 2014-07-27 13:26:52 -07:00
jp9000 289137d5f9 media-io: Add function for total video frames 2014-07-27 13:26:51 -07:00
jp9000 e796aba928 Set proper output length for string conversions 2014-07-27 13:26:51 -07:00
jp9000 99d8bdcee7 Add 'glob' functions for file searching 2014-07-27 13:26:51 -07:00
BtbN 8380d10805 Export plugin destination and relative prefix to obsconfig.h 2014-07-26 14:27:39 +02:00
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