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

932 Commits

Author SHA1 Message Date
jp9000
6bf2be407b libobs/util: Add config_remove_value function 2015-07-03 09:57:51 -07:00
jp9000
526b9e6bc1 libobs: Do not add audio hotkeys for filters 2015-07-03 09:21:43 -07:00
jp9000
4ed1ee7009 libobs: Check for removals in obs_enum_sources
Checks for removals while enumerating, which allows one to be able to
remove a source in the enumeration.
2015-07-02 17:18:43 -07:00
jp9000
5bcaa7b590 libobs/util: Do not add empty config file values
This allows config file values to defer to their defaults instead of
being null.
2015-07-02 17:18:43 -07:00
jp9000
625ecda3dc libobs/util: Add ConfigFile::Swap function
Allows swapping the internal data of two ConfigFile objects.
2015-07-02 17:18:34 -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
Palana
41689fe746 libobs: Add obs_scene_reorder_items 2015-06-28 04:10:10 +02:00
Palana
ef9090e0a3 libobs: Add obs_scene_atomic_update 2015-06-28 04:10:10 +02:00
jp9000
546b189f05 libobs: Use audio-math.h for decibel conversion 2015-06-26 03:40:28 -07:00
jp9000
c82da7da93 libobs/media-io: Add common audio math functions
This adds functions specific to audio math, which at the moment is just
converting to and from decibel and multiple.
2015-06-26 03:40:27 -07:00
jp9000
d9c7290891 libobs: Do not try to render audio-only sources 2015-06-25 15:55:27 -07:00
jp9000
71e4f3091b libobs: Add OBS_OUTPUT_UNSUPPORTED error code
This allows an output to specify that the format or track count is
unsupported.
2015-06-21 22:34:47 -07:00
jp9000
657985da94 libobs: Allow obs-encoder callback self-removal
Allows obs-encoder callbacks to remove themselves while in a callback.
2015-06-21 22:34:46 -07:00
jp9000
693962a468 libobs: Allow audio-io callback self-removal
Allows audio-io callbacks to remove themselves while in a callback.
2015-06-21 22:34:45 -07:00
jp9000
6587b18d59 libobs: Add return code to process pipe destroy 2015-06-21 22:34:44 -07:00
jp9000
43956388b2 libobs: Fix bug with process piping
The size parameter is the size of the elements, not the size of the
data.  The size parameter should be 1, and the elements should be the
number of bytes.

The reason why I'm making this change is because the fread/fwrite would
fail when the parameters were swapped.
2015-06-21 22:34:43 -07:00
Palana
0037d7c011 libobs: Ignore OSX keyboard layout notifications w/o layout change
These notifications can happen with e.g. the Japanese Kotoeri layout
when switching between active windows
2015-06-06 21:08:17 +02:00
Palana
2097224061 libobs: Move OSX keyboard layout logging
In the (unlikely) event of multiple concurrent calls to
input_method_changed it was possible that the log messages would appear
out of order with respect to which layout would actually be active
after the last log message
2015-06-06 21:08:09 +02:00
jp9000
76870d1764 libobs: Increase async jitter compensation
Due to the fact that async timestamps themselves can be susceptible to
minor jitter from certain types of inputs, increase the allowable jitter
compensation value to ensure that the rendered frame timing from async
video sources is always as close as possible to the compositor.

When the framerate of the source is the same as the framerate as the
compositor, this (combined with the fact that clamped video timing now
being used with async video frames) helps ensure that buffered async
video sources will sync up their rendering to the compositor as
accurately as possible despite jitter from the source's timestamps.

If there is no jitter in the source's timestamps then it'll always sync
up perfectly with the compositor, thanks to clamped video timing.
2015-06-04 18:05:59 -07:00
jp9000
35a35badeb libobs: Use clamped video time for async timing
When playing back buffered async frames, this reduces the probability
that new frames will be missed/skipped due to jitter in the system
timestamps.

If a buffered async source is playing at the same framerate as the
compositor and there is no jitter in the async source's timestamps, then
the async source will play back perfectly in sync with the compositor
thanks to this change, ensuring that there's no skipped or missed frames
in video playback.
2015-06-04 18:05:51 -07:00
jp9000
51dd204c6f libobs: Save clamped video time
The "clamped" video time is the system time per video frame that is
closest to the current system time, but always divisible by the frame
interval.  For example, if the last frame system timestamp was 1600 and
the new frame is 2500, but the frame interval is 800, then the
"clamped" video time is 2400.

This clamped value is useful to get the relative system time without any
jitter.
2015-06-04 18:04:23 -07:00
jp9000
7f7901b930 libobs: Reset frame cache if it gets too big
When buffering is enabled for an async video source, sometimes minor
drift in timestamps or unexpected delays to frames can cause frames to
slowly buffer more and more in memory, in some cases eventually causing
the system to run out of memory.

The circumstances in which this can happen seems to depend on both the
computer and the devices in use.  So far, the only known circumstances
in which this happens are with heavily buffered devices, such as
hauppauge, where decoding can sometimes take too long and cause
continual frame playback delay, and thus continual buffering until
memory runs out.  I've never been able to replicate it on any of my
machines however, even after hours of testing.

This patch is a precautionary measure that puts a hard limit on the
number of async frames that can be currently queued to prevent any case
where memory might continually build for whatever reason.  If it goes
over the limit, it clears the cache to reset the buffering.

I had a user with this problem test this patch with success and positive
feedback, and the intervals between buffering resets were long to where
it wasn't even noticeable while streaming/recording.

Ideally when decoding frames (such as from those devices), frame
dropping should be used to ensure playback doesn't incur extra delay,
although this sort of hard limit on the frame cache should still be
implemented regardless just as a safety precaution.  For DirectShow
encoded devices I should just switch to faruton's libff for decoding and
enable the frame dropping options.  It would probably explain why no
one's ever reported it for the media source, and pretty much only from
DirectShow device usage.
2015-06-04 17:39:03 -07:00
jp9000
a752b32b83 libobs: Add editable list property
Add an editable list property, primarily used for adding files to a
playlist for example.
2015-06-02 17:01:38 -07:00
jp9000
899557699f libobs: Add OBS_UNIX_STRUCTURE config variable
This obsconfig.h variable will be true or false depending on whether the
project is configured with the cmake UNIX_STRUCTURE variable or not.
2015-06-01 16:42:27 -07:00
Palana
4ee5c8e0f3 libobs: Fix crash on encoder initialization failure
Found via clang static analysis
2015-06-01 01:37:36 +02:00
Palana
c680b3e115 libobs/calldata: Fix unaligned loads/stores
Found via UBSan, actual errors (addresses not pruned for illustrative purposes):

"runtime error: store to misaligned address 0x7f9a9178e84c for type
'size_t' (aka 'unsigned long'), which requires 8 byte alignment"

"runtime error: load of misaligned address 0x7f9a9140f2cf for type
'size_t' (aka 'unsigned long'), which requires 8 byte alignment"
2015-05-31 04:45:54 +02:00
jp9000
dcf7ac9587 libobs: Update version to 0.10.1 2015-05-18 15:11:52 -07:00
jp9000
3a5d7b1168 libobs: Fix mouse button hotkeys on linux
The screen index returned from XDefaultScreen is 0-based, and we were
decrementing it before the check to see if it had reached 0 rather than
after, so in the default_screen function it would always end up getting
either the wrong screen or no screen.

When xcb_query_pointer and xcb_query_pointer_reply was called with no
valid screen, it would fail with an error, thus making it so that the
mouse buttons could not be properly captured as hotkeys.
2015-05-16 20:10:49 -07:00
Palana
f9eeb049fa libobs: (Re-)Move (duplicate) graphics mutex init
This probably fixes the crash from "libobs: Check effect mutex exists
before destroying it" (c2c47b1169)
2015-05-16 22:16:43 +02:00
Palana
f981b58b43 Revert "libobs: Check effect mutex exists before destroying it"
This reverts commit c2c47b1169.
2015-05-16 22:10:15 +02:00
Richard Stanway
c2c47b1169 libobs: Check effect mutex exists before destroying it
Fixes a crash if graphics system didn't finish intializing.
2015-05-16 18:44:25 +02:00
jp9000
782a5daa18 Update to 0.10.0 2015-05-12 15:37:40 -07:00
Palana
e044fcfaaa libobs: Fix saving/loading of push-to-mute settings 2015-05-12 21:36:46 +02:00
Palana
23a2228142 libobs: Add scene item hotkeys 2015-05-11 20:45:25 +02:00
Palana
7b3b083889 libobs: Add audio source hotkeys 2015-05-11 20:45:25 +02:00
Palana
1d39c3e9b6 (API Change) libobs: Add hotkey data to *_create functions 2015-05-11 20:45:25 +02:00
jp9000
d0cae31a48 libobs: Add linux hotkey implementation 2015-05-11 20:45:25 +02:00
jp9000
3fc63f83f1 libobs: Add windows hotkey implementation 2015-05-11 20:45:25 +02:00
Palana
f37e72205a libobs: Add OSX hotkey implementation 2015-05-11 20:45:24 +02:00
Palana
5ad553d06d libobs: Add global hotkey support 2015-05-11 20:45:24 +02:00
Palana
4daa5c7aa7 media-io: Fix check before passing pointer to av_freep
Found by clang-3.7 (trunk 236075) via -Wpointer-bool-conversion:

warning: address of array 'rs->output_buffer' will always evaluate
to 'true'
2015-05-11 20:42:53 +02:00
jp9000
c1e8d28548 libobs: Use exponential backoff for reconnecting
Implements exponential backoff for consecutive reconnects, which is
useful to prevent too many connections from trying to reconnect back to
a service at once over a short period of time in the case of potential
service downtime.  Exponential backoff causes each subsequent reconnect
attempt to double its timeout duration.
2015-05-10 16:07:22 -07:00
jp9000
691d3b4a73 libobs: Add timeout_sec param to reconnect signal
This optionally allows the front-end to know what the current timeout
value in seconds is set to for the reconnection without having to call
an extra API function to find that out.
2015-05-10 16:05:26 -07:00
Jim
b620bb13b5 Merge pull request #425 from fryshorts/bsd-cpu-model
libobs: Implement logging cpu model on bsd
2015-05-07 12:30:23 -07:00
Palana
0f2310a8bc libobs: Extend levels_updated signal with muted flag 2015-05-07 02:08:08 +02:00
Palana
4d40c5c853 libobs: Extend audio_data signal with muted flag 2015-05-07 02:08:08 +02:00
Palana
71abed387f (API Change) libobs: Make obs_service refcounted 2015-05-07 02:08:05 +02:00
Palana
ba0b8eb0e1 (API Change) libobs: Make obs_encoder refcounted 2015-05-07 02:07:56 +02:00