0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

987 Commits

Author SHA1 Message Date
jp9000
dd9107dbd8 libobs: Don't return valid obs_data if json fails
If obs_data_create_from_json fails on loading the json data, do not
return a valid data object; return NULL instead.
2015-08-21 17:45:03 -07:00
jp9000
f29431d8db libobs/util: Add config_save_safe function
This safely saves a configuration file, optionally with a backup.
2015-08-21 17:42:24 -07:00
jp9000
3a77ac3516 libobs/util: Add os_quick_write_utf8_file_safe
This helper function saves to a temporary file first, (optionally) backs
up the original file, then renames the temporary file to the actual file
name.  This helps reduce the chance of file corruption under various
circumstances (such as shutdown or crash while the file is being written
to disk).
2015-08-21 17:31:23 -07:00
jp9000
0d30d1229f libobs: Add API func to get module config path
Allows the ability to get a module-specific configuration file/path
2015-08-19 12:16:21 -07:00
jp9000
2bd8ab7c09 (API Change) libobs: Add global module config path
API Changed:
---------------------------
From:
- bool obs_startup(const char *locale, profiler_name_store_t *store);

To:
- bool obs_startup(const char *locale, const char *module_config_path,
		profiler_name_store_t *store);

Summary:
---------------------------
This allows plugin modules to store plugin-specific configuration data
(rather than only allowing objects to store configuration data).  This
will be useful for things like caching data, for example looking up and
storing ingests from remote (rather than storing locally), or caching
font data (so it doesn't have to build a font cache each time), among
other things.

Also adds a module-specific directory for the UI
2015-08-19 12:16:20 -07:00
jp9000
cd222f8ce0 libobs/util: Fix character encoding issue
Manually specifies the UTF-8 character codes used by the file rather
than relying on the compiler to determine what the codes are manually.
I was getting compile errors due to the fact that my current code page
is not at the default code page; so visual c++ tried to use my current
code page rather than UTF-8 and it would cause an error on the file.
2015-08-19 11:56:17 -07:00
jp9000
1afd32e70b libobs: Update version to 0.11.4 2015-08-16 15:04:15 -07:00
jp9000
6bd4f27fe9 libobs: Fix issue with getting the module data dir
When getting a blank module data file (indicating you want to get the
path to the module data directory itself), on certain operating systems
(windows) it will fail if you end the path with '/' or '\'.  So simply
make sure that if a blank module sub-path is used, don't try to append a
slash.
2015-08-16 13:40:37 -07:00
jp9000
d53cef47ac libobs: Add obs_data_create_from_json_file func
Just a little helper function that allows you to create an obs_data_t
object from a json file (rather than having to manually open it each
time and then call obs_data_create_from_json on the file data)
2015-08-16 06:43:43 -07:00
Palana
bf2df49d71 libobs: Prevent registering (potentially) unsupported plugins
The rationale for rejecting these register calls is that these functions
may be required for the plugin to work properly, which can't be
guaranteed when libobs doesn't know about them.

This behavior may be revisited once the plugin manager is implemented,
to e.g. make it configurable (potentially per plugin) to allow loading
newer plugins in case they are known to work with the older libobs
2015-08-13 16:31:03 +02:00
Palana
a26afbb9ae libobs: Prevent out of bound reads in obs_register_*
Previously adding new required functions would cause libobs to read out
of bounds in plugins not built with the new additions
2015-08-13 16:12:56 +02:00
Palana
5eb330276c libobs: Reformat required function error message 2015-08-13 15:24:41 +02:00
Palana
13b2469d61 libobs/util: Extend profiler csv export data
The id and parent_id fields should now allow better recovery of the
actual call trees, though they aren't compatible between different data
dumps in a single profiler session anymore; for that reason the new
fields name_id and parent_name_id are introduced, they hold the old id
and parent_id values respectively
2015-08-13 11:57:42 +02:00
Palana
91ea844333 libobs/util: Add compressed profiler snapshot saving 2015-08-12 15:30:30 +02:00
Palana
c6140b4756 libobs/media-io: Profile audio/video_thread 2015-08-12 15:30:29 +02:00
Palana
cf6b75e067 libobs: Add profiler calls 2015-08-12 15:30:29 +02:00
Palana
44b5afbd07 (API Change) libobs: Add profile_name_store_t parameter to obs_startup
Due to all the threads in libobs it wouldn't be safe to make that
parameter reconfigurable after libobs is initialized without adding
even more synchronization. On the other hand, adding a function to set
the name store before calling obs_startup would solve the problem of
passing a name store into libobs, but it can lead to more complicated
semantics for obs_get_profiler_name_store (e.g., should it always return
the current name store even if libobs isn't initialized until someone
calls set_name_store(NULL)? should obs_shutdown call
set_name_store(NULL)? Passing it as obs_startup parameter avoids
these (and hopefully other) potential misunderstandings
2015-08-12 15:30:29 +02:00
Palana
d9cf5c668b libobs/util: Add profiler 2015-08-12 15:30:28 +02:00
Palana
7187c1b6d4 libobs: Move video_sleep call 2015-08-12 15:30:27 +02:00
jp9000
0685279892 libobs: Update version to 0.11.3 2015-08-07 21:28:47 -07:00
jp9000
6dfb59572f libobs: Remove windowless context #error 2015-08-05 01:07:10 -07:00
jp9000
b89ea47b96 (API Change) libobs: Remove main window funcs/vars
(Non-compiling commit: windowless-context branch)

API Changed:
---------------------
Removed functions:
- obs_add_draw_callback
- obs_remove_draw_callback
- obs_resize
- obs_preview_set_enabled
- obs_preview_enabled

Removed member variables from struct obs_video_info:
- window_width
- window_height
- window

Summary:
---------------------
Changes the core libobs API to not be dependent upon a main window/view.
If you wish to draw to a window/view, use an obs_display object to
handle it.

This allows the use of libobs without requiring a window to be present
on the system.  This is also prunes code that had to be needlessly
duplicated to handle the "main" window.
2015-08-05 01:07:09 -07:00
jp9000
cf9f21e422 (API Change) libobs/graphics: Change gs_create param
(Non-compiling commit: windowless-context branch)

Changes API from:
---------------------
EXPORT int gs_create(graphics_t **graphics, const char *module,
		const struct gs_init_data *data);

To:
---------------------
EXPORT int gs_create(graphics_t **graphics, const char *module,
		uint32_t adapter);

Summary:
---------------------
Changes the gs_create function to use an adapter parameter instead of
requiring a gs_init_data with window/color/etc information.
2015-08-05 01:07:08 -07:00
jp9000
358eb56228 libobs: Add windowless context #error
Intentionally breaks compilation when trying to compile the specific
merged commits within the windowless-context branch.  This is meant to
be used in conjunction with a merge commit so that bisecting will never
see any non-compiling commits.
2015-08-05 01:07:03 -07:00
kc5nra
3b2b7f2f37 libobs: Remove flag check when resetting timestamp
Removes obsolete check when resetting a timestamp as some sources
can register for Audio/Video async yet only output audio frames.
2015-08-02 15:54:10 -05:00
jp9000
0fb79a4733 libobs: Use get_win_ver (not GetVersionEx) 2015-08-01 14:51:22 -07:00
jp9000
ef332ab8b6 libobs: Add function to get the windows version
Microsoft basically deprecated GetVersion/GetVersionEx, so now you have
to query the file version of kernel32.dll in order to get the actual
windows version.  Because of the steps involved in getting the windows
version are fairly complicated, this is an exported libobs helper
function that can be used to get the windows version if needed.
(Microsoft does have its own set of helper functions for this but the
API feels a bit..  awkward, and you can't actually get the real windows
version with them)
2015-08-01 14:51:21 -07:00
jp9000
9a93e4b859 libobs: Add platform-specific headers to cmake 2015-08-01 14:51:20 -07:00
jp9000
df2242b6aa libobs: Add OBSContext class to obs.hpp
This is just a data-less class that simply calls
obs_startup/obs_shutdown automatically.
2015-07-30 18:49:06 -07:00
jp9000
378b46b7b7 libobs: Update version to 0.11.2 2015-07-27 16:08:44 -07:00
Anthony Catel
ffb3ca4595 libobs: Use one copy for RGBA output when possible
A minor optimization: in copy_rgbx_frame (used when libobs is set to
output RGBA frames instead of YUV frames), if the line sizes for the
source and destination match, just use a single memcpy call for all of
the data instead of multiple memcpy calls.
2015-07-24 10:42:44 -07:00
Palana
4a22f314d6 libobs/graphics: Fix printf format warning
Added cast to unsigned and the assert because microsoft's compiler
doesn't support "%zu"

Actual warning:
libobs/graphics/effect-parser.c:1387:4: warning: format specifies type
'unsigned int' but the argument has type 'size_t' (aka 'unsigned long')
[-Wformat]
2015-07-19 06:30:35 +02:00
Palana
95e19cb7ba libobs/util: Reduce allocations in dstr_vcatf 2015-07-19 06:30:35 +02:00
Palana
14b27a4cc7 libobs/util: Add format string diagnostics for dstr_(cat|print)f 2015-07-19 06:30:34 +02:00
jp9000
c87d3b1f12 cmake: Rename FindFFMpeg to FindFFmpeg
This was sort of driving me crazy: The 'm' in FFmpeg isn't supposed to
be capitalized.
2015-07-18 16:32:26 -07:00
jp9000
c53f4f2f45 libobs: Fix bug with a win8 log message
I unintentionally stored the windows version in a 16bit format rather
than an 8bit format.
2015-07-16 15:45:20 -07:00
jp9000
d7d44a92ff libobs/util: Load win. module deps from same dir
Certain plugins/modules that are loaded on windows may be dependent on
libraries that are located in the same directory as the module in
question.  This makes is so that LoadLibrary will also search for
dependent libraries for that module in the module's directory.
2015-07-16 13:33:34 -07:00
jp9000
5c0f4546ea libobs/util: Add functions to get/set the cwd
Adds functions to get or set the current working directory.
2015-07-16 01:32:16 -07:00
jp9000
7bd5147074 libobs: Fix module search to ignore . and ..
When globbing for modules, the intent was to ignore the . and ..
directories that might also be included in the glob search.  It was
mistakenly doing a string compare on the 'path' variable which contains
the full path, rather than the 'file' variable which just contains the
found file itself, so the string compare always failed.
2015-07-16 01:32:15 -07:00
jp9000
5d33c777c2 libobs/util: Add macro to specify arch. bits 2015-07-16 01:32:13 -07:00
jp9000
8472857521 libobs: Fix warning from mingw 2015-07-11 14:26:48 -07:00
jp9000
9f96e691ae libobs: Add API to get encoder sample rate
In case the encoder has to use a different sample rate (due to the
sample rate being unsupported), we need an API function for the encoder
to get the sample rate that the encoder is actually running at.
2015-07-09 10:42:09 -07:00
jp9000
6fca7c4ccf libobs: Update version to 0.11.1 2015-07-09 09:31:12 -07:00
jp9000
91bfb53ed5 libobs: Fix audio filters killing video on source
When an audio filter is applied to a video source that also has
accompanying audio, it would cause the video from the source to stop
rendering.

The original code this was from was to prevent audio-only sources from
rendering video, but I neglected to make sure that this would not apply
to filters, and thus when an audio filter is on a source with video, the
code would kill the video.
2015-07-09 02:05:09 -07:00
Palana
231dfbd975 libobs/util: Make os_sleepto_ns more accurate on windows 2015-07-09 02:42:38 +02:00
jp9000
847b3df322 libobs/util: Add os_mkdirs
Recursively creates a directory structure if one or more directories in
the path structure don't exist
2015-07-08 10:00:33 -07:00
jp9000
bf37258469 libobs/util: Allow ability to get base config path
This allows you to for example, get your base home directory or base
%appdata% directory.
2015-07-08 09:21:18 -07:00
Carl Fürstenberg
ba02e065fe libobs: Add XDG config directory support
Adding XDG Base Directory Specification support for config dir

http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Closes jp9000/obs-studio#348
2015-07-08 09:10:53 -07:00
Carl Fürstenberg
cf8c096f2e libobs: Set sane write permissions on directories
Prevent setting global writable permissions on newly created
directories.
2015-07-08 08:11:14 -07:00
jp9000
2dfed30509 libobs: Update to 0.11.0 2015-07-08 00:14:21 -07:00