The usages of this function are correct and intentional here. They are
meant to stay to keep consumers of the autoselect APIs working until
those APIs are removed. As such, PRAGMA_DISABLE_DEPRECATION disables the
deprecations. There is no reason to remove these calls before the APIs
themselves are removed.
Splits the IconLabel widget header into a header and source file. The
source uses the moc_icon-label include to prevent the moc from being
included in the global mocs_compilation (as described in 5eb04cd).
For custom types to become usable as QVariants they not only need to
be declared as meta types, but also need to have appropriate stream
operators declared.
These declarations (both of the meta type itself, which provides a
static meta type ID getter via the macro, as well as the operators)
need to be visible to the compiler in any compilation unit where they
might be used in their QVariant form, otherwise the templates will
be incomplete.
A blanket include of "qt-wrappers.hpp" in "OBSBasic.hpp" is not the
most subtle fix, but it's necessary to ensure that the meta types
are always "complete". Putting both declarations in the qt-wrappers
header (instead of splitting them up) ensures that (as the classes
themselves are declared in "obs.hpp", which is included by
"qt-wrappers.hpp", and thus qt-wrappers can provide a complete class.
If a frame has a width or height of zero, this value will make it into
libobs/media-io/video-frame.c:video_frame_init and cause linesizes or
heights to be zero, which will result in a bmalloc(0) call and OBS will
crash.
Instead of letting the call stack get that far, check the frame width
and height here at the source, log an error, and return early if the
frame width or height are zero.
`update_metrics()` in `bpm.c` is checking for null pointer arguments,
and there was a very minor chance of dereferencing a null-pointer in
the logged message. Correct the logic to prevent this from happening.
Multiple APIs may be set up to capture without being initialized in
graphics-hook when multiple threads are sending present calls. This just
prevents those invalid captures from completing.
BPM initialization occurs with the first call to the
`bpm_inject()` callback function. When Stream Delay is
active, there is a case where the first call might never
happen, specifically if a user stops the stream with the
discard delay option before streaming begins. In such a
case OBS will crash due to an uninitialized mutex being
referenced in `bpm_destroy()`.
Use `pthread_once()` in both the `bpm_inject()` callback
and `bpm_destroy()` to ensure BPM initialization has occurred.
Introduce support for delivering BPM (Broadcast
Performance Metrics) over SEI (for AVC/H.264 and
HEVC/H.265) and OBU (for AV1) unregistered messages.
Metrics being sent are the session frame counters,
per-rendition frame counters, and RFC3339-based
timestamping information to support end-to-end
latency measurement.
SEI/OBU messages are generated and sent with each IDR
frame, and the frame counters are diff-based, meaning
the counts reflect the diff between IDRs, not the running
totals.
BPM documentation is available at [1].
BPM relies on the recently introduced encoder packet timing
support and the packet callback mechanism.
BPM injection is enabled for an output by registering
the `bpm_inject()` callback via `obs_output_add_packet_callback()`
function. The callback must be unregistered using
`obs_output_remove_packet_callback()` and `bpm_destroy()`
must be used by the caller to release the BPM structures.
It is important to measure the number of frames successfully
encoded by the obs_encoder_t instances, particularly for
renditions where the encoded frame rate differs from the
canvas frame rate. The encoded_frames counter and
`obs_encoder_get_encoded_frames()` API is introduced
to measure and report this in the encoded rendition
metrics message.
[1] https://d50yg09cghihd.cloudfront.net/other/20240718-MultitrackVideoIntegrationGuide.pdf
Changes the icon rendering for the properties view "question mark" icon
from Qt label HTML to use the IconLabel widget. This makes the label
high DPI.
Unfortunately the properties view code is a complete nightmare and in a
way, this PR makes this worse by adding the "leftWidget" widget as a
placeholder for what the "normal" label used to be, but you can't easily
replace that label with the icon label (while retaining prior
modifications from other nightmare code) so here we are. The entire
thing needs to be burnt to the ground and be rebuilt from the ground up
but that's a task for another day.
When a source file contains an explicit include with a filename
following the "moc_<actual-filename>.cpp" pattern, then CMake's
AUTOMOC generation tool will recognize the matching pair and generate
the replacement header file and add the required include directory
entries.
For all files which do contain Q_OBJECT or similar declarations but do
not have an explicit include directive, the global mocs_compilation.cpp
file will still be generated (which groups all "missing" generated
headers).
The larger this global file is, the more expensive incremental
compilation will be as this file (and all its contained generated
headers) will be re-generated regardless of whether actual changes
occurred.
The ComPtr, WinHandle, and obfuscate source files are shared with
multiple sub-projects and thus need to be moved into the shared
directory to uncouple their availability from libobs itself.
The same applies to d3d8-api, inject-library, and hook-config
(from win-capture), as well as comutils (from the virtualcam-module).
List widgets are currently used as playlists in source properties,
but only contain the file paths and no other identifying information.
This can lead to files being added multiple times, so when changes to
list order occurs, plugins cannot uniquely identify which duplicate
item was actually changed (because they're only identified by the path).
By adding a UUID to the user data role of a list item, an additional
unique information is added that allows plugins to de-duplicate list
items.
On Windows, shutdown() will not interrupt a blocking connect() call, so
happy_eyeballs_destroy could block until the remaining candidates timed
out. As happy_eyeballs_destroy is called in the RTMP connect path, this
would stall the RTMP connection and cause the winning candidate's socket
to be disconnected due to a timeout.
The code currently assumes that the array does not change during
execution, this assumption is violated when the darray resizes causing
previous pointers to point to invalid memory and cause undefined
behavior and crashes.
This may need refactoring in the future, this commit simply fixes the
issue for now.
By not performing an unref on sw_frame before using it again, a memory
"leak" was being created if the frame had side data. This removes a
previously-added check that optionally unrefs sw_frame, and just does
it every tick.
Co-authored-by: pkviet <pkv@obsproject.com>