MinGW comes with it's own intrinsics macros as regular MSVC does.
On MinGW the inclusion of SIMDe would cause multiple definitions
of the same macro names.
Since sse-intrin.h leaks into the public header space this
will cause 3rd party plugins build with MinGW tool-chains emit
redeclaration warnings when including obs-module.h.
Switching to a static library that contains version information as
const char strings has multiple benefits:
* The version information provided externally via compiler definitions
will fail compilation early if malformed
* An updated version string (which will happen with every commit) will
not invalidate existing compilation units, because only the static
library is affected by the change
* An update of the version change just requires a recompilation of the
static library and a linker update
* An update of the version will _not_ infect the rest of the codebase
(as it does currently, because everything includes obsconfig.h one
way or another)
* Other modules which used the macro definition directly have been
updated as much as possible to use the proper getter method from
`libobs` instead (some Windows-specific modules use preprocessor
string composition, the value has been added as a compiler definition
directly in those cases)
* Because the impact of a version change due to a commit hash change
is limited to the static library, ccache hit rates should be
improved considerably
#8873 accidentally used `log_flag_encoded()` instead of `flag_encoded()` in `obs_output_begin_data_capture()`, which was causing a warning to be logged when it shouldn't.
This deprecates the following functions, replacing them with new
versions:
- `obs_output_can_begin_data_capture()` - now `*capture2()`
- `obs_output_initialize_encoders()` - now `*encoders2()`
- `obs_output_begin_data_capture()` - now `*capture2()`
The flags parameter was initially designed to support audio-only or
video-only operation of an output which had the `OBS_OUTPUT_AV` flag,
however, full support for that was never implemented, and there are
likely fundamental issues with an implementation, mainly that most
outputs are programmed assuming that there will always be at least one
audio and one video track. This requires new flags specifying support
for optional audio/video, among other things.
An implementation to allow audio/video to be optional is best done
using the flag technique above, with audio/video enablement specified
by whether media (raw, `video_t/audio_t`) or encoder (`obs_encoder_t`)
objects are specified.
Since every implementation I could find always specifies `flags` as 0,
I was able to safely conclude that immediately removing the parameter's
functionality is safe to do.
In its current form `struct dstr` is used in functions declarations
in the header file before the actual type is included (as `dstr.h` is
included after in `window-helpers.c`.
`clang-cl` is unable to compile this code because the function signature
defined in the header will not match the implementation in the source
code due to the implicit forward-declaration of `struct dstr` before
the type is included in the actual header.
The option of default device or specified device for audio input
and monitoring device made for a matrix of four possible combinations.
Not all combinations were properly detecting feedback potential.
This reworks the logic so we properly detect in all four cases.
Since OBS outputs can have any combination of flags for encoded,
video, audio, and service, there are a number of cases where it would
be a good idea to validate that we're not allowing output changes that
risk undefined behavior given the supported flags.
This also does a mild amount of code cleanup, adding inline functions
for checking the flags mentioned above.
In some cases (ffmpeg_mux), the extension and format values are a
direct passthrough from arbitrary data. Instead of always postfixing
a `.` at the end of a generated path if the extension is invalid,
don't postfix the `.` at all.
Before: `my_formatted_string.`
After: `my_formatted_string`
Use inline assembly for x86_64 speed/accuracy.
Sacrifice speed for accuracy on other processors.
Continue to use original implementation for ARM on Windows.
The macro PRAGMA_WARN_STRINGOP_OVERFLOW was introduced to suppress a
warning -Wstringop-overflow caused by a macro da_push_back_new calling
darray_push_back_new.
Extract the function in the macro to avoid the warning.
This will also enables checking the type check of the returned pointer.
When an effect file is not found while initializing graphics, only one
line error below is logged. To clarify the reason why the initialization
was failed, also log when the file was not found.
Failed to initialize video. Your GPU may not be supported, or your
graphics drivers may need to be updated.
This code assumed that no one would be racing after we stopped the input
thread, however the obs output thread also races and can free the inputs
during disconnect before we finish closing the video mix.
Instead keep the locks around after stop and use them during close to
avoid races.
Fixes crashes when stopping virtual webcam on linux.
Co-authored-by: Norihiro Kamae <norihiro@nagater.net>
This is useful for formats such as 32-bit float PCM which providers
greater flexibility in editing by retaining information that would
otherwise be clipped.
Placeholder sources are created when a plugin providing a source type is
unavailable. Since they're not marked as having audio any audio track
settings for them get lost. With this change we retain mixer information
if the source owns its id to avoid that.
Since 65eb3c0815 we tried to get as close
a sync between audio and video tracks as we could before starting to
send frames to the output.
But in be717dbb2c when multi-track audio
was considered for synchronization it continued to try and line ALL
audio packets up with one video packet. While audio and video packets
are similar size this will work out. But once video packets duration is
smaller than 1/2 audio packet duration this may fail forever. In
practice with AAC's 20-23ms frame duration we can often get tracks
producing frames 5-10ms out of phase. For 60fps video this mostly fine
as 16ms frame duration will cover the gap, but for framerates as low as
100 its possible to fail to synchronize. In practice this is ~50%
for 6 audio tracks and 120fps video on my system, or 100% at 240fps.
The Pulseaudio implementation of audio monitoring was actually listing audio sources.
This change corrects that, so all possible outputs are available.
When creating a group, a newly allocated group `sub_scene` is released
just after calling `obs_scene_add_internal`.
If another thread released the scene-item, which is the sub_scene,
use-after-free might happen.
If the recording path is left empty in Settings, a leak can occur in
window-basic-stats.cpp because a bmalloc is called for a size 1.
This fixes the leak by checking against the path in the
os_get_free_disk_space function.
Signed-off-by: pkv <pkv@obsproject.com>
It was possible to set the encoder to scale the video to the same size
as the output, resulting in unnecessary passes through swscale and
skipping hardware encoders. This was a common user error in Advanced
Output mode where they would tick the rescale box but leave it at the
same resolution as their main output.
By adding the range data we can get successful handling of full range
color via custom FFmpeg output. Previously it would always default to 0
which would yield partial/limited output. Without the colorspace info
the output file is correctly tagged, but not undergone the actual
conversion.
Also modifies libobs & deps/media-playback.
AV_CODEC_CAP_TRUNCATED was removed in avcodec 60 [1].
We ifdef the code depending on it to allow compilation.
[1] avcodec: remove FF_API_FLAG_TRUNCATED
3ceffe7839
Signed-off-by: pkv <pkv@obsproject.com>
As clang and gcc use "default" visibility (as in "not hidden") when
no visibility is specified, all functions are implicitly exported.
When changing default visibility to "hidden", the corresponding symbols
are not exposed anymore and linking fails. This PR updates all
functions signatures that were added in recent commits but not set to
be EXPORTed.
Also makes required OpenGL imports for texture sharing on macOS
mandatory.