60 Commits

Author SHA1 Message Date
Dennis Sädtler
caf1de1595 shared/bpm: Fix NAL type for HEVC user data SEIs 2025-12-17 18:02:19 -05:00
gxalpha
5129612b6c frontend,shared: Replace and disable contextless connect calls
# Conflicts:
#	frontend/OBSApp.cpp
2025-12-17 16:35:45 -05:00
gxalpha
9b1d1493ab frontend,shared: Replace and disable QByteArray to char * casts 2025-12-17 16:35:45 -05:00
Sebastian Beckmann
a9a506e984 shared/idian: Make checked status of collapsible rows public 2025-09-04 14:17:02 -04:00
Sebastian Beckmann
22ce393680 shared/idian: Make title and description common to all row types 2025-09-04 14:17:02 -04:00
Sebastian Beckmann
795988bd69 shared/idian: Pass "this" instead of "=" to lambda
This is more correct, and compatible with C++20.
2025-09-04 14:17:02 -04:00
Sebastian Beckmann
c00be01bd0 shared/properties-view: Tolerate deprecated autoselect functions
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.
2025-08-25 19:13:25 -04:00
Sebastian Beckmann
d097ff24ad shared/idian: Rename OBSIdianUtils 2025-08-22 16:21:52 -04:00
Sebastian Beckmann
872ea5fb91 shared/idian: Rename component classes 2025-08-22 16:21:52 -04:00
Sebastian Beckmann
edb2c9ca48 shared/idian: Rename widget classes 2025-08-22 16:21:52 -04:00
Sebastian Beckmann
5cda3d4e8e shared/idian: Rename all-in-one include to Idian.hpp 2025-08-22 16:21:52 -04:00
Sebastian Beckmann
9e0c3219ff frontend: Move idian widgets to shared/qt 2025-08-22 16:21:52 -04:00
gxalpha
9dcef85e69 shared/icon-label: Split into header and source file
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).
2025-08-19 16:08:06 -04:00
gxalpha
a64956d8ee shared: Rename icon-label.hpp to IconLabel.hpp
Renames the icon-label.hpp header to IconLabel to follow the new
convention of files being named the same as the class they contain.
2025-08-19 16:08:06 -04:00
Rob Howell
2b613f40b4 media-playback: Fix null pointer dereference 2025-08-04 15:39:26 -04:00
PatTheMav
059fd6210c frontend: Fix visibility issues of meta type stream operators
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.
2025-06-16 14:44:27 -04:00
shiina424
b611c58fa9 shared/obs-hook-config: Update graphics hook to 1.8.7 2025-06-02 14:09:44 -04:00
jeiea
22c4e11ec8 media-playback: Fix possible crash on startup
Frame width/height check crash if the frame is not given.

We can reorder width/height check after other precondition checks.
2025-05-06 14:27:29 -04:00
Ryan Foster
7cae57d3b7 media-playback: Fix possible crash if frame width or height is zero
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.
2025-04-23 19:26:54 -04:00
PatTheMav
96e4d67242 clang-format: Update source code files with clang-format 19.1.1 2025-04-17 18:16:33 +02:00
Alex Luccisano
64cb68af56 bpm: Fix potential null-pointer dereference
`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.
2025-02-14 16:19:13 -05:00
jcm
83934acb44 obs-scripting: Fix macOS Homebrew Python loading 2025-01-28 15:07:38 -05:00
confusionattack
4652daf748 win-capture: Avoid NULL deref when capture not initialized 2024-11-16 11:32:10 -08:00
Charlese2
0b87f533b2 graphics-hook: Fix null pointer dereference
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.
2024-10-31 12:46:04 -04:00
Warchamp7
7b052cba45 UI: Replace toolButton property with style class 2024-10-16 13:49:34 -04:00
Norihiro Kamae
03d9fee46e shared/opts-parser: Fix crash when no options were given to the parser
When passing just a space, the number of input options becomes 0. In
this case, calling `bmalloc` should be avoided.
2024-10-08 13:53:07 -04:00
Ryan Foster
a1fbf1015f clang-format: Increase column limit from 80 to 120 2024-10-04 18:19:27 -04:00
Ryan Foster
109f64c446 shared/obs-hook-config: Update graphics hook to 1.8.4 2024-10-04 17:53:45 -04:00
Alex Luccisano
39f0ed6e75 shared/bpm: Fixed crash when using Stream Delay
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.
2024-10-04 15:49:44 -04:00
Warchamp7
cb026964b0 UI: Replace themeID and style hints with class property 2024-10-04 15:20:49 -04:00
PatTheMav
6c590805e8 cmake: Update supported CMake version range to 3.28 and 3.30 2024-09-13 14:42:32 -04:00
tytan652
31385006d5 Remove legacy_check CMake macro
The macro was not removed in 72428ccd97
waiting for submodules to be be updated to a commit where their legacy
code path is removed.
2024-09-11 13:24:39 -04:00
Alex Luccisano
07d504e5c7 shared/bpm: Add BPM (Broadcast Performance Metrics)
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
2024-09-05 16:38:58 -04:00
gxalpha
efa291b140 shared/qt: Remove unused graphics include from qt-wrappers 2024-08-30 23:55:45 -04:00
gxalpha
213e0f1396 shared/qt: Unlink slider-ignorewheel from libobs
As the obs.hpp include is unused and can get removed, the entire linkage
to libobs is unnecessary.
2024-08-30 23:55:45 -04:00
gxalpha
f1f89a4864 shared/properties-view: Remove Qt 6.2 cmake code 2024-08-28 23:21:06 -04:00
gxalpha
270cebe581 shared/properties-view: Use IconLabel for help icon
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.
2024-08-28 19:42:10 -04:00
gxalpha
7840c53eff shared/qt: Add IconLabel widget 2024-08-28 19:42:10 -04:00
tytan652
72428ccd97 Remove CMake legacy code path
Except submodules and legacy_check macro since the former depend on it.
2024-08-28 13:53:25 -04:00
derrod
d9503d4c27 shared/media-playback: Remove compatibility with FFmpeg < 6.1 2024-08-23 13:44:04 -04:00
PatTheMav
5eb04cdf9d shared: Improve incremental compile times via explicit file includes
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.
2024-08-22 16:45:12 -04:00
PatTheMav
5bbb5e08c9 libobs: Add shared interface libraries to shared project directory
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).
2024-08-20 16:00:21 -04:00
PatTheMav
3d2654f71b UI: Add UUID to file-based list widgets
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.
2024-08-18 13:00:11 -07:00
PatTheMav
b8cfacaec3 Update formatting of CMake files 2024-08-14 12:07:47 -04:00
Richard Stanway
1e6c375e95 happy-eyeballs: Specify AI_ADDRCONFIG for getaddrinfo
This might help to avoid returning IPv6 addresses on systems without
IPv6 connectivity.
2024-08-12 20:02:04 -04:00
Richard Stanway
78ffd99ab1 happy-eyeballs: Move happy_eyeballs_destroy to a thread
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.
2024-08-12 20:02:04 -04:00
Richard Stanway
fce534572b happy-eyeballs: Reserve array length for all candidates
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.
2024-08-12 20:02:04 -04:00
Norihiro Kamae
37b40184a0 shared/obs-scripting: Add inline qualifiers to functions in header file 2024-08-07 17:27:49 -04:00
tt2468
7b2a6351b0 shared/media-playback: Unref sw_frame before reuse
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>
2024-08-03 16:31:02 -07:00
tytan652
f051fdd75e UI,shared: Move OBSPropertiesView to its own directory 2024-07-27 07:38:36 +02:00