This fixes the following bug:
- a source might be copied into the same scene or through a nested scene.
The audio level will then increase by +6 dBFS.
An earlier fix [1] dealt with this bug at the scene audio rendering
level, which leaves some edge cases since the fix is not located
directly in the core audio callback.
The current fix consists in:
- tagging individual sources which appear several times in the audio
tree at each tick;
- promote them to root_nodes sources;
- bypass their mixing in scenes and transitions.
Due to being mixed as root_nodes, the audio of duplicated sources
appears only once in the final audio mix.
[1] https://github.com/obsproject/obs-studio/pull/10537
Signed-off-by: pkv <pkv@obsproject.com>
This reverts commit: 8a38e33 [1].
This also reverts commit: 72924ac [2].
(in favour of a fix in core audio pipeline, which allows to address
edge cases).
[1] libobs: Mix audio of each source in a scene only once
8a38e3375b
[2] libobs: Deduplicate audio for nested scenes/groups if not
transitioning
72924ac1f3
Signed-off-by: pkv <pkv@obsproject.com>
SIMD Everywhere finder needs to be installed alongside libobs CMake
package since its headers depends on it.
C++ cmath header is included on Windows on ARM to ensure that all math
functions are correctly defined when included in C++ code.
https://github.com/simd-everywhere/simde/issues/1304
macOS intrinsics is included to make sure that no redefinition error
happens.
Create a specific "out of memory" variant of os_breakpoint to facilitate
troubleshooting and to differentiate an "out of memory" crash from a
more generic crash.
The interleaver requires packets with sufficiently high timestamps from
all encoders to be available to send out before it outputs a packet.
This means that if one encoder stalls and does not submit packets for
a while the interleaver can end up with a permanent increase to its
delay due to multiple packets being received from the other encoders
without being able to send any.
This change introduces a recovery mechanism that relies on an upper
bound for the amount of packets that may become "streamable" at a time
being calculated, and flushing additional packets if that bound is
violated.
The upper bound is based on the largest expected interval between
packets and how many packets for each encoder could arrive within
double that interval (to give us a bit of wiggle room since not
all encoders will deliver frames 100% consistently).
This ensures that we still send data at a steady rate but allow the
buffer to drain if it becomes larger than it needs to be.
The OpenGL frontend is implemented in Metal for Apple Silicon Macs.
Metal does not provide a direct "clear" command (neither do D3D12 or
Vulkan) and instead a clear is a load command for a render target of a
render pass.
All writes (and color calculations) in Metal happen in linear space,
with appropriate gamma encoding and decoding happening automatically
depending on the pixel format of the the textures attached to the
pipeline.
Thus setting a clear color with linear gamma is the correct approach to
avoid the SRGB gamma curve being applied twice for both scenarios.
This fixes a change in PR 11605 that breaks Decklink video outputs.
get_mix_for_video() returns NULL for those outputs, causing
start_raw_video() to return before connecting the output.
A few recently introduced graphics API functions needed for Enhanced
Broadcasting were marked as `GRAPHICS_IMPORT_OPTIONAL`. Add the
proper checks in the wrapper to ensure they are safe on platforms
that do not implement the underlying function.
FreeBSD already implemented os_get_free_size. Move the new Linux
implementation into the existing not-__FreeBSD__ block.
Fixes: 935613816f ("libobs/util: Update `os_get_free_size()`")
This fixes a regression on Linux, introduced in commit 9bc3082.
According to the POSIX specification for the exec family of commands,
"The first argument is the filename or pathname of the executable to
be executed". This was done correctly before, but the above commit
removed "sh" from the arguments, breaking the pipe function on Linux.
With the removal of all legacy code paths, obsconfig.h always exists and
the compile definition always gets set. As such, it's no longer
necessary to check for it.
As removing the definition itself could be seen as a breaking change,
this simply moves the definition to pc.in and cmake.in files for now to
preserve the value for plugins that might expect this to be set. We may
remove the definition entirely in a later release.
In `parse_decl_string`, it jumps to `fail` label if an error occurs.
However, if the lexer encountered an error for example, `cfp.error_list`
may be empty.
The frontend has set a log handler which locks the mutex in `LogString`.
If `os_dlopen` fails in the child process, it calls `blog` and attempted
to lock the mutex that may have already been locked by another thread
before `fork()`. This change prevents the child process from locking the
mutex, resolving the potential deadlock.
Sprites were unnecessarily updating a dynamic vertex buffer every single
draw call. This creates static vertex buffers for common vertex buffer
dimensions/uvs and only uses a dynamic vertex buffer when the texture
coordinates actually change.
Porbably not a significant perf change considering the very few number
of traingles we draw per frame but still nice to do.
Optimizes certain 4x4 matrix functions by minimizing unnecessary math
operations. This ends up optimizing gs_matrix_transform() and
gs_matrix_rotate() functions and makes positional/rotational operations
a bit more optimal and requiring much less math than they would
otherwise.
This adds a new obs_canvas object that acts as a shareable
(reference-counted) owner of views, mixes, and (optionally) scenes.
This is a step towards faciliatating multi-canvas and multi-output
features in OBS Studio.
It solves a number of complications that exist with the manual approach
of using views, such as audio mixing, source active-state tracking, and
scenes not havinga reliable way of identifying the actual available
canvas size.
Signals when a video reset has completed. This is mainly useful when
canvases or views are used, whose mixes will have been freed or
recreated during the reset.
Add graphics APIs to obtain the GPU driver version and renderer
strings, as well as GDDR memory sizes. The GDDR memory sizes
include the dmem (dedicated memory on the GPU) and smem
(shared CPU memory used by the GPU but resides in the CPU DDR).
The version and renderer strings are needed for identification
purposes, for example enhanced broadcasting used by Twitch, to
associate the GPU used by OBS with the PCIe-based identification
values such as device_id and vendor_id.