0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00
Commit Graph

2965 Commits

Author SHA1 Message Date
gxalpha
16b8e9c3fe libobs: Deselect scene item before removing
Makes sure that a scene item that gets removed is in the "not selected"
state, no matter whether it was selected before. This causes the
"item_deselect" signal to be sent if the item is selected while being
removed.
2024-09-16 18:10:12 -04:00
Norihiro Kamae
61d74fb4ab libobs: Remove obs_output_signal_delay
The function is never called, documented or exported.
2024-09-16 16:29:27 -04:00
PatTheMav
6c590805e8 cmake: Update supported CMake version range to 3.28 and 3.30 2024-09-13 14:42:32 -04:00
Exeldro
5b79b4b74d libobs: Add obs_encoder_get_mixer_index 2024-09-12 18:07:19 -04:00
PatTheMav
4dac84999d libobs: Update macOS platform implementation
Cleans up the source code by sorting functions by topic and also
removes macros for hotkey implementation, removing the need to disable
compiler warnings.

Key codes and descriptions are now contained in arrays which either
use the OBS key code or the macOS key code as lookup keys with all
necessary context information directly associated with the key.

The implementation also uses the zero-initialization rule for arrays
of structs in such a way that the struct's "is_valid" boolean is
"false" by default so that only values explicitly initialized with a
key are ever "valid".
2024-09-12 16:44:39 -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
Alex Luccisano
0a36ed1164 libobs: Add a packet callback mechanism
Packet callbacks are invoked in `send_interleaved()` and
are useful for any plugin to extend functionality at the
packet processing level without needing to modify code in
libobs. Closed caption support is one candidate that is
suitable for migration to a packet callback.

The packet callback also supports the new encoder packet
timing feature. This means a registered callback will have
access to both the compressed encoder packet and the associated
encoder packet timing information.
2024-09-05 16:38:58 -04:00
Alex Luccisano
6a53b8928f libobs: Add encoder packet timing support
Introduce support for the `encoder_packet_time` struct
to capture timing information for each frame, starting
from the composition of each frame, through the encoder,
to the queueing of the frame data to each output_t.

Timestamps for each of the following events are based on
`os_gettime_ns()`:

CTS: Composition time stamp (in the encoder render threads)
FER: Frame encode request
FERC: Frame encoder request completely
PIR: Packet interleave request (`send_interleaved()`)

Frame times are forwarded through encoder callbacks in the
context that runs on the relevant encoder thread, ensuring
no race conditions with accessing per encoder array happen.
All per-output processing happens on data that is owned by
the output.

Co-authored-by: Ruwen Hahn <haruwenz@twitch.tv>
2024-09-05 16:38:58 -04:00
Ruwen Hahn
26b7b4511c libobs/util: Add os_nstime_to_timespec 2024-09-05 16:38:58 -04:00
derrod
c521b23619 libobs: Always set initial scene item pos to top-left corner
In relative mode (0, 0) is the center of the screen, so in order to
maintain previous behaviour we need to convert the value here.
2024-09-02 20:39:18 +02:00
derrod
22fc29c5b4 docs,libobs: Remove deprecated service APIs
Deprecated in 29.1
2024-08-28 19:10:27 -04:00
derrod
b7553b5883 docs,libobs: Remove master volume functions
Never implemented, deprecated in 29.0.
2024-08-28 19:10:27 -04:00
derrod
8729cebce7 docs,libobs: Remove deprecated scene item transition functions
Deprecated in 28.0, documentation erroneously states 27.2.

The following functions were erroneously not marked as deprecated in
the header:
- obs_sceneitem_set_show_transition()
- obs_sceneitem_set_show_transition_duration()
2024-08-28 19:10:27 -04:00
derrod
75cde08e8d libobs: Rename OBS_NIX_PLATFORM_X11_GLX to OBS_NIX_PLATFORM_INVALID
Deprecated in 28.0.
Renamed so that the values of non-deprecated members stay the same.
2024-08-28 19:10:27 -04:00
derrod
84d462c31c libobs: Remove obs_hotkey_enable_strict_modifiers()
Deprecated in 28.0.
2024-08-28 19:10:27 -04:00
derrod
03fbe28717 libobs: Remove base_set_allocator()
Deprecated in 28.0.
2024-08-28 19:10:27 -04:00
derrod
71d49b0ef2 docs,libobs: Remove/internalize deprecated addref functions
These have been deprecated for external users since 27.2 (early 2022)
and only two are still in use internally.
2024-08-28 19:10:27 -04:00
derrod
78bc3300c0 libobs: Remove obs_volmeter_{get,set}_update_interval()
Deprecated in 27.2.
2024-08-28 19:10:27 -04:00
derrod
a4f5a33b14 libobs: Remove obs_proprety_text_type()
Typoed function name, deprecated in 21.1.
2024-08-28 19:10:27 -04:00
derrod
bda463932e docs,libobs: Remove obs_render_main_view()
Deprecated since 21.0
2024-08-28 19:10:27 -04:00
derrod
07aa98ab34 libobs: Remove obs_get_default_rect_effect()
Originally removed in 0.12.1 but "temporarily" brought
back, then never removed.
2024-08-28 19:10:27 -04:00
derrod
1703361dba libobs: Remove obs_{duplicate,free}_encoder_packet
Deprecated in 0.2.4(!) over 10 years(!!) ago.
2024-08-28 19:10:27 -04:00
Ryan Foster
f0d619521b libobs: Fix Windows x86 CMake when using reduced obs-deps package
A recent obs-deps change removed all non-essential x86 deps. This caused
the x86 subproject(s) on Windows to fail to configure due to being
unable to find x86 dependencies that do not exist.

Co-authored-by: PatTheMav <PatTheMav@users.noreply.github.com>
2024-08-28 18:26:47 -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
ddd586ae03 libobs: Allow scene items to use legacy absolute mode
This is to keep old collections running in relative mode until they
can be migrated.
2024-08-27 23:58:51 +02:00
derrod
1565ca8eb1 libobs: Change scene items to using relative coordinates 2024-08-27 23:58:51 +02:00
derrod
a50320464a libobs: Force sceneitem transform update if scene dimensions change 2024-08-27 23:58:51 +02:00
tt2468
16f0bb68ae libobs: Add OBS_ENCODER_CAP_SCALING
Adds a new encoder cap which tells libobs that rather than scaling
video frames in software, the encoder is capable of scaling them via
its own (presumably more efficient) means.

An encoder may implement this cap by comparing the VOI of its assigned
`video_t` and the results of `obs_encoder_get_width/height()`. If the
width/height values differ, then the encoder is being asked by libobs
to self-scale, and the resolution in VOI will be the raw frame size,
with the `...get_width/height()` being the intended output resolution
of the encoder.

It is important to note that GPU rescaling mode will take priority
over self-scaling. If GPU rescaling is enabled, the encoder will never
be asked to self-scale.

This is useful for discrete hardware encoders, where they might have
fixed-function video scaling logic that is highly efficient and fast.
Additionally, this feature allows a hardware device which is encoding
a full ABR ladder of tracks to be smart and only copy a video frame
from GPU -> Host -> Device once for the entire ladder, rather than
once for every track.
2024-08-23 14:20:53 -04:00
tt2468
92b5643081 libobs: Remove broken rescale modification logic
This logic would previously have written any changed scale resolution
set by the encoder in the `.get_video_info` callback back to the
encoder, however this functionality was "broken" by
20d8779d30. In reality, this would have
never worked with texture encoders or with GPU rescaling enabled, and
probably would have had odd side effects for CPU rescaling, too. It's
best just to remove this functionality.
2024-08-23 14:20:53 -04:00
derrod
f07004c3b7 libobs: Remove compatibility with FFmpeg < 6.1 2024-08-23 13:44:04 -04:00
PatTheMav
d81fcd70e0 cmake: Update cross-platform build project management for Windows
Enables creation of x64 and x86 child projects when building on ARM64
and decouples functionality from legacy_check function
2024-08-20 16:00:21 -04:00
derrod
c422a336fc libobs: Use weak reference for paired encoders 2024-08-18 22:35:34 -07:00
derrod
2c57f4564c libobs: Switch to full reference counting for encoders
Removes the "destroy_on_stop" hack that predates refcounting.
Ensures outputs hold strong references to all their encoders.
2024-08-18 22:35:34 -07:00
derrod
d7adbf1e24 libobs: Add NULL check to encoder deprecation warning 2024-08-18 22:30:03 -07:00
qhy040404
32b3517ef1 libobs: Also determine WinUI 3 Window 2024-08-17 17:16:06 -07:00
derrod
dac13eb144 libobs: Add warning if created encoder is deprecated 2024-08-18 01:20:38 +02:00
PatTheMav
b8cfacaec3 Update formatting of CMake files 2024-08-14 12:07:47 -04:00
Rodney
198581a475 libobs: Add source profiler 2024-08-10 23:51:39 -07:00
jcm
66ff8cb6d3 libobs: Always explicitly check modifiers in macOS hotkey event handler 2024-08-11 09:44:28 +10:00
Norihiro Kamae
9a9975890e libobs/callback: Remove unused static-inline function 2024-08-07 17:27:49 -04:00
Norihiro Kamae
4837a3417f libobs/util: Remove unused static-inline function
The commit 862f16285f commented the function out and the function became
unused.
2024-08-07 17:27:49 -04:00
Norihiro Kamae
d76f4b3aad libobs: Remove unused static-inline functions 2024-08-07 17:27:49 -04:00
Norihiro Kamae
71736ffb7d libobs/graphics: Add inline qualifier to functions in header files 2024-08-07 17:27:49 -04:00
derrod
95a753b9d8 libobs: Fix buffer overrun in os_wcs_to_utf8() 2024-08-06 08:34:24 -07:00
Florian Zwoch
e36352dadd libobs/util: Fix potential memory error in text parser
Fixes memory access when parsing '#' comment tokens when the file
immediately was EOF after this token.
2024-08-06 07:20:32 -07:00
Ryan Foster
5854f3b9e5 libobs: Update version to 30.2.2
I forgot to update this before tagging 30.2.1, so the updater won't stop
telling people there's an update available, even after updating.

Update this for real now to 30.2.2.
2024-07-23 11:56:59 -04:00
Ryan Foster
4f7be9b84b libobs: Update version to 30.2.1
I forgot to update this before tagging 30.2.1, so the updater won't stop
telling people there's an update available, even after updating.
2024-07-23 11:56:19 -04:00
Ryan Foster
02c1742b30 libobs/graphics: Prevent heap overflow in libnsgif
See upstream commit:
https://source.netsurf-browser.org/libnsgif.git/commit/?id=a268d2c15252ac58c19f1b19771822c66bcf73b2
2024-07-18 14:34:31 -04:00
Exeldro
1cb1864cc0 libobs: Fix crash when mix is NULL 2024-07-11 17:24:55 -04:00