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.
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.
If a module is not found in context bar, it crashed when resolving
source type name. This is same change as 41367bb2b but fixes
window-capture and display-capture.
Also removes an unnecessary pair of braces.
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.
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.
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.
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.
Visually, the Scale Filtering, Blending Mode & Method, and Deinterlacing
menus are now grouped together, with "Hide in Mixer" being its own group
until a better place for it has been found.
Projector and Screenshot menus have been moved down.
As a related code cleanup, the creation of sourceProjector and
sourceWindow has been moved down and partially inlined.
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.
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.
This converts the advanced audio window to use
a ui form, so it is easier to modify in the future.
This also fixes sizing issues with the control widgets,
as before the audio tracks would be clipped, because the
widgets in the window were too wide.
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.