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

49 Commits

Author SHA1 Message Date
jp9000
f53df7da64 clang-format: Apply formatting
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
2019-06-23 23:49:10 -07:00
mntone
a66ad7eb63 libobs: Use RTLD_FIRST when loading libraries on macOS
Ensures that functions loaded by `os_dlsym()` come only from the
specified library that was loaded with `os_dlopen()` rather than the set
of libraries loaded by the specified library.
2019-04-27 11:56:53 -07:00
jp9000
0e8fe8bbbc libobs/util: Add function to get executable path 2019-04-26 13:24:30 -07:00
Dmitry-Me
8df42cda8a libobs: Fix scanf type specifiers 2019-02-04 16:02:49 +03:00
Jim
b1f2b72628 Merge pull request #929 from RytoEX/nix-sysinfo
Make *nix system info logging more like Windows/Mac
2017-09-12 01:58:49 -07:00
mntone
a6318ffdca libobs/util: Add memory usage functions
Closes jp9000/obs-studio#953
2017-09-12 01:49:11 -07:00
Ryan Foster
e4a64f0efa libobs/util: Fix *nix CPU core counts
Get logical and physical CPU cores on Linux and FreeBSD, even for
multi-core CPUs.
2017-05-26 00:30:36 -04:00
jp9000
9e466a4697 libobs/util: Add function to get free disk space 2017-05-13 01:21:14 -07:00
fryshorts
0527cb5c15 libobs: Fix os_safe_replace not working linux
Make sure the target file exists before attempting to create a backup.
This will allow for the function to work correctly if the target does
not yet exist.
2017-05-08 19:24:02 +02:00
jp9000
6fc74d69a9 libobs: Add functions to get logical/physical cores 2017-05-06 11:29:27 -07:00
jp9000
651d80c0df libobs/util: Add os_safe_replace function
Allows safely/atomically replacing a file and creating a backup of the
original.  The reason for adding this function is because Microsoft
provides a ReplaceFile function which does this in a single call.
2017-05-04 18:21:51 -07:00
jp9000
4f4d7cde7e libobs/util: Add os_get_program_data_path* functions
Allows getting the system-local program data path.  Typically:

Windows:  C:\ProgramData
Mac:      /Library/Application Support
Linux:    /usr/local/share
2016-07-06 03:47:50 -07:00
jp9000
695278dd42 libobs/util: Do not append .so w/ .dylibs on OSX 2016-06-06 23:46:55 -07:00
jp9000
1c37200549 libobs/util: Check for null pointer before calling dlclose
Apparently dlclose can crash if you use it with a null pointer.
2016-05-30 16:03:01 -07:00
jp9000
d1cbb2742e libobs/util: Use SIGTRAP for os_breakpoint
SIGTRAP is the correct value to use to specify a breakpoint.
2015-11-18 18:59:54 -08:00
jp9000
fa5c477826 libobs/util: Add os_breakpoint function 2015-11-18 12:42:15 -08:00
adray
e354a433c7 libobs/util: Add function to get free space
Meant as a part of solving mantis issue 105 ("Disk space usage monitor
when recording").

From pull request: jp9000/obs-studio#374
Relevant mantis issue: https://obsproject.com/mantis/view.php?id=105
2015-10-15 01:43:23 -07:00
jp9000
d542663478 libobs/util: Add os_get_abs_path(_ptr) functions
These functions resolve the absolute path from a relative path.
2015-10-15 01:35:18 -07:00
jp9000
d78d0072a0 libobs/util: Add functions to inhibit sleep
These fucntions prevent the computer from going to sleep, hibernating,
or starting up a screen saver.

On linux, it will also attempt to use DBus to prevent gnome/kde/etc
sleep, but it's not necessarily required in order to compile the
library.  Otherwise, it will simply call "xdg-screensaver reset" once
every 30 seconds to reset the screensaver timer.
2015-09-12 22:08:05 -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
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
09b78b12de libobs/util: Add os_copyfile function
Adds a function to copy a file.  On unix-based systems, manually copies
the data with fopen/fread/fwrite/fclose.
2015-07-02 17:18:27 -07:00
jp9000
216baaf799 libobs/util: Add os_rmdir function
Adds a function to remove a directory.
2015-07-02 17:18:23 -07:00
jp9000
50f4793c99 libobs/util: Add os_rename function
Allows moving/renaming of files.
2015-07-02 17:18:15 -07:00
fryshorts
d998c16724 libobs: Remove unused include
Remove unused include as it is not available on FreeBSD and was
therefore causing a build error.
2015-05-04 21:08:17 +02:00
jp9000
82320a9ca7 (API Change) Make os_get_config_path safer to use
Changed:
  char *os_get_config_path(const char *name);

To:
  int os_get_config_path(char *dst, size_t size, const char *name);

Also added:
  char *os_get_config_path_ptr(const char *name);

I don't like this function returning an allocation by default.
Similarly to what was done with the wide character conversion functions,
this function now operates on an array argument, and if you really want
to just get a pointer for convenience, you use the *_ptr version of the
function that clearly indicates that it's returning an allocation.
2015-01-15 23:44:38 -08:00
jp9000
c9df41c1e2 (API Change) Remove pointers from all typedefs
Typedef pointers are unsafe.  If you do:
typedef struct bla *bla_t;
then you cannot use it as a constant, such as: const bla_t, because
that constant will be to the pointer itself rather than to the
underlying data.  I admit this was a fundamental mistake that must
be corrected.

All typedefs that were pointer types will now have their pointers
removed from the type itself, and the pointers will be used when they
are actually used as variables/parameters/returns instead.

This does not break ABI though, which is pretty nice.
2014-09-25 21:48:11 -07:00
Palana
571dd0f166 Add platform functions to request high performance modes
Specifically, this disables App Nap and related features
on OSX 10.9+
2014-08-24 20:32:44 +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
99d8bdcee7 Add 'glob' functions for file searching 2014-07-27 13:26:51 -07:00
jp9000
0781d86a2b Implement CPU usage monitoring functions 2014-07-04 23:03:26 -07:00
jp9000
5ba8b09c9c Add help menu with log file uploading
Added github gist API uploading to the help menu to help make problems a
bit easier to debug in the future.  It's somewhat vital that this
functionality be implemented before any release in order to analyze any
given problem a user may be experiencing.
2014-05-18 17:44:10 -07:00
jp9000
4f9e4a27d5 libobs/util: Remove dup. code, add os_opendir
Just use platform-nix.c code for general stuff that mac is compliant
with, and put a define around everything else.  Take that code out of
platform-cocoa.m.

Added os_opendir, os_readdir, and os_closedir to be able to query
available files within a directory.
2014-05-14 17:44:32 -07:00
jp9000
154e0c59e1 Use atomic functions where appropriate
Also, rename atomic functions to be consistent with the rest of the
platform/threading functions, and move atomic functions to threading*
files rather than platform* files
2014-03-16 18:26:46 -07:00
jp9000
bb92d582bf Add atomic increment/decrement platform funcs 2014-03-16 16:23:11 -07:00
jp9000
348588254c Add WASAPI audio capture
- Add WASAPI audio capture for windows, input and output

 - Check for null pointer in os_dlopen

 - Add exception-safe 'WinHandle' and 'CoTaskMemPtr' helper classes that
   will automatically call CloseHandle on handles and call CoTaskMemFree
   on certain types of memory returned from windows functions

 - Changed the wide <-> MBS/UTF8 conversion functions so that you use
   buffers (like these functions are *supposed* to behave), and changed
   the ones that allocate to a different naming scheme to be safe
2014-03-04 07:07:13 -07:00
jp9000
6c92cf5841 Implement output, improve video/audio subsystems
- Fill in the rest of the FFmpeg test output code for testing so it
   actually properly outputs data.

 - Improve the main video subsystem to be a bit more optimal and
   automatically output I420 or NV12 if needed.

 - Fix audio subsystem insertation and byte calculation.  Now it will
   seamlessly insert new audio data in to the audio stream based upon
   its timestamp value.  (Be extremely cautious when using floating
   point calculations for important things like this, and always round
   your values and check your values)

 - Use 32 byte alignment in case of future optimizations and export a
   function to get the current alignment.

 - Make os_sleepto_ns return true if slept, false if the time has
   already been passed before the call.

 - Fix sinewave output so that it actually properly calculates a middle
   C sinewave.

 - Change the use of row_bytes to linesize (also makes it a bit more
   consistent with FFmpeg's naming as well)
2014-02-09 05:51:06 -07:00
Zachary Lund
1deb27d502 Fixed os_gettime_ns to provide correct time in ns 2014-01-11 15:08:04 -06:00
Benjamin Klettbach
ab1d4588e2 Revert "Merge pull request #19 from asgeirom/master"
This reverts commit 27ccb09473, reversing
changes made to b7eccedf8a.
2014-01-06 06:29:08 +01:00
Asgeir Mortensen
c95f133fac Adding <linux/time.h> for CLOCK_REALTIME define. 2014-01-04 10:29:06 +01:00
jp9000
e9ded173f1 add my signal/callback interface from another project, also update license of utility files to ISC 1.3 2013-12-25 22:40:33 -07:00
jp9000
123ca280a0 fix unix version of os_get_config_path to make it append a slash to $HOME 2013-12-23 19:04:41 -07:00
jp9000
bb53a39aee change os_get_home_path to a better and more clear function, os_get_config_path 2013-12-23 18:59:54 -07:00
jp9000
de21e622b5 removed os_gettime_ms, added os_file_exists 2013-12-12 21:41:46 -07:00
Ján Mlynek
c37fe1fd16 added functions to platform-nix.c 2013-12-07 22:32:29 +01:00
jp9000
fcf7e508a9 added os_mkdir to platform functions 2013-11-23 23:35:03 -07:00
jp9000
8847d11e8e adjust file locations to be more portable 2013-11-01 14:33:00 -07:00