Commit graph

2755 commits

Author SHA1 Message Date
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
Lain 9178ec6a8d libobs/util: Actually fix use-after-free in da_insert_new
d040de51bb was prematurely merged, this
should actually do the job as requested.
2023-06-10 12:31:41 -07:00
Norihiro Kamae d040de51bb libobs/util: Fix use-after-free in darray_insert_new
After the array is allocated in `darray_ensure_capacity`, the pointer
`item` is invalid.
2023-06-10 11:54:27 -07:00
Sean DuBois ed577a05aa libobs: Add bearer token to obs_service_connect_info
This adds a new OBS_SERVICE_CONNECT_INFO_BEARER_TOKEN which is needed for WHIP output.

Signed-off-by: pkv <pkv@obsproject.com>
2023-06-09 20:20:49 -05:00
Florian Zwoch dd6841143d libobs/util: Do not include SIMDe for MinGW targets
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.
2023-06-09 04:48:54 -07:00
kyle 40ed16637c libobs: Remove duplicate debug symbol paths in Windows 2023-06-08 00:25:27 -07:00
PatTheMav 2966c4030e libobs: Use static library for version string information
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
2023-05-27 16:48:24 -07:00
Lain 8bbc959a03 libobs: Update version to 29.1.2 2023-05-27 14:49:56 -07:00
tt2468 a696470c9e
libobs: Remove warning log for raw outputs when starting data capture
#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.
2023-05-27 13:18:41 -07:00
gxalpha ad9fd6c6f0 libobs,UI: Add properties radio button list 2023-05-20 16:48:23 -07:00
gxalpha f049962bb2 libobs: Add properties list boolean format 2023-05-20 16:48:23 -07:00