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
jcm
3f1a868e05 libobs: Use 'important' usage key for macOS disk space calculations 2024-02-10 17:10:25 -06:00
Patrick Heyer
32ec6c17b5
libobs: Fix free disk space calculation on macOS (#10187)
New space availability keys seem to have very specific file system
requirements not documented anywhere. Using the opportunistic free
space key opportunistically (and falling back on the legacy value
otherwise) should always yield a "good-enough" free disk space value.
2024-02-03 17:35:09 -06:00
Lain
89288f1cf5 libobs: Update version to 30.1.0 2024-02-01 09:57:22 -06:00
Kurt Kartaltepe
ccfcbc2699 libobs: Copy both converted textures on stall for OpenGL
As the comment mentions this only occurs during an encoder stall on the
first frame. On D3D both gs_texture_t's are actually a single D3D
texture object and both planes are copied during gs_copy_texture, for
everyone else we need to copy the textures separately as they are
independent OpenGL textures.
2024-01-30 22:15:41 -06:00
derrod
20d8779d30 libobs: Prevent encoder reconfiguration after initialization 2024-01-29 17:35:11 -05:00
Kurt Kartaltepe
3e49e89611 libobs,libobs-opengl,libobs-d3d11: Add opengl gs_enum_adapters
This adds gs_enum_adapters and gs_get_adapter_count to the opengl
backend and promotes these to multiplatform graphics functions.

However we need to make an internal device change, device_enum_adapters
must pass in the current device on opengl to ensure that adapter #0 is
the display adapter. We do this to avoid changes to plugins already
checking against obs_video_info.adapter which is always 0 and expected
to be the device OBS was initialized on.

The actual implementation reports the dri render node (or /Software).
This allows plugins to query non-video features of the adapters like
VA-API/NVENC/etc or other cross device functionality. `/Software` is
chosen to avoid opening random files in the current directory if its
passed along as a file path like the regular dri render nodes.
2024-01-27 17:51:33 -06:00
Kurt Kartaltepe
02c90207fc libobs,libobs-opengl: enable GPU encoding for OpenGL
Enable all of the previously Windows only paths for OpenGL backends that
support encode_texture2

Co-authored-by: Torge Matthies <openglfreak@googlemail.com>
2024-01-26 20:01:58 -05:00
Torge Matthies
f81ed52ec7 libobs: Add encode_texture2 function to struct obs_encoder_info
And use it if non-NULL instead of encode_texture.
2024-01-26 20:01:58 -05:00
Ryan Foster
3fb529c0ee libobs: Use std _Pragma with MSVC
Instead of using the Microsoft-specific __pragma keyword, use the
standard _Pragma directive, which is now supported in C11 and C++11
/std modes.
2024-01-26 15:33:28 -05:00
derrod
aa730bcd4c libobs: Fix audio doubling with multiple main view mixes 2024-01-25 14:57:03 -05:00
Exeldro
c4c2f5b382 libobs: Fix GPU scaling using the main mix 2024-01-25 14:10:00 -05:00
derrod
a4b8e1a6a9 libobs/util,docs: Deprecate circlebuf 2024-01-16 16:45:10 +01:00
derrod
2963959e71 libobs: Replace circlebuf with deque 2024-01-16 16:45:09 +01:00
derrod
1938d65c9f libobs/util: Add deque 2024-01-16 16:44:12 +01:00
Lain
1e09f5a543
Merge pull request #10039 from derrod/roi-libobs
libobs/plugins: Add region of interest (ROI) encoder feature
2024-01-13 18:30:31 -06:00
Eric Lindvall
71d963a755 libobs/util: Implement error reader for ffmpeg posix pipe
Transition from using popen() to using fork()/dup2()/execl() to provide
a way to read stderr from ffmpeg.

Co-Authored by: PatTheMav <PatTheMav@users.noreply.github.com>
2024-01-13 18:20:26 -06:00
Rodney
d96ad4ac98 libobs: Add encoder ROI functions 2024-01-11 13:36:35 +01:00
jpark37
a8866fe3fa libobs-d3d11: Remove new/delete replacements
MSVC noticed inline is not allowed, and new/delete replacments also
don't belong in a header file. We're also just leaning on
__STDCPP_DEFAULT_NEW_ALIGNMENT__ being 16 for MSVC x64 now.
2024-01-11 04:02:31 -06:00
Lain
ae469d23e1 libobs/util: Fix function declaration
C functions that have no parameters should use (void) to signify that
they have no parameters, otherwise legacy C handling for parameters will
apply.
2024-01-07 15:59:09 -06:00
Lain
2fb7063e1a libobs: Defer media controls to video thread
To prevent sources from having to take too much extra consideration into
threading, defer the media control functions that directly affect
functionality to the video thread. Getters will still have to take
threading into account, but this should make things much more trivial
for media controls thread-wise.

(Lain note: Context: I noticed that things such as the slide show
require mutexes due to their media controls, and I felt that it was
largely unnecessary and that libobs should mitigate the threading issue
itself and keep it all in the video thread like it should be. Again, the
getters are still going to require *some* consideration into threading
but in terms of threading, for the type of stuff we're doing, querying
state is far more trivial to take into consideration.)
2024-01-07 15:59:09 -06:00
Lain
42bda5fb67 libobs/util: Add da_pop_front()
Doesn't really make sense that it was missing, so just add it.
2024-01-07 15:59:09 -06:00
Lain
9c9a50643a libobs: Do not allow controllable media without flag
The OBS_SOURCE_CONTROLLABLE_MEDIA flag is required for controllable
media callbacks to be usable. These checks are being added so we can
defer most controllable media callbacks to the video thread.
2024-01-07 15:59:09 -06:00
Lain
1151bc9dea libobs: Add a couple missing comments
(Lain note: This is mostly so more (yes more) can be added to this
god-forsaken structure without it getting too messy. In terms of actual
code, I need to be better about writing actual code comments. ...Meaning
that I actually need to start writing code comments.)
2024-01-07 15:59:09 -06:00
derrod
6fea91067f libobs: Pass parent pointer into signal_item_remove
With aaf8d8b38f changing the order
item->parent would be NULL thus resulting in a crash.
2024-01-07 02:28:53 +01:00
derrod
aaf8d8b38f libobs: Send item_remove signal after detaching item 2024-01-06 17:48:37 -06:00
jcm
78b6cf16c3 libobs: Use aligned memory allocator in Cocoa logging 2024-01-05 15:38:06 -05:00
jcm
2b38069709 libobs: Log Mac model identifier 2024-01-05 15:38:06 -05:00
derrod
f6c8fe7b64 libobs: Fix crop to bounding box not being duplicated with item 2024-01-03 22:03:16 +01:00
Robert Wittams
73e9561633 mac-capture: Allow selection of channels on core audio devices 2023-12-19 18:33:53 -05:00
PatTheMav
e065f2a839 libobs: Update CMake target source lists with alphabetic sorting 2023-12-19 17:59:44 -05:00
PatTheMav
9ae47a7937 cmake: Update FFmpeg find package to use explicit version 2023-12-19 17:59:44 -05:00
PatTheMav
8135085a23 cmake: Replace custom Qt discovery function with CMake default
find_qt was necessary during the transitional period between Qt5 and
Qt6. With Qt6 being the only supported Qt version (for open source) for
the time being, code complexity can be reduced for easier maintenance.
2023-12-19 17:59:44 -05:00
gxalpha
92ea7cb145 libobs: Remove obs-ui from public headers
This file got removed in 5177a593af and
as such should no longer be declared as a public header.
2023-12-17 22:13:47 +01:00
derrod
7e456d9dea libobs: Add automatic cropping to bounds for scene items 2023-12-16 18:00:11 -06:00
PatTheMav
c83f76db11 libobs: Fix disk space reporting for attached network drives on macOS
While the NSURLVolumeAvailableCapacityForOpportunisticUsageKey resource
correctly reports available disk space for local volumes (regardless
of actual file system used), it does not report actual values for
attached network drives.

The NSURLVolumeAvailableCapacityKey resource will still report
available disk space as expected, so use this value for non-local
volumes instead.
2023-12-16 17:13:29 -06:00
Lain
e958964bee libobs: Update version to 30.0.2 2023-12-10 14:04:03 -06:00
Exeldro
b05a401728 libobs: Render audio for all views 2023-12-10 03:35:11 -06:00
Norihiro Kamae
0f9376f1cb libobs: Fix audio-only output did not receive raw_audio 2023-12-09 18:52:17 -06:00
Lain
646adafc73 libobs: Update version to 30.0.1 2023-12-09 14:21:57 -06:00
sora-blue
8fc0489e4a
libobs: Fix scene_enum_sources skipping some active sources
If an item's show/hide transition was active the underlying source
would not previously not be enumerated, resulting in reference leaks by
the UI or other components waiting for the source to be deactivated to
release it.
2023-12-08 14:10:12 +01:00
derrod
ca865f80cc libobs: Pair video encoder with all audio encoders 2023-12-05 15:36:37 -06:00
derrod
b680700bba libobs: Remove unused wait_for_video flag 2023-12-05 15:36:37 -06:00
derrod
5177a593af libobs: Remove module UI functions 2023-12-02 18:09:20 -06:00
derrod
fc891295b6 libobs: Deprecate obs_view_get_video_info 2023-12-02 18:05:55 -06:00
derrod
5ea9fcc951 libobs: Add obs_view_enum_video_info 2023-12-02 18:05:55 -06:00
derrod
7c36257cc0 libobs: Fix obs_view_remove only resetting the first matching mix 2023-12-02 18:03:11 -06:00
derrod
49e796c6fc libobs: Fix GPU scaling always using the main mix 2023-12-02 17:47:33 -06:00
Stephen Seo
cd784644f5 libobs: Fence off unnecessary code due to FFmpeg v6.1 changes
Fixes for using FFmpeg 6.1 due to deprecations. Uses `#if` macros to
allow builds for using older versions of FFmpeg.

This commit prevents obs from using the "fenced" code if using FFmpeg
6.1, since in FFmpeg commit [1] the "side_data" is added to
`AVCodecParameters`, and therefore the existing/following
`avcodec_parameters_copy(...)` will account for the metadata.

[1]: avcodec/codec_par: add side data to AVCodecParameters
21d7cc6fa9
2023-12-02 17:43:18 -06:00
derrod
f5b7c98d2d libobs: Reuse matching mix's render texture if possible
Avoids re-rendering a view if a previous mix with identical settings
has already rendered it
2023-12-02 17:36:48 -06:00
tt2468
05d52ee3a7 libobs: Fix PTS incrementation when FPS divisor is enabled
When using a PTS divisor, OBS would still increment the PTS by only the
original `fps_den` value, not considering that PTS values should be
multiplied by the divisor.

For example, `60/1` increases like `0,1,2,3`. `60000/1001` increases
like `0,1001,2002,3003`.

Without this fix, `60/1` main OBS framerate with a divisor of `2`
produces `0,1,2,3`, while the correct pattern would be `0,2,4,6`
2023-11-29 16:23:24 +01:00
Lain
e358244521 libobs: Fix possible minor memory leak
If this array reserves memory, but doesn't end up pushing any sources
back to the array, then it'd result in a memory leak.
2023-11-26 20:06:51 -06:00
Exeldro
1265950eaf libobs: Don't keep filter mutex in obs_save_source
While filters are saved using obs_save_source other mutex are used.
To prevent a deadlock, don't keep the filter mutex iterating the filters.
This fixes #9893
2023-11-25 20:49:50 -06:00
derrod
2385a3f0f8 libobs/util: Remove unused struct member from text-lookup 2023-11-25 17:09:47 -06:00
Norihiro Kamae
16fed06927 libobs/media-io: Fix link error including a header file from C++ 2023-11-25 17:04:47 -06:00
Norihiro Kamae
2c4d54dd1b libobs/util: Fix link error including header files from C++ 2023-11-25 17:04:47 -06:00
tt2468
76f332a379 libobs: Consolidate scene item remove code
Removes the internal helper `remove_without_release()` and branches
`obs_sceneitem_remove()` into public and internal versions.

The `obs_sceneitem_set_transition()` calls were missing from the
`remove_without_release()` function, so this resolves that issue
implicitly. Code cleanup mentioned above is done to hopefully avoid
these mistakes again.
2023-11-18 17:30:11 -06:00
PatTheMav
4a765d3bf0 libobs: Use macOS specific APIs to report free disk space 2023-11-18 17:16:16 -06:00
derrod
845a4a6f64 libobs: Remove superfluous NULL checks 2023-11-17 11:04:33 -05:00
Norihiro Kamae
9391ab305e libobs: Fix memory leak when migrating from legacy scene item data
Before the commit 763dddbbaf, hotkeys to show and hide scene items are
distinguished by source name instead of ID. When migrating from the
legacy data structure, the pointer to the data was not released.
2023-11-16 16:27:23 -05:00
tt2468
3e6797ca5b libobs: Fix crash in obs_sceneitem_remove() when already removed
An already-removed item has a NULL `item->parent`, meaning that calling
`full_lock(scene)` results in undefined behavior. This makes the method
return earlier if the specified item is removed instead of attempting
to lock the scene.

No thread safety is changed, because it wasn't thread-safe to begin
with.
2023-11-13 22:37:42 -08:00
Norihiro Kamae
40562ff47e libobs: Expose obs_data_set_autoselect_array 2023-11-10 02:10:43 -06:00
tt2468
3b0ca4527a libobs: Add obs_reset_audio_monitoring()
Reloads all audio monitoring devices
2023-11-07 01:32:12 -06:00
Igor Bochkariov
b081adf72e libobs: Fix crash when plugins delete properties in callback
If a plugin removes a property when processing 'modified'
property callback, OBS WILL CRASH.

Example of offending plugin: obs-source-record

This commit moves callback processing to after iterating over
properties, thus removing the chance to crash OBS.
2023-11-04 23:31:07 -05:00
jpark37
e79e28598b libobs,obs-filters: Use common straight alpha math
This pattern uses fewer instructions and also avoids using max, which
does not work on infinity.

Also remove unreferenced techniques from scale filters.
2023-11-04 18:12:22 -05:00
David Rosca
722ca8447e libobs: Add AV1 parsing functions
One notable difference from the AVC/HEVC code is that it also inserts
the METADATA and SEQUENCE_HEADER OBUs into new_packet, otherwise the
resulting video file wouldn't play.
2023-11-04 01:16:25 -05:00
PatTheMav
5127c22773 libobs: Add more files to list of public headers 2023-11-02 11:50:30 -04:00
PatTheMav
ff2a7063c2 libobs: Export SIMDe headers unconditionally for plugin development 2023-10-26 18:20:53 -04:00
gxalpha
7aa18609a1 libobs: Replace kAudioObjectPropertyElementMaster with Main 2023-10-17 16:45:36 -04:00
Rodney
3869cb83bc libobs: Fix rendering stats not being logged on output stop 2023-10-13 11:05:19 -05:00
derrod
731da1be6b libobs: Fix hotkeys when reordering sceneitems into/out of groups 2023-10-08 02:00:46 +02:00
derrod
763dddbbaf libobs: Distinguish sceneitem hotkeys by id 2023-10-08 02:00:46 +02:00
derrod
4bb2365a62 libobs: Specify scene item IDs on creation 2023-10-08 02:00:46 +02:00
Lain
64e26b2969 libobs: Use same ver. in obs-config.h for betas/RCs 2023-10-06 18:23:49 -06:00
derrod
e11ffeccb0 cmake/libobs: Only set beta/rc increment 2023-10-06 17:21:51 -06:00
Exeldro
82864559f2 libobs: Fix errors for gs_effect_create 2023-10-06 10:51:15 -06:00
jpark37
e11e2133e2 libobs,obs-filters: Fix NAN when tonemapping
Can happen when colors are wider than Rec. 2020.
2023-10-04 19:33:54 -04:00
PatTheMav
aaca2b6e73 libobs: Fix duplicate symbol resolution for obs plugins
By default duplicate non-static symbols loaded by dynamic libraries are
de-duplicated by the dynamic library loader. This can lead to issues
with statically linked libraries inside obs plugins if the symbols
share their signature: Whichever plugin is loaded first gets to "set"
the symbol (which can become problematic especially for C++ template
functions).

Using RTLD_LOCAL ensures that all symbols are hidden and can only be
explicitly loaded using dlsym() which avoids this issue.

Unfortunately due to the way scripting works in obs-studio, Python
still needs to be loaded with RTLD_GLOBAL, hence the branch in the fix.
2023-09-23 16:31:14 -07:00
Neal Gompa
491d7c0e98 libobs: Add license declaration files 2023-09-19 13:35:49 -04:00
derrod
62500b5129 libobs: Do not skip async frames unless one has been selected 2023-09-16 22:19:07 -07:00
Norihiro Kamae
2036de8ec3 libobs: Fix obs_output_video and obs_output_audio for encoded output
The API `obs_output_video` and `obs_output_audio` returned valid
pointers until the commit fb57eff21 and 645e31fa1.
The API `obs_output_video` is used by some plugins such as obs-websocket
and obs-midi to calculate the duration of streaming and recording.
To have a similar behavior, return the media (video and audio,
respectively) from the encoder.
2023-09-06 23:36:06 -07:00
PatTheMav
87dd366448 libobs: Remove old macOS guards for NSProcessInfo
With the lowest deployment target being macOS 11.0, there is no need
to check for the availability of the selectors on the NSProcessInfo
class anymore.
2023-09-05 14:39:00 -04:00
PatTheMav
7f8a55d0bb libobs: Fix warnings about implicit integer downcasts in macOS code 2023-08-31 17:52:08 -04:00
PatTheMav
6ebff6a204 libobs: Suppress warnings about implicit integer downcasts
Returned values are usually 64-bit in length but commonly stored in
16-bit integers anyway.
2023-08-31 17:52:08 -04:00
Richard Stanway
fef92a8a43 libobs: Log if CreateProcessW fails on Windows
This is used by the test programs as well as ffmpeg-mux. If a process
fails to start it's quite bad so we would like to know why.
2023-08-26 16:44:53 -07:00
Lain
867938cd9d libobs: Do not hide OBS_NIX_PLATFORM_WAYLAND behind ifdef
Really no reason to make it so this value can't be used.

Fixes obsproject/obs-studio#9454
2023-08-24 13:32:33 -07:00
Lain
45e7334206 libobs: Fix shader fix not working on D3D11
In c8d95005c1, it was incorrect assumed that just because the fix
worked on OpenGL, that the fix would also work on D3D11. Automated tests
would be ideal here, although if there were automated tests, ironically,
it wouldn't have picked this up, because we (read: I) made D3D11 fall
back to OpenGL of D3D11 failed. Basically there is no one to blame but
myself again.

This time, we've removed the OpenGL fallback in a06d6893b9 (thank you
Rodney), and additionally I properly tested on both rendering backends.

(Lain note: I'm just going to go sit in the corner for a bit and
ruminate after this)
2023-08-16 11:19:08 -07:00
Lain
2edb9f3151 libobs: Fix default.effect not working with OpenGL
Due to my jank transpiler, default.effect worked with Direct3D 11 but
not with OpengGL. Fixing this particular bug with the transpiler is a
bit non-trivial so instead just modify the shader to work with both.
2023-08-15 17:11:23 -07:00
Norihiro Kamae
fa9b7b042f libobs: Remove starting_frame_count from obs_output_t
The member variable `starting_frame_count` was set but never read.
2023-08-15 16:00:21 -07:00
Norihiro Kamae
fb57eff212 libobs: Fix holding possibly released pointer in obs_output_t
When `obs_output_t` is an encoded output, `obs_output_set_media` will
ignore the video and audio so that `obs_output_t` will keep holding the
`video_t` and `audio_t` pointer when the output was created.
By this commit, `video` and `audio` member variables in `obs_output_t`
will never set if it is an encoded output.
In the auto-configuration wizard, `video_t` is released and created to
have a different video size while `obs_output_t` is not released. This
resulted in accessing the released `video_t` pointer.
2023-08-15 16:00:21 -07:00
jpark37
40edda536d libobs/media-io: Relax color space comparison
Allow VIDEO_CS_DEFAULT to avoid slow conversions.
2023-08-15 13:15:45 -07:00
jpark37
3e80fff18e libobs: Add DrawAlphaDivide variant shaders
Useful for future 10-bit HDR DeckLink playback support.
2023-08-15 13:15:45 -07:00
PatTheMav
7628265099 Update .clang-format rules for ObjC files for version 16 2023-08-10 17:12:30 -04:00
Ryan Foster
64139a6bbd CI: Update to clang-format 16
This commit also modifies UI, libobs, and plugins.
2023-08-10 16:07:25 -04:00
Ryan Foster
39b4df12c8 libobs/util: Define PRAGMA_WARN_DEPRECATION for MSVC
Define PRAGMA_WARN_DEPRECATION for MSVC to enable using that define for
cross-platform code, which allows us to write slightly less code when we
need to suppress this warning.
2023-08-09 13:47:05 -04:00
Lain
796e2d5815
Merge pull request #9339 from tytan652/prevent_simde_contamination
Contain simde diagnostic pragmas and replace variable-length arrays
2023-08-05 17:10:33 -07:00
PatTheMav
1b194c8ebd libobs: Add local event monitor for hotkey thread
To avoid a mismatch between the state of pressed keys as held by the
hotkey thread and keys pressed while the application is in focus, local
key events need to be monitored as well (even though they are already
handled by Cocoa's main event loop).
2023-08-05 16:48:53 -07:00
Ryan Foster
fc693f9c3d libobs: Update CMake minimum to 3.22
Since Ubuntu 22.04 is now our minimum supported Ubuntu version, and it
has CMake 3.22, let's make CMake 3.22 the minimum CMake version.
2023-08-05 16:45:46 -07:00
tytan652
852dcf6f15 libobs/util: Contain simde diagnostic pragmas 2023-08-06 01:31:02 +02:00
tytan652
54bacd4f10 libobs: Remove variable-length array 2023-08-06 01:31:02 +02:00
cg2121
620eff0768 libobs: Make video frame header public
This fixes compilation of third party plugins that need this
header.
2023-08-03 16:02:56 +02:00
derrod
117534368b libobs: Profile graphics initialisation and shader compilation 2023-08-02 04:48:43 -07:00
jpark37
7669da1ea8 libobs: Add VIDEO_FORMAT_R10L
Support 10-bit packed format that DeckLink uses.
2023-07-29 16:41:31 -07:00
tytan652
c6ce50c9a3 deps,libobs,plugins: Remove in-tree Jansson
Jansson is provided by other means on any supported platform.
2023-07-29 16:37:14 -07:00
Ryan Foster
f7d3ba7b1b libobs: Check if adapter can safely fast clear 2023-07-29 16:34:47 -07:00
Ryan Foster
e5d5df879c libobs: Add function to check fast clear capability 2023-07-29 16:34:47 -07:00
CodeYan01
a494cf5ce4 libobs: Add obs_source_info.filter_add
If there is filter_remove, it is reasonable to expect that there is also
filter_add. filter_add also enables filters to attach signal handlers
on the parent, and disconnect them in filter_remove.
2023-07-29 16:15:21 -07:00
Ruwen Hahn
ac8ccf4027 libobs: Fix GPU scaled video encoder media not being cleared
During encoder shutdown `maybe_clear_encoder_core_video_mix` is
called to clear created mixes that are no longer needed; at that
time `obs_encoder_set_video` rejects changes to `media` since
the encoder is still active, so we bypass those checks

This is an issue e.g. when a rtmp stream disconnects (and thus
all encoders are cleared) and subsequently reconnects
2023-07-26 05:03:12 -07:00
Penwywern
23ca4cf704 libobs: Fix flip calculations in bounding box
This fixes flipping behaviour when positional alignement inside the
bounding box is other than centered, bringing it in line with the
behaviour when centered, i.e. flip the item in-place in the bounding
box.
2023-07-25 16:01:04 -07:00
derrod
d90bfc5e0b libobs: Add obs_add_safe_module() 2023-07-21 23:22:07 +02:00
cg2121
cb8b5ba9cd libobs: Change return type for getting filter index
This changes the return type for getting the filter index from a
size_t to an int. This makes it easier for developers to use,
as an invalid index just returns a -1.
2023-07-20 13:21:14 -07:00
gxalpha
5ed0b8a0b8 libobs: Assume Qt 6, always warn about Qt 5 plugins 2023-07-19 11:56:54 -04:00
Chensiyy
41e2791f27 libobs: Fix PROPVARIANT variable has not be freed
The PropVariantClear function frees all elements that can be freed in a given PROPVARIANT structure.
2023-07-15 16:38:24 -07:00
Richard Stanway
4118fa7ac1 libobs: Don't defer encoder updates if not necessary
When #5169 implemented deferred encoder updates, it did not account for
the case when the encoder hadn't started yet. This means the encoder would
start and then immediately call update with the same settings it was
started with, which in the case of some hardware encoders would trigger
a reconfiguration request to the driver.
2023-07-15 16:31:19 -07:00
gxalpha
55237ab2ef libobs: Export more libobs/util headers 2023-07-15 16:17:42 -07:00
derrod
dcc07cfe4e clang-format: Set AllowAllConstructorInitializersOnNextLine to false 2023-07-15 16:14:55 -07:00
derrod
1739272c44 clang-format: Set AllowAllArgumentsOnNextLine to false 2023-07-15 16:14:55 -07:00
Clayton Groeneveld
e121ac1587 UI, libobs: Add RAII wrappers for faders/volume meters
They can now be automatically deleted.
2023-07-15 16:06:36 -07:00
Ryan Foster
80864197fb libobs: Fix back-to-back GPU encoder sessions breaking
Reset frame_rate_divisor_counter to 0 on encoder shutdown.

After starting and stopping a GPU encoder session, obs_encoder_shutdown
would set frame_rate_divisor_counter to 1. When the next GPU encoder
session was started, in libobs/obs-video-gpu-encode.c, gpu_encode_thread
would set skip to this value (1), and increment
frame_rate_divisor_counter to 2. This causes the next check to fail, as
frame_rate_divisor is 1 by default (2 == 1 is false), so
frame_rate_divisor_counter retains its value. Since skip is non-zero,
the next check, if(skip), passes, and skip to the next loop iteration.

This will continue forever, because frame_rate_divisor_counter will
continue to increment, so it will never hold the same value as
frame_rate_divisor. This means that send_off_encoder_packet is never
called, so the muxer never receives encoded packets.

To the end-user, this manifests as their second encoder session being
impossible to stop. They then have to force quit OBS and the
obs-ffmpeg-mux process. This change prevents that from occurring and
allows multiple back-to-back GPU encoder sessions to be completed.
2023-07-14 11:56:28 -04:00
derrod
c939525f77 libobs: Remove legacy FFmpeg compatibility 2023-07-12 15:57:43 -04:00
Norihiro Kamae
bc6cfab615 libobs/util: Remove outdated comment 2023-07-12 13:54:50 -04:00
Penwywern
8789c43959 libobs: Fix flip not working with stretch to bounds 2023-07-08 16:42:15 -07:00
Sergo
e4a3f80f9f libobs: Add use of pause callbacks to CoreAudio monitoring 2023-07-06 15:24:12 +02:00
Sergo
9eea0d8921 libobs: Add pause callback support for sources 2023-07-06 15:24:12 +02:00
Ruwen Hahn
6cdfb0a8b9 libobs: Allow configuring frame rate divisor for encoders
This allows encoders/outputs to output at a frame rate that is lower
than the configured base frame rate
2023-07-03 09:35:06 -07:00
Norihiro Kamae
8169188f89 libobs: Define DARRAY macro types
To avoid passing `struct darray *` type, which cannot hold the type
information, this commit defines array types and uses that types on the
function parameters.
2023-07-01 00:39:13 -07:00
Norihiro Kamae
c8e3794a35 libobs/graphics: Remove undefined function declarations
These functions were declared but never defined. Let's just remove them.
- effect_upload_shader_params
- ep_param_writevar
- effect_upload_params
2023-07-01 00:39:13 -07:00
Norihiro Kamae
fa02582db6 libobs/graphics: Define DARRAY macro types used in effect 2023-07-01 00:39:13 -07:00
Norihiro Kamae
a4ddaf528a libobs/util: Use defined array types on function parameter lists
To avoid passing `struct darray *` type, which cannot hold the type
information of the array element, use defined array types on the
function parameter lists.
2023-07-01 00:39:13 -07:00
Norihiro Kamae
03b679d68e libobs/util: Remove unnecessary parentheses
The previous commit added parentheses inside the macros so that the
parentheses is unnecessary when using the macros.
2023-07-01 00:39:13 -07:00
Norihiro Kamae
6425d53ff0 libobs/util: Fix operator precedence in dyamic array macros
Passing DARRAY with an operator such as dereference (`*`) sometimes
caused a compile error. To avoid the error, introduced parentheses
inside the macros.
2023-07-01 00:39:13 -07:00
PatTheMav
89625715fc cmake: Fix configuration errors with Windows legacy path
By default Windows builds use the legacy CMake code paths, which ideally
work as-is with existing build directories.
2023-06-30 11:56:57 -04:00
PatTheMav
db895092ed cmake: Add changes for CMake build framework 3.0
New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or
greater, old functionality remains unchanged.
2023-06-29 10:11:32 -04:00
derrod
0cb812251c libobs: Add scene uuid to transform state data 2023-06-28 11:04:56 -07:00
Ruwen Hahn
03fa9acc7f libobs: Add obs_encoder_enable_gpu_scaling
Allows rescaling resolution for GPU encoders and allows moving
rescaling for CPU encoders from CPU to GPU

Rescaling is implemented via core video mixes; encoders create
their own core mix with matching width/height/format/colorspace/
range when gpu scaling is enabled and no matching core video
mix exists
2023-06-26 13:32:25 +02:00
gxalpha
f37876a941 libobs: Fix obs_output_get_height2 returning width 2023-06-25 16:06:49 -07:00
Richard Stanway
896cd4adb2 libobs: Detect and log presence of Lenovo Vantage on Windows
This software seems to be pre-installed on many Lenovo systems and has a
"Network Boost" feature that restricts data usage of background apps,
causing throughput issues when streaming with OBS.
2023-06-24 16:31:21 -07:00
cg2121
243d4d42e9 libobs: Add functions to get/set the index of filters 2023-06-21 15:33:48 -07:00
PatTheMav
59904a66a3 cmake: Update Framework link definition for macOS builds 2023-06-17 12:23:33 -04:00
PatTheMav
50a4e83251 cmake: Remove Info.plist template files for macOS builds
Creation of Info.plist files through Xcode is more canonical and
future-proof, as it will automatically pick up changes/updates
introduced by Apple. Non-standard keys can still be added via a
template file, which will then be extended by Xcode with the default
keys.
2023-06-17 12:23:33 -04:00
Lain
1bbb3fa773 libobs: Update version to 29.1.3 2023-06-17 00:44:00 -07:00
PatTheMav
3ca56fee84 libobs: Silence clang warnings for empty prototypes without void
clang expects an empty prototype to explicitly use `void`.

Also silences the warning in `libobs-opengl`, `obsglad`, `caption`,
`mac-syphon` and `obs-x264-test`.
2023-06-16 14:12:58 -04:00
John Bradley
8981afe5b4 libobs: Set video thread qos class to user interactive on macOS 2023-06-15 15:25:47 +02:00
Ruwen Hahn
9b5ce9fcec
libobs: Fix null pointer access for video packets
Initialize arrays to 0, as otherwise these can get initialized with 
garbage data or potentially Visual Studio's default debug marker,
which is a problem if they're being checked against `NULL` later.
2023-06-14 19:52:05 +02:00
John Bradley
6ec0b2db11 libobs: Add support to obs-outputs for multi video encoders
This adds support in outputs to handle multiple video encoders
and their interleaving with the encoded audio.
2023-06-14 02:24:54 -07:00
PatTheMav
f8e00d6071 clang-format: Update formatting of all ObjC and ObjC++ files 2023-06-11 14:56:45 +02:00
derrod
263781c6c6 libobs: Fix crash when properties are deleted in callback
(cherry picked from commit 447710ab2c)
2023-06-11 02:18:17 +02:00
gxalpha
79822a58c3 libobs,plugins: Remove new obs_output_*2 functions
Effectively reverting parts of d314d47, this commit removes the new
functions that got added to remove the flags parameter. Instead, it just
marks the parameter as unused and documents this. Having what is
effectively an API break just to remove a parameter is a bit overkill.
The other parts of d314d47 which cleaned up the usage of the flags
parameter are untouched here.
2023-06-10 16:13:05 -07:00
Lain
1aed7ed114 libobs: Use da_clear() to clear obs_core_data::sources_to_tick
Makes it a bit more clear what's going on
2023-06-10 14:30:44 -07:00
Lain
85ca5a25be libobs/util: Add da_clear()
Adds a bit more of an explicit function for clearing dynamic arrays
2023-06-10 14:29:33 -07:00
Exeldro
a77789b266 libobs: Don't keep the sources mutex in tick_sources
Allow other threads to use sources while the graphics thread does
video_tick, update, activate and deactivate on sources
2023-06-10 14:20:13 -07:00