Commit Graph

3514 Commits (1cf93a4b29fb278b096f852996cb9e44579c9aa1)

Author SHA1 Message Date
Kurt Kartaltepe c6cb0838fd linux-capture: Silence log spam on xcomposite capture
It is expected that capture might fail, like when a window is minimized.
In these cases we dont want the log to be spammed by X11 errors so
install a noop error handler while we try to import.
2022-07-10 11:24:40 +10:00
Kurt Kartaltepe e9076da901 linux-capture: Retry capture if texture not created
This prevented OBS from re-aquiring capture when windows were minimized
or fullscreened.
2022-07-10 11:24:40 +10:00
PatTheMav c61d523d58 mac-avcapture: Fix deprecation warning for AVCaptureDevice list
Direct access to `[AVCaptureDevice devices]` is deprecated since macOS
10.15. An `AVCaptureDeviceDiscoverySession` is to be used instead, which
this PR implements.

When running on older macOS versions or compiling against older platform
SDKs, the deprecated method is used.

PS: The formatting is not proper ObjC style, but that's clang-format's
doing with our current settings.
2022-07-10 10:09:58 +10:00
tt2468 97756861b4 obs-outputs: Rework RTMP context init/deinit
This commit fixes what is arguably a long-winded series of previous
commits that have possibly caused just as many problems as they have
fixed. I'll spare the details, but basically, there's no reason that
any of the RTMP object should ever be used across socket sessions.

This provides a slight enhancement by removing the `RTMP_Init` call
in `rtmp_stream_create()`, since it effectively just initializes TLS
just for `try_connect` to deinitialize it before it is even used.

This also fixes the current `SO_RCVTIMEO` timeout functionality by
making sure that `RTMP_Reset` is called last.
2022-07-09 17:04:37 -07:00
Norihiro Kamae c1d1526b24 aja: Split audio part in CaptureThread to function
To improve readability of the capture thread function
`AJASource::CaptureThread`, audio part is split into two functions.
Behavior is not changed.
Also fixed one of warnings.
2022-07-10 10:01:58 +10:00
Norihiro Kamae 08a071d7a5 aja: Fix memory overrun on aja-source
When too many audio frames are captured and at the same time the ring
buffer on the card is wrapped, memory overrun was not captured before
DMA transfer, which resulted in corruption of memory contents. This
commit moves the overrun check before the DMA transfer.
2022-07-10 10:01:58 +10:00
PatTheMav 62c6a6d223 obs_ffmpeg: Explicitly mark variables as unused 2022-07-10 09:59:55 +10:00
PatTheMav fa7047c418 images-source: Explicitly mark variables as unused 2022-07-10 09:59:55 +10:00
PatTheMav ed9cc5c0dd aja: Explicitly mark variables as unused 2022-07-10 09:59:55 +10:00
PatTheMav 3f2aad12cd obs-ffmpeg: Disable compiler warnings about non-exhaustive switch cases 2022-07-10 09:59:55 +10:00
PatTheMav 7bb2f33417 obs-filters: Disable compiler warnings about non-exhaustive switch cases 2022-07-10 09:59:55 +10:00
PatTheMav deeaccb3d1 obs-x264: Disable compiler warnings about non-exhaustive switch cases 2022-07-10 09:59:55 +10:00
pkv b9237aed29 obs-ffmpeg: Fix srt/rist not working
This fixes a bug where the new circular buffer code is hit by protocols
such as rist or srt although the buffer was meant for files.

Signed-off-by: pkv <pkv@obsproject.com>
2022-07-09 16:29:04 -07:00
Paul Hindt e390252540 aja: Fix audio capture sometimes offset by a channel 2022-07-09 16:20:23 -07:00
jpark37 8614697c59 obs-qsv11: Use same adapter as OBS
A mismatch will lead to failure.
2022-07-09 16:08:47 -07:00
MagicBear f54f8ee714 obs-ffmpeg: Add NVIDIA Tesla NVENC support 2022-07-09 15:49:26 -07:00
mvji 16f5fe5ee2 obs-ffmpeg: Add m4v extension to open file dialog 2022-07-09 13:45:29 -04:00
Vainock e053f9dd26 UI,mac-avcapture: Use consistent variables in locales 2022-07-02 14:02:40 +10:00
Hernán 68f3a5f37d rtmp-services: Update Piczel.tv recommended settings 2022-06-27 15:02:18 -04:00
columbarius e14f6280c2 linux-pipewire: Log modifier
The used modifier is important to debug subtle issues when the imported
buffer appears to be currupt.
2022-06-27 13:56:16 -03:00
Jim 7c493ea035
Merge pull request #6645 from GeorgesStavracas/gbsneto/pipewire-cleanup
Various cleanups to linux-pipewire
2022-06-25 16:21:00 -07:00
Norihiro Kamae bf97248a81 mac-vth264: Fix PTS passed to the encoder
It is reported that the encoder does not follow the bitrate settings.
This commit tries to correct the timestamps so that the bitrate control
in the encoder works.
2022-06-25 16:17:09 -07:00
kevin.dww ee59905be1 rtmp-services: Add Mildom and Nonolive 2022-06-25 16:12:50 -07:00
Fabian Mastenbroek b02e4b109b mac-virtualcam: Fix IOSurface memory leak
This change fixes a memory leak in the mac-virtualcam plugin that causes
OBS to not release the CVPixelBuffers (and underlying IOSurfaces)
it emits to the virtual camera consumers.

Pull request https://github.com/obsproject/obs-studio/pull/6573 (Avoid
transcoding where possible) updated the mac-virtualcam to share the
virtual camera feed with other processes via IOSurfaces.

Although the changes work correctly, users have observed that OBS memory
usage keeps increasing when the virtual camera is active until OBS runs
out of memory or the consuming application is closed.
See the report by @SciTechNick for more information:
https://github.com/obsproject/obs-studio/pull/6573#issuecomment-1161979765

After some debugging, I have found that the plugin is leaking Mach ports
associated with IOSurfaces, preventing them from being re-used. The
previous approach using `NSMachPort` does not seem to properly release
the Mach port allocated via `CVPixelBufferGetIOSurface` and
`IOSurfaceLookupFromMachPort`. Instead, we must explicitly deallocate
the port using `mach_port_deallocate`.

I have tested the changes on a Macbook Pro (M1) running macOS Monterey with
Google Chrome, Zoom, and Cameo. OBS shows no signs of memory leakage
after multiple minutes.
2022-06-25 16:12:26 -07:00
gxalpha 72830ea553 mac-avcapture: Make "High" preset default 2022-06-25 16:10:28 -07:00
Richard Stanway 17c39ccb07 obs-ffmpeg, obs-outputs: Check return of obs_encoder_get_extra_data
A race condition can occur in obs-outputs where the send_thread is in
the process of (re)connecting but the encoder was shut down in the
meantime. This causes the expected header data to be garbage, resulting
in a crash.
2022-06-25 16:03:12 -07:00
Georges Basile Stavracas Neto f740033c93 linux-pipewire: Shuffle screencast D-Bus proxy around
Move the screencast D-Bus proxy, and related functions, to where
they fit in now: screencast-portal.c.
2022-06-24 10:29:10 -03:00
Georges Basile Stavracas Neto 6f1521e944 linux-pipewire: Cleanup includes
We can remove and shuffle some includes now.
2022-06-24 10:28:47 -03:00
Georges Basile Stavracas Neto 0e9c208fc5 linux-pipewire: Move all portal code to screencast-portal.c
Sorry this is such a massive commit. The entangled nature of the
code in pipewire.c makes it impossible to reasonably split this
in smaller commits.

Move all D-Bus / portals code from pipewire.c into the recently
introduced screencast-portal.c.
2022-06-24 10:28:45 -03:00
Georges Basile Stavracas Neto 45afcf1997 linux-pipewire: Introduce proxy struct for screencast portal
Right now it's completely useless, but this commit lays out the
foundational steps to populate this struct.
2022-06-24 10:27:56 -03:00
Georges Basile Stavracas Neto 5ffc8ef663 linux-pipewire: Shuffle some code around
This is the start of what will be a rather incisive surgery on
pipewire.c. Move a couple of functions to portal.c, since they're
not really related to the PipeWire code.
2022-06-24 10:26:51 -03:00
Georges Basile Stavracas Neto 8a46b9e455 linux-pipewire: Rename pipewire-capture to screencast-portal
As we slowly split portal code from PipeWire code, what is currently
called pipewire-capture will become the screencast portal specific
code.

Preemptively rename the corresponding files and functions. Next commits
will continue the excision of portal code from pipewire.c.
2022-06-24 10:26:33 -03:00
Georges Basile Stavracas Neto 042c6c078c linux-pipewire: Always load PipeWire captures
After the removal of GLX, we effectively always load the PipeWire
captures. Remove the switch statement.
2022-06-22 11:44:16 -03:00
Georges Basile Stavracas Neto d00d1e2926 linux-pipewire: Remove unused variable
A fallout from a147315f33
2022-06-22 11:37:01 -03:00
Richard Stanway dada82fec1
obs-outputs: Don't shutdown RTMP session when silently reconnecting
The silent reconnect (GOAWAY) is supposed to be used for switching the
connection to a different server. As such, cleanly shutting down the
RTMP connection can destroy state that needs to be preserved in order
for the GOAWAY-enabled server to properly resume the same stream on
reconnect.

This commit closes the TLS/TCP connection before calling RTMP_Close,
causing librtmp to skip the FCUnpublish and deleteStream messages.
2022-06-20 22:10:06 +02:00
Matt Gajownik 0744e260e3 obs-browser: Don't auto-focus, remove init hack
a4e163e - Remove CefInitialize hack argument on Windows
a6df681 - cmake: Fix handling of debug wrapper libraries
a707cb7 - Don't allow browser panels to steal focus on navigate
2022-06-20 18:30:53 +10:00
Norihiro Kamae a255b0f742 aja: Implement buffering property
Buffering inside libobs is enabled by default and it causes latency of
video. This commit provides a property to switch the buffering.
Since the latency of the buffering changes every startup, set the
default to unbuffered mode, though the previous implementation was
enabled buffering.
2022-06-18 16:12:20 -07:00
Grzegorz Godlewski c5015d0e6c linux-v4l2: Add support for H.264 2022-06-17 18:49:12 +10:00
gxalpha a1f9170180
mac-virtualcam: Free virtualcam data when destroying
Fixes a memory leak introduced in db733032e
2022-06-16 18:45:24 +02:00
Exeldro e52018f210 win-dshow: Save and restore video device config props 2022-06-15 12:30:09 -07:00
tytan652 a9cb952628 linux-pipewire: Restore PipeWire minimim version requirement
a147315f33 removed it without adding it to linux-pipewire.
2022-06-15 13:50:33 -03:00
jp9000 a31d7acb14 obs-outputs: Fix missing function declaration 2022-06-15 00:52:43 -07:00
jp9000 7ba9db3744 obs-outputs: Reset TLS on reconnect
Reverts e8b2b2092b and properly fixes an issue where bad TLS data
would persist through reconnections when the connection is encrypted.
2022-06-15 00:31:08 -07:00
Patrick Heyer 1f72dad245
Merge pull request #6573 from fabianishere/feat/mac-virtualcam
mac-virtualcam: Avoid transcoding where possible
2022-06-12 15:52:05 +02:00
Norihiro Kamae 8a41c7298f decklink: Avoid sending 0x0 frame to libobs
When the mode is set to auto, the API sometimes send frames with 0x0
size. Without filtering such frames, which causes libobs to output error
messages.
2022-06-11 16:22:22 -07:00
tytan652 6cc7cf3d55 obs-ffmpeg: Remove codec property from VAAPI encoder
Encoders have only one codec so this property is not needed.

Also rename the encoder to "FFMPEG VAAPI H.264".
2022-06-11 16:09:11 -07:00
Fabian Mastenbroek 37c76abf0d
mac-virtualcam: Fix CMIO errors due to unsettable properties
This change fixes an issue with the CMIO DAL plugin where the CMIO
subsystem would log multiple errors when starting the virtual camera,
due to certain properties that could not be set (frame rate and format).

For now, we just ignore the assignment, but mark the property as
settable to suppress the error messages that are reported by the CMIO
subsystem.
2022-06-10 14:29:55 +02:00
Fabian Mastenbroek 40cb92a7a5
mac-virtualcam: Fix port leakage in Mach server
This change fixes an issue in the Mach server exposed by the macOS
virtual camera for OBS, where it would not invalidate ports that were
disconnected by the remote application, causing sporadic crashes.

These crashes can be reproduced in the previous builds by opening the
virtual camera in a remote application and closing the application
(without stopping the virtual camera).
2022-06-10 13:37:03 +02:00
Fabian Mastenbroek db733032e0
mac-virtualcam: Do not rely on global state
This change updates the implementation of the mac-virtualcam plugin to
not use any global state and instead rely on the state object that is
passed by the OBS module system.

This approach is similar to the virtual camera implementations for Linux
and Windows.
2022-06-10 13:37:03 +02:00
Fabian Mastenbroek 5edabfe7c1
mac-virtualcam: Remove unused CMSampleBuffer utility functions
This change removes the unused CMSampleBuffer utility functions that
were still left from the previous implementation. Since we construct the
CMSampleBuffer directly from an IOSurface, we do not need any custom
construction logic anymore, since that is now performed by the OBS
plugin.
2022-06-10 13:37:03 +02:00