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

1643 Commits

Author SHA1 Message Date
jp9000
d11b05a83d libobs: Defer update of scene item texture
If the scene item crop/filtering is updated, instead of
creating/destroying the item texture on the spot, update it in the
graphics thread to prevent potential race conditions (especially when
the crop function for example could be called from within
obs_scene_enum_items in some situations, which would lock the graphics
and scene mutexes in the wrong order).
2018-07-19 00:53:30 -07:00
jp9000
1aeb87ac52 libobs/util: Don't use assert for darray_push_back_array
Instead, just check to see whether array and num are valid, and if they
are not, safely return.
2018-07-18 18:47:44 -07:00
David Cooper
16e879ca51 libobs/UI: Allow Access To argc/argv
This paves the way for plugins to have access to the argc/argv used
when spawning OBS. Notably, this will allow a patch to obs-browser that
passes through command line arguments on macOS to CEF.
2018-07-18 10:39:39 -07:00
jp9000
5dfab20a46 libobs: Allow group duplication 2018-07-16 19:03:34 -07:00
jp9000
5993834815 libobs: Change groups to actual public types
(This commit also modifies UI)

Changes groups to their own independent type, "group".  This allows them
to be used like other regular types, and allows the ability to reference
groups in multiple scenes.  Before, a group would always be linked to
the scene it was in.  This made it cumbersome for users to modify groups
if they had a similar group in multiple scenes (they would have to
modify each group in each scene).  Making groups like other source types
makes more sense to solve this issue so they can be referenced in
multiple scenes at once.  This also removes a significant amount of
group-specific handling code required for implementing groups in the
front-end.

One limitation however: due to the way sub-items of groups are
seamlessly modifiable and sortable as part of the whole scene, the user
cannot have multiple references to the same group within one scene.
2018-07-16 19:01:51 -07:00
jp9000
f45247d5c8 libobs: Abstract resize_group to resize_scene_base 2018-07-15 19:01:34 -07:00
jp9000
8f786db5f2 libobs: Refactor creation of scenes
Allows using a different source type (I.E. "group" instead of "scene").
2018-07-15 19:01:28 -07:00
jp9000
35704c4c04 libobs: Remove group_sceneitem from obs_scene struct
(This commit also modifies UI)

Removes obs_scene::group_sceneitem and replaces it with
obs_scene::is_group.  Changes a number of other functions related to
groups so that a group is not inherently tied to a specific scene, and
helps allow a single group to be referenced in multiple scenes if
desired.
2018-07-15 19:01:14 -07:00
jp9000
2329c6f6ea libobs: Add obs_data_array_push_back_array
Allows easily/safely appending all the values of one data array to
another.
2018-07-15 17:09:02 -07:00
Matthew Szatmary
a8517f3698 libobs: Update libcaption library
(This commit also modifies deps/libcaption)

Closes obsproject/obs-studio#1354
2018-07-08 01:14:27 -07:00
Hunter L. Allen
e3356d5ff6 libobs: Remove unnecessary const qualifier
This function returns a char *, so it should not be const (the value is
set from a function which also returns a char *, so there is no real
reason for this to be const).
2018-07-01 12:03:31 -04:00
Hunter L. Allen
f838585b03 libobs: Remove unused variable 2018-07-01 12:03:26 -04:00
Hunter L. Allen
b797b97bf6 libobs: Remove unused variable 2018-07-01 12:03:22 -04:00
Hunter L. Allen
31ad26ac3c libobs: Fix equality check
Removes a likely unintentional self-comparison.
2018-07-01 12:03:12 -04:00
Hunter L. Allen
6766565928 libobs: Add missing return type
As declared, transform_val is static inline, but it should be marked as
a static inline void since it does not return.
2018-07-01 12:01:47 -04:00
Hunter L. Allen
f78a5426be libobs: Remove unused variable 2018-07-01 12:01:00 -04:00
Hunter L. Allen
294d32aee0 libobs: Change int to size_t
The loop increments i towards an unsigned type, so i should also be an
unsigned type.
2018-07-01 11:58:43 -04:00
Jim
f44dc16669
Merge pull request #1319 from Andersama/patch-18
libobs: prevent crash from unbounded copy and bfree
2018-06-19 17:28:42 -07:00
Alex Anderson
7ce217bbc0 libobs: prevent crash from unbounded copy and bfree
Restricts the range of the copy to count number of characters.
Changes function to strip wrapping quotes as intended.
2018-06-19 00:13:55 -07:00
Jim
8dd7024b67
Merge pull request #1325 from exeldro/copy-frame
libobs: add obs_source_frame_copy
2018-06-18 21:31:00 -07:00
Jim
1a31d9097c
Merge pull request #1318 from TheOrsa/fixMonitoringOnOSX
libobs: Fix Monitoring devices showing input devices
2018-06-17 23:02:27 -07:00
Jim
446dc9fd4b
Merge pull request #1310 from vokama/updated-hotkey-names
libobs, UI: reset hotkey description on target rename
2018-06-16 23:09:06 -07:00
Bas van Meel
1653d258fe libobs: add obs_source_frame_copy 2018-06-11 10:03:37 +02:00
Daniel Lopez
4cebbcc23b libobs: Fix compilation issue on case-sensitive filesystems
When using a macOS running on a case-sensitive filesystem, the project
build fails due to AudioToolBox/AudioQueue.h not being found.
The correct path is AudioToolbox/AudioQueue.h. Since macOS comes with a
case-insensitive filesystem by default, this is a rare ocurrence
among developers who change it to be case-sensitive.
2018-06-08 19:06:23 -05:00
Daniel Lopez
ceac83e499 libobs: Add check for cf_uid pointer free
This little change skips returning true immediately when a call to
CoreAudio fails. Instead, it uses similar behavior as further 3 calls
below this change, just checking for unfreed pointers before also
returning true.
2018-06-08 19:05:23 -05:00
Daniel Lopez
2eb5a2288a libobs: Fix Monitoring devices showing input devices
This bug fix is to show output devices in the Advanced Audio
Settings configuration, where currently on macOS it shows erroneously
input devices.
2018-06-08 19:03:53 -05:00
Jim
8c0be08040
Merge pull request #1309 from nleseul/effect-arg-modifier
libobs: Handle 'in', 'out', and 'inout' keywords in shader parsers
2018-06-05 15:51:36 -07:00
vokama
4c73e5f6c5 libobs: Update hotkey label on scene item rename 2018-06-05 01:24:42 +03:00
vokama
c457630c39 libobs: Enable setting hotkey name and description 2018-06-05 01:23:19 +03:00
Jim
b188883966
Merge pull request #1315 from RytoEX/copy-stream-metadata-on-remux
libobs: Copy metadata for tracks/streams when remuxing
2018-06-04 04:52:43 -07:00
jp9000
26d5560da3 libobs: Add scene item grouping
Allows the ability to group scene items.  Groups internally are
sub-scenes, which allows the ability to add unique filters and
transforms to each group.
2018-06-03 15:04:39 -07:00
jp9000
690f738a76 libobs: Add custom size support to scenes
Allows scenes to have a custom size.  Mainly used for grouping, but can
be extended with public API later.
2018-06-03 15:04:39 -07:00
jp9000
f0164f9d28 libobs: Do not signal reorder while scene mutex locked
Prevents a potential race condition with the scene mutex.
2018-06-03 15:04:39 -07:00
jp9000
ff52d34027 libobs: Defer and refactor scene item transform update
Defers updating the scene item transform to the graphics thread to
reduce the number of transform update calls.
2018-06-03 15:04:39 -07:00
jp9000
7a2337c1f2 libobs: Refactor item signaling (add func to signal parent) 2018-06-03 15:04:39 -07:00
jp9000
a1012c3f2c libobs: Do not draw item texture if source size 0 2018-06-03 15:04:39 -07:00
jp9000
b3dfd7ef80 libobs: Fix bug where cropped items would recalc transform
Fixes a bug where items that had cropping would recalculate transform
every frame.  obs_scene_item::last_width and obs_scene_item::last_height
would be set to the cropped sizes rather than the source's actual size.
2018-06-03 15:04:38 -07:00
jp9000
df88140e6a libobs: Zero scene data instead of setting members manually 2018-06-03 15:04:38 -07:00
jp9000
3a05cf6ab0 libobs/callback: Add signal reference counting
Adds a simple signal reference counting function
(signal_handler_connect_ref) that makes it so that signals keep the
handler around until the all the signal itself is disconnected.  This
prevents potential crashes where a signal might try to disconnect after
a handler has already been destroyed (typically in C++ with
OBSSignalHandler helper objects, where destruction isn't guaranteed to
be predictable).

This also modifies OBSSignalHandler to use the reference-counting
connections.
2018-06-03 15:04:03 -07:00
jp9000
10fc206f98 libobs: Refactor obs_scene_add to allow adding internally
Allows using obs_scene_add_internal to add without sending signals.
2018-06-03 07:24:59 -07:00
Ryan Foster
797c9d330c libobs: Copy metadata for tracks/streams when remuxing 2018-06-02 10:15:13 -04:00
Richard Stanway
834ebbd2d4
libobs: Avoid busy cursor when starting processes
Windows 10 shows a busy cursor when a process is created, this is not
useful for our background processes which have no UI.
2018-05-30 17:25:33 +02:00
Zachary Lund
396c05e23c libobs: Allow custom core data paths
Closes obsproject/obs-studio#1300
2018-05-29 04:56:37 -07:00
nleseul
5a111cf073 libobs: Handle 'in', 'out', and 'inout' keywords in shader parsers 2018-05-28 12:07:20 -04:00
Shaolin
b8e6e7a9fe libobs: Use xcb-xinput when available for events
This enables extra mouse buttons to be detected by libobs. This allows
up to 29 extra buttons.
2018-05-07 21:31:16 -03:00
Jim
57121478ac
Merge pull request #1282 from computerquip-streamlabs/source-save-load-signal
libobs: Expose source save/load signal
2018-05-07 14:41:39 -07:00
jp9000
8a1a02e7fc libobs: Make callback optional for obs_load_sources
Due to the ability to track creation of scenes via the "source_created"
global signal, the callback parameter of obs_load_sources has become
somewhat obsolete.  This change allows the ability to pass NULL to the
callback parameter in case the callback is not needed.
2018-05-04 11:44:19 -07:00
jp9000
516c0de2e0 libobs: Don't signal "source_create" for private sources 2018-05-03 12:38:47 -07:00
Zachary Lund
daf5a4b9f3 libobs: Expose source save/load signal 2018-05-01 16:09:51 -07:00
jp9000
8211b9e220 libobs: Use unaligned store rather than aligned store
Prevents a potential crash when being used with audio data that is
unaligned.
2018-05-01 09:26:10 -07:00
jp9000
4785d9906c libobs: Convert sse inline funcs to macros 2018-05-01 09:01:04 -07:00
jp9000
238df3da3a libobs: Add "static" to inline func
Fixes linux-specific compiler error:
libobs/libobs.so.0: undefined reference to `hmax_ps'
2018-04-30 04:16:15 -07:00
Tjienta Vara
b0f94afaf2 libobs, UI: Add true peak measurements
Add a new algorithm to calculate the true-peak. It implements the
Whittaker- Shannon interpolation from four samples to create 4
intermediate samples (5 x oversampling) inbetween the middle two
samples.

With 4 samples and 4 intermediate samples the algorithm can be
implemented as a 4x4 vector-matrix cross product, which is ideal for
SSE.

I've also replaced the sample-peak algorithm using SSE as well to
improve performance.

Closes obsproject/obs-studio#1189
2018-04-30 03:53:26 -07:00
Jim
76a5cc12a6
Merge pull request #1274 from computerquip-streamlabs/frontend-crash-handling
Separate crash handler from libobs startup
2018-04-25 14:02:49 -07:00
Zachary Lund
121035346f libobs: Separate crash handler from startup 2018-04-25 12:56:18 -07:00
Zachary Lund
189e535014 libobs: Add functions to get output capability flags
Closes obsproject/obs-studio#1263
2018-04-25 03:15:30 -07:00
jp9000
c4b482efef libobs: Add functions to get raw video output
Adds obs_add_raw_video_callback() and obs_remove_raw_video_callback()
functions which allow the ability to get raw video frames without
necessarily needing to create an output.
2018-04-23 10:58:30 -07:00
jp9000
45b5291530 libobs: Deactivate unnecessary GPU ops when not encoding
Reduces GPU usage when encoding is not active.  Does not perform color
conversion, frame staging, or frame downloading unless encoding is
explicitly active.
2018-04-23 08:14:18 -07:00
Shaolin
47d920e9a2 libobs: Log *nix window manager
This should ease the support task to help with performance and
xcomposite issues on such systems.

Closes obsproject/obs-studio#1194
2018-04-23 04:48:24 -07:00
Jim
6f4985e4d6
Merge pull request #1261 from Andersama/patch-11
libobs: Fix pasting filters crash when missing sources
2018-04-22 06:56:52 -07:00
jp9000
904ad9be1d libobs: Add function to get last main output texture
Allows the ability to get the last rendered texture of the main output
view.
2018-04-20 05:57:47 -07:00
sorayuki
fc26e3cfcf libobs: Fix potential filter rendering race condition
The filters array should not be accessed without locking the filter
mutex.  This locks the filter mutex, grabs a reference to the first
filter, unlocks the mutex, renders the filter, and then releases the
reference.

Closes obsproject/obs-studio#1215
2018-04-20 01:55:52 -07:00
Alex Anderson
b0cd7fe890 libobs: Fix pasting filters crash when missing sources
Solves crash when a user tries to paste filters without selecting a
source or when pasting filters from a deleted source. This commit
checks if both sources are still valid before pasting.

This addresses Mantis Issue 1220
(https://obsproject.com/mantis/view.php?id=1220).
2018-04-18 09:11:47 -07:00
jp9000
cec6168fd2 libobs: Update version to 21.1.0 2018-03-17 11:23:15 -07:00
jp9000
4b54bde426 cmake, libobs, win-capture: Fix VS2017 warnings 2018-03-12 16:16:38 -07:00
Colin Edwards
cf91d9d02d deps/obs-scripting: Expose obs video info to swig
Closes jp9000/obs-studio#1203
2018-02-27 22:41:33 -08:00
jamacanbacn
8a59d68e47 libobs: Fix property text typo
(This commit also modifies UI)

Closes jp9000/obs-studio#1204
2018-02-27 05:37:40 -08:00
jp9000
8fdfdd9dd2 libobs/util: Fix blank config file values being ignored
If a config file value is set to a blank value, the value would not be
set and the default value would be used.  This fixes a bug where the
user would try to remove the replay buffer prefix, only to have the
prefix be added again next time they start the program.
2018-02-27 01:52:25 -08:00
jp9000
90692c9791 libobs: Update to version 21.0.3 (mac update)
This version change is specific for the mac version -- it's mostly just
to update the Qt package.
2018-02-21 01:19:02 -08:00
Shaolin
ffd2303a36 libobs: Log YUV space/range on video reset
Closes jp9000/obs-studio#1196
2018-02-20 04:26:29 -08:00
JetMeta
18c1f10488 libobs/util: Cache windows CPU frequency
Caches the frequency of the performance counter.  It was supposed to be
caching it already, but it seems that code was unintentionally not
included.

Closes jp9000/obs-studio#1185
2018-02-19 22:11:55 -08:00
pkviet
645d6ae8dd libobs/media-io: Change speaker layout to match FFmpeg aac.
(This commit also modifies the obs-ffmpeg module)

The default channel layouts from aac spec are implemented in FFmpeg
native aac encoder as follows:

    AV_CH_LAYOUT_MONO,
    AV_CH_LAYOUT_STEREO,
    AV_CH_LAYOUT_SURROUND,
    AV_CH_LAYOUT_4POINT0,
    AV_CH_LAYOUT_5POINT0_BACK,
    AV_CH_LAYOUT_5POINT1_BACK,
    AV_CH_LAYOUT_7POINT1,

The correspondence of speaker layouts to AV_CH_LAYOUT from FFmpeg is
changed to reflect the previous table.

Although FFmpeg native aac encoder can now encode all the layouts listed
in avutil channel_layout.h (on master), there might be issues with older
FFmpeg binaries.

Note that 2.1 speaker layout will be encoded as AV_CH_LAYOUT_SURROUND
(FL FR FC) because it is not listed as the default layout for three
channels.

This just means some optimizations for LFE channel will not be used by
the encoder which will treat it as an SCE (single channel element).

Closes jp9000/obs-studio#1182
2018-02-06 06:14:24 -08:00
jp9000
8733228126 libobs: Update version to 21.0.2 (mac tag) 2018-01-25 10:29:54 -08:00
jp9000
682c89bb33 libobs: Update version to 21.0.1 2018-01-22 13:55:54 -08:00
jp9000
7abbd4d247 libobs: Update version to 21.0.0 2018-01-20 16:46:33 -08:00
Jim
77643cce1e
Merge pull request #1139 from takev/pulseaudio-surround-selection
linux-pulseaudio: Surround speaker map
2018-01-19 16:14:04 -08:00
jp9000
e3d19c5b16 libobs/callback: Add calldata_create and calldata_destroy
These functions aren't particularly useful in C/C++, but these functions
are necessary to allow creating/destroying a calldata_t object via
script.
2018-01-18 08:53:19 -08:00
Tjienta Vara
48a8e750bb linux-pulseaudio: Surround speaker map
When using more than two channels, the channel map of pulse-audio is incorrect.

Add an API for getting a speaker map based on OBS speaker layout. Then use the
speaker map when connecting to a pulse-audio device, for both source and
monitor output.
2018-01-17 13:05:04 +01:00
jp9000
8a1486d15f libobs: Fix rendering if filter context no longer exists
If a filter's implementation (its plugin for example) no longer exists,
it would cause the source to stop rendering if that filter was present
on the source.  Instead, just bypass the filter to ensure that the
source continues to render.
2018-01-17 02:08:06 -08:00
jp9000
dc7e05c0b9 libobs: Fix double -> float conversion warning 2018-01-16 12:03:03 -08:00
jp9000
d6ac457025 libobs: Optimize clearing of unused source audio mixes
Prevents calling memset on mixes that aren't currently active.
2018-01-16 12:02:00 -08:00
Christoph Hohmann
f4142a8ac8 libobs: Fix audio buffer clear in custom source mixing
The memset in custom_audio_render() did not clear all audio buffers when
the number of output channels was less then 8.  This caused wrong audio
output on mixes that did not get cleared.

Closes jp9000/obs-studio#1123
2018-01-16 11:56:11 -08:00
SuslikV
70bc2581b7
libobs: Fix log message
Refines warning message to make it clear for the end-user.

Module may fail to load by different reasons.
2018-01-13 12:26:34 +02:00
jp9000
a79992eae9 libobs: Fix audio issue with scene items
When a scene is added as a scene item with the same audio sources that
are already in the current scene, it would cause the current scene to no
longer output audio due to audio.

To replicate the issue, you would create two separate audio device
captures in scene 1, use add existing in scene 2 and add one of those
audio sources, then go back to scene 1, add scene 2 as a source, then
make scene 1 invisible.
2018-01-09 18:13:32 -08:00
Tjienta Vara
8f6d048817 linux-pulseaudio: Default sample format float32le
This pull request changes the fallback sample format for pulse-audio
to from PA_SAMPLE_S16LE to PA_SAMPLE_FLOAT32LE.

The pulseaudio plugin can handle the following sample format:
* PA_SAMPlE_U8
* PA_SAMPLE_S16LE
* PA_SAMPLE_S32LE
* PA_SAMPLE_FLOAT32LE

When an audio device advertises itself as another format, the pulseaudio-plugin
will ask pulse audio to convert to the fallback sample format.

The fallback PA_SAMPLE_S16LE is not ideal when your audio interface advertises
as PA_SAMPLE_S24LE since the conversion will lose precision.
With PA_SAMPLE_FLOAT32LE there is no precision loss and it is also equals OBS's
internal format.
2018-01-08 19:31:09 +01:00
Jim
26a471b65a
Merge pull request #1107 from admshao/pulse-fix-mantis-0001076
libobs: Fix pulseaudio monitor playback stuttering
2018-01-07 16:25:29 -08:00
Jim
e7aab8b4b8
Merge pull request #1128 from takev/volume-meters
UI: Rework volume-meters, adding more information
2018-01-07 13:57:21 -08:00
Shaolin
9de1ffe32b libobs: Fix pulseaudio monitor playback stuttering 2018-01-07 19:27:58 -02:00
Shaolin
78961818f8 libobs: Fix for int-in-bool-context-warning
The 'bool private' variable was receiving either OBS_SCENE_DUP_PRIVATE_COPY or
OBS_SCENE_DUP_COPY hence always being true.
2018-01-07 00:26:55 -02:00
Jim
98d291c037
Merge pull request #1122 from SuslikV/patch-5
libobs: Fix incomplete struct in scaler call
2018-01-05 16:00:54 -08:00
pkviet
67e48ecc2c libobs/media-io: Replace quad with 4.0
(also obs, deps/media-playback, libobs/audio-monitoring, decklink,
linux-alsa, linux-pulseaudio, mac-capture, obs-ffmpeg, win-dshow,
win-wasapi)

Default channel layout for 4 channels is 4.0 in FFmpeg.
Replacing quad with 4.0 will improve compatibility since FFmpeg has
better support of its default channel layouts.
2018-01-05 09:48:52 -08:00
pkviet
fb580535c9 libobs/media-io: Clean surround API
(also modifies obs-ffmpeg, audio-monitoring, win-wasapi, decklink,
obs-outputs)

Removes speaker layouts which are not exposed in UI.  The speaker
layouts selectable by users in the UI are the most common ones.  It is
not necessary to keep other layouts.  (This basically removes
5POINT1_SURROUND, 7POINT1_SURROUND, SURROUND =3.0).
2018-01-05 09:47:59 -08:00
Tjienta Vara
50ce228455 UI: Rework volume-meters, adding more information
The following features have been added to the audio-meters:
 * Stereo PPM-level meter, with 40 dB/1.7s decay rate.
 * Stereo VU-level meter, with 300 ms integration time.
 * Stereo Peak-hold meter, with 20 second sustain.
 * Input peak level color-squares in front of every meter.
 * Minor-ticks for each dB.
 * Major-ticks for every 5 dB.
 * Meter is divided in sections at -20 dB and -9 dB.

The ballistic parameters chosen here where taken from:
 * https://en.wikipedia.org/wiki/Peak_programme_meter (SMPTE RP.0155)
 * https://en.wikipedia.org/wiki/VU_meter

In the rework I have removed any ballistic calculations from
libobs/obs-audio-controls.c making the calculations here a lot more
simple doing only MAX and RMS calculations for only the samples in
the current update. The actual ballistics are now done by just
the UI/volume-control.cpp because ballistics need to be updated
based on the repaint-rate of the user-interface.

The dB to pixel conversion has been moved from
libobs/obs-audio-controls.c to UI/volume-control.cpp as well to reduce
coupling between these two objects, especially when implementing the
major- and minor-ticks and the sections.

All colors and ballistic parameters are adjustable via QT style sheets.
There are slight differences in colors for each of the themes.
2018-01-05 11:01:25 +01:00
SuslikV
c706742097 libobs: Fix scene filter duplication
Scene filters were not being copied when a scene was duplicated with
obs_scene_duplicate.

Closes jp9000/obs-studio#1104
2018-01-04 20:36:11 -08:00
SuslikV
f81adbd856 libobs: Fix bad source release placement
(This commit also modifies the UI)

The source release was being done in the wrong file.
2018-01-04 20:36:11 -08:00
Richard Stanway
8395cfcbce libobs: Log which security software is in use
(Windows only)
3rd party antivirus / firewalls cause a large number of issues in OBS.
Logging which products are installed will help narrow down potential
issues when users ask for help and include their log files.

Closes jp9000/obs-studio#1124
2018-01-04 17:55:36 -08:00
jp9000
fd9e5d45a3 libobs: Add obs_property_set_modified_callback2
Allows the ability to pass private data to a callback (useful
specifically for scripting purposes).
2018-01-03 17:04:04 -08:00
jp9000
6d628c1ceb libobs: Add obs_properties_add_button2
Allows passing button-specific private data to the button callback
rather than just passing the private data of the properties object.
2018-01-03 17:04:04 -08:00
jp9000
1902594da4 libobs: Fix function to be static inline
The function in the header was marked as just inline, which would cause
processing problems for SWIG.
2018-01-03 17:04:04 -08:00
jp9000
66f993d214 libobs: Exclude certain declarations from SWIG processing
Prevents SWIG from being able to process certain declarations that would
cause binding generation errors/warnings.
2018-01-03 17:04:04 -08:00