0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

9623 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
712478f48c libobs/nix: List Flatpak search paths
The proposed way to handle plugin distribution
through Flatpak depends on these directories to
be read. It goes as follows:

 1. Flatpak's extension point merges the 'lib'
    and 'share' directories at /app/plugin

 2. Plugins prefix their install paths in the
    Flatpak manifest to /app/plugins/<plugin name>

 3. OBS Studio lists /app/plugin as one of the
    search paths in OBS Studio code

This commit implements the third step of this
process, which is the only one that actually
involves OBS Studio itself.

With that, it is possible to distribute plugins
as Flatpak extensions, which in turn allows them
to be listed at app stores such as GNOME Software,
elementary's app store, and KDE's Discover.

Related: https://github.com/flathub/com.obsproject.Studio/issues/135
2021-07-08 10:53:15 -07:00
Bruce Zhang
7baf08e917 rtmp-services: add bilibili live 2021-07-08 09:44:28 -07:00
Georges Basile Stavracas Neto
ec3e8146b2 pipewire: Properly pass sizes to gs_draw_sprite_subregion
The gs_draw_sprite_subregion() function is used when a cropping
rectangle is received from PipeWire. It is usually used by
compositors to implement window screencast - where a large and
mostly empty frame is sent, the window contents are only a small
part of it, and the crop rectangle tells us that.

Recently the wlroots implementation of portals started to use it
to implement cropping, and it exposed a bug in the PipeWire code
in OBS Studio. The gs_draw_sprite_subregion() function takes a pair
of integers representing position (x, y) and a pair of integers
representing size (width, height). The PipeWire code, however,
passes a second pair of positions (x2, y2) instead of sizes, and
it causes overrendering the crop area.

This bug wasn't hit yet because both GNOME and KDE implementations
always send (0, 0) as position, which practically never trigger
this condition.

Pass only width and height to gs_draw_sprite_subregion(), instead
of adding x and y to them.

Fixes https://github.com/obsproject/obs-studio/issues/4982
2021-07-08 08:32:55 -07:00
jpark37
4d9d7b7070 obs-filters: Fix comparison type mismatch 2021-07-06 14:08:28 -07:00
jpark37
880eac5b24 obs-ffmpeg: Fix comparison type mismatch 2021-07-06 14:08:28 -07:00
jpark37
b94fbac7ef libobs: Fix warnings
Cast away truncation, and widen type before multiplication.
2021-07-06 14:08:28 -07:00
Norihiro Kamae
ed76a3032b text-freetype2: Add alpha channel property
Use obs_properties_add_color_alpha to set alpha for text colors.
2021-07-04 12:16:09 -07:00
jpark37
49cfd2426f mac-syphon: Use DrawOpaque as necessary
Treat "Allow Transparency" to mean alpha should be 1.0. Skipping alpha
writes can cause alpha to stay 0.0, which is not desired.
2021-07-04 10:35:54 -07:00
jpark37
b70161bc67 libobs: Add DrawOpaque for rect effect
Needed by Syphon Client.
2021-07-04 10:35:54 -07:00
Norihiro Kamae
5e44e6412a libobs: Fix memory overrun if libobs version mismatches
When size of source_info_t is larger then current structure, memcpy
overruns. Size check is moved before the memcpy.

HANDLE_ERROR macro copies info to data but data is not used. When
calling free_type_data and type_data, the member of data should be used
to ensure the free_type_data is not out of bounds.
2021-07-04 08:49:42 -07:00
Matt Gajownik
5485a91d4c UI: Log Show/Hide transitions on scene collection load 2021-07-04 08:25:33 -07:00
Richard Stanway
a82bb12848 cmake: Enable full optimizations for RelWithDebInfo MSVC builds
Adds compiler flag:
/Ob2 (automatic inline expansion)

And linker flags:
/OPT:ICF (identical COMDAT folding)

Ref: https://gitlab.kitware.com/cmake/cmake/-/issues/20812
2021-07-04 05:26:38 -07:00
Rat
c1deaf9c3f UI: Fix audio mixer UI not updating from threads
When changing a source's audio mixers/tracks or sync offset with
obs_source_set_audio_mixers or obs_source_set_sync_offset
from a non UI thread while the advanced audio properties panel is open
the UI fields will not update until closed and reopened.

It just shows an error on stderr for the failed invokeMethod calls
that would do the update. For mixers and sync offset respectively:
QMetaMethod::invoke: Unable to handle unregistered datatype 'uint32_t'
QMetaMethod::invoke: Unable to handle unregistered datatype 'int64_t'

Added needed Qt registrations in window-basic-main as that's where
all the needed ones for the frontend UI seem to be put.
2021-07-04 04:34:06 -07:00
Exeldro
93205e5729 libobs/callback: Fix signal_handler_disconnect_global 2021-07-04 04:32:45 -07:00
jp9000
16a49eb10d rtmp-services: Fix implicit function declaration 2021-07-02 07:26:37 -07:00
jp9000
84e6ad2b6d rtmp-services: Update Facebook recommended settings
Adds support for 1080p streams, adds support for 60 FPS streams,
implements bitrate matrix to restrict bitrates depending on the user's
resolution and framerate combination, and removes 480x360, as it was the
incorrect resolution (the correct resolution was supposed to be
640x360).
2021-07-02 07:07:26 -07:00
jp9000
0c8d19147e rtmp-services: Implement bitrate matrix
The bitrate matrix allows specifying maximum bitrate values based upon
resolution and framerate values. This allows more fine-tuned enforcement
of bitrate to prevent users from setting a bitrate that is less ideal
for their particular framerate and resolution combination.
2021-07-02 07:04:24 -07:00
gxalpha
7526bf76ff UI: Check if recording is paused when trying to pause
Adds a safety check to the pause-functions, double-checking that they
won't be called whether it is already in the desired state
2021-07-01 00:23:58 -07:00
Developer-Ecosystem-Engineering
0fd153f9e1 mac-capture: Update display names
Display names for captured displays should render human readable
2021-06-30 01:52:04 -07:00
Georges Basile Stavracas Neto
fdce267a9a linux-capture: Use portal's D-Bus on PipeWire captures
Intead of creating one pair of GDBusConnection + GDBusProxy objects
for each PipeWire capture, be it window or desktop, use the global
ones managed by portal.c.

Even if g_bus_get_sync() ends up reusing the same object under the
hood, it's still a net gain, since it has to perform some thread
synchronization routines that aren't necessary here. Creating the
proxy object was a worse offender, because despite being asynchronous,
it would still incur in a few socket messages + a cancellable fd +
thread synchronization.

Reuse these objects from portal.c. The biggest code change here is
that create_proxy() and on_proxy_created_cb() were merged into
init_obs_pipewire().
2021-06-30 01:51:02 -07:00
Georges Basile Stavracas Neto
e1c38a1f77 linux-capture: Add getters for portal's D-Bus connection and proxy
It'll be used by the next commit to reuse these objects instead of creating
one per capture.
2021-06-30 01:51:02 -07:00
Georges Basile Stavracas Neto
c18f1ea7ed linux-capture: Conditionally register PipeWire captures
Right now we just assume that every compositor and portal implementation
exposes both window and monitor captures, but that's not true, and in fact
the Desktop portal provides a simple mechanism to check which source types
are available: a D-Bus property called "AvailableSourceTypes".

Read this D-Bus property, and use it to conditionally register the desktop
and the window captures.

Related: https://github.com/obsproject/obs-studio/issues/4815
2021-06-30 01:51:02 -07:00
jpark37
998884a8e6 obs-qsv11: Update Intel Media SDK to 2021 R1
Verified my Rocket Lake CPU works now.
2021-06-30 01:49:06 -07:00
Matt Gajownik
cf9899bade UI: Handle HTTP errors for fetching remote files 2021-06-30 01:46:50 -07:00
Matt Gajownik
1517062251 UI: Handle & log HTTP errors for RemoteTextThread
This includes the Patreon fetcher & the log/crash report uploader
2021-06-30 01:46:50 -07:00
Ryan Foster
85ffdd57f4 win-capture: Return early in property callbacks if param is null
When obs_get_source_properties is called, it calls the property modified
callbacks without a source instantiation. The callbacks set in
.get_properties for display capture and window capture would then result
in exceptions when anything is dereferenced on the source, such as
wgc_supported or update_mutex, because the source itself is null. Let's
make the callbacks return early if the property param is null.
2021-06-30 01:45:42 -07:00
Ryan Foster
1da97fb0d0 win-capture: Check for WGC support on plugin load
We shouldn't have to check WGC support for every display capture or
window capture source. Either the system supports it or it doesn't.
Check when the plugin loads and use that result.
2021-06-30 01:45:42 -07:00
Ryan Foster
2f3c0911fa win-capture: Determine D3D11 usage once per run
The device type (OBS renderer) cannot change without restarting OBS, so
we should only have to check if we're using D3D11 once instead of
checking every time a new display capture or window capture source is
created.
2021-06-30 01:45:42 -07:00
Ryan Foster
1fa45e63a3 UI: Remove fractional scaling ifdefs
Among the systems we officially support, the oldest Qt version is Qt 5.9
on Ubuntu 18.04. Fractional scaling is supported in Qt 5.6 and newer. We
should be able to safely remove these ifdefs.
2021-06-30 01:42:01 -07:00
Ryan Foster
b496f43d45 UI: Make projector display resolutions DPI-aware
Follow up to PR #3988 and commit
5cdd084c7f.
Without this change, displays listed as projector targets on systems
using a fractional scaling factor (e.g., 125%, 150%, 175%) will show an
incorrect width and height for their size. For a display with 125%
scaling, OBS would show 1536x864 instead of 1920x1080. With this change,
it will show 1920x1080.
2021-06-30 01:24:02 -07:00
jpark37
4002995b86 libobs-winrt: Use better Windows SDK version check
Latest Windows SDK has a macro for borderless window capture support.
2021-06-30 01:23:03 -07:00
Exeldro
62d0661f98 obs-ffmpeg: Don't purge packets when there are none 2021-06-29 08:40:13 -07:00
Georges Basile Stavracas Neto
6942bb814d pipewire: Properly account for cursor hotspot
The cursor bitmap is centered on the hotspot, so not accounting
for it means PipeWire captures were positioning the cursor sprite
slightly off.

Properly account for the hotspot by subtracting it from the cursor
position.

Related: https://github.com/obsproject/obs-studio/issues/4766
2021-06-22 19:36:15 -07:00
jp9000
f7dcb6afd6 UI: Fix win uninstall not deleting desktop shortcut
The Windows uninstaller was not deleting the desktop shortcut because
the shell context was incorrectly set to "current" for it, causing it to
try to delete in the incorrect location.
2021-06-22 19:05:43 -07:00
Matt Gajownik
3cc4feb8dd UI: Fix code indentation for Edit Undo/Redo 2021-06-13 15:36:22 +10:00
Matt Gajownik
dcd491541e UI/installer: Silently install Visual C++ Redist
Requires redistributables in the install build directory.
2021-06-11 23:12:30 -07:00
jpark37
cd5873e9bc UI: Fix unused parameter warning 2021-06-11 07:20:50 -07:00
Translation
ef2b1eb1c6 Update translations from Crowdin 2021-06-11 07:18:15 -07:00
jpark37
c021338ceb libobs,deps/media-playback: Avoid bitfields
Use unused padding of obs_source_frame/obs_source_frame2 instead.
2021-06-11 07:02:37 -07:00
jp9000
2d524580fe UI: Fix context bar crash
This crash was caused by the fact that the SourceToolbar::oldData member
variable was not being released correctly. To release an OBSData object,
it must be either destructed, set to a new value, or set to a null
value.
2021-06-10 14:33:32 -07:00
jp9000
3887c09066 libobs: Update version to 27.0.1 2021-06-10 08:50:41 -07:00
Ryan Foster
e0edd753ad UI: Handle mac-vth264 encoder ID change
Before OBS Studio 27, we used our own hard-coded internal encoder IDs on
for the mac-vth264 plugin: vt_h264_hw and vt_h264_sw. As of OBS Studio
27, we changed to using the encoder IDs that Apple's API reports.
Specifically, this behavior occurs due to PR #4105 and commit
6a9f25c8ea.

Unfortunately, this change in encoder IDs failed to take into account
existing user configurations, resulting in users with broken encoder
settings. This change attempts to gracefully upgrade user configurations
to handle the changed encoder IDs.

Fixes #4799.
2021-06-09 17:14:32 -07:00
Exeldro
5998f4cc4d UI: Optimize backup scene for undo/redo 2021-06-08 23:29:17 -07:00
jpark37
ba3eb46bf9 obs-ffmpeg: Add missing return statement 2021-06-07 22:14:38 -07:00
Ford Smith
2ae593860d UI: Fix filters changes not properly being added to undo stack 2021-06-07 21:47:03 -07:00
jpark37
a8414a09cc obs-ffmpeg: NVENC usage fixes
Only use lossless encode if the capability is supported.

Set qpPrimeYZeroTransformBypassFlag to 1 for lossless.

Do not set profileGUID for lossless.

For both NVENC implementations, retry with a heavier reset because both
are unable to recover from failure lightly.
2021-06-07 21:43:58 -07:00
Matt Gajownik
4d647d8d15 UI: Translate Undo action "Delete Scene" and include scene name 2021-06-06 11:05:47 -07:00
jpark37
07084de805 obs-ffmpeg: Support lack of Psycho Visual Tuning
For new NVENC, warn if PVT is requested, but unsupported by the GPU.
Also retry without PVT on failure to try to catch bad cominbations.

For old NVENC, if PVT is enabled when FFmpeg failure occurs, retry
without PVT.
2021-06-06 11:05:04 -07:00
Matt Gajownik
94404a4d28 UI: Don't execute or track empty SceneItem move actions
This would appear as "Undo Move '' in 'Scene Name'"
2021-06-05 20:07:57 -07:00
jp9000
2b69adf3bc Revert "UI: Cleanup on_scenes_currentItemChanged function"
This reverts commit c497342fd6.

Fixes a bug where the sources list would not update after 5b25dec714.
2021-06-04 20:44:20 -07:00