obs-studio/plugins
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
..
aja aja: Implement buffering property 2022-06-18 16:12:20 -07:00
coreaudio-encoder cmake: Fix diverging prefix padding for OBS status outputs 2022-03-26 09:44:23 -04:00
decklink decklink: Avoid sending 0x0 frame to libobs 2022-06-11 16:22:22 -07:00
enc-amf@f057617ea2 Update translations from Crowdin 2022-02-11 00:34:08 +00:00
image-source image-source: Support JXR on Windows 2022-05-08 15:25:43 -07:00
linux-alsa cmake: Fix diverging prefix padding for OBS status outputs 2022-03-26 09:44:23 -04:00
linux-capture linux-capture: Drop GLX code paths 2022-05-24 14:30:14 -03:00
linux-jack cmake: Fix diverging prefix padding for OBS status outputs 2022-03-26 09:44:23 -04:00
linux-pipewire linux-pipewire: Restore PipeWire minimim version requirement 2022-06-15 13:50:33 -03:00
linux-pulseaudio cmake: Fix enabling PulseAudio monitoring 2022-05-28 18:36:36 -04:00
linux-v4l2 linux-v4l2: Add support for H.264 2022-06-17 18:49:12 +10:00
mac-avcapture mac-avcapture: Make "High" preset default 2022-06-25 16:10:28 -07:00
mac-capture mac-capture: Improve window capture performance 2022-05-07 16:21:25 -07:00
mac-syphon plugins: Update CMakeLists.txt for included plugins 2022-03-16 23:11:08 +01:00
mac-virtualcam mac-virtualcam: Fix IOSurface memory leak 2022-06-25 16:12:26 -07:00
mac-vth264 mac-vth264: Fix compiler warnings 2022-05-04 12:09:04 -04:00
obs-browser@240732b8b8 obs-browser: Don't auto-focus, remove init hack 2022-06-20 18:30:53 +10:00
obs-ffmpeg obs-ffmpeg, obs-outputs: Check return of obs_encoder_get_extra_data 2022-06-25 16:03:12 -07:00
obs-filters Fix indent on multiline comments 2022-04-30 16:06:23 -07:00
obs-libfdk obs-libfdk: Enable 7.1 channel surround for Linux 2022-04-30 16:28:45 -07:00
obs-outputs obs-ffmpeg, obs-outputs: Check return of obs_encoder_get_extra_data 2022-06-25 16:03:12 -07:00
obs-qsv11 cmake: Fix diverging prefix padding for OBS status outputs 2022-03-26 09:44:23 -04:00
obs-text plugins: Update CMakeLists.txt for included plugins 2022-03-16 23:11:08 +01:00
obs-transitions obs-transitions: Remove unused shader functions 2022-04-23 16:24:27 -07:00
obs-vst@937ba7952d obs-vst: Update submodule to pull in CMake changes 2022-03-17 14:28:59 +01:00
obs-x264 obs-x264: Use period for localized sentence 2022-05-28 18:31:55 -04:00
oss-audio cmake: Fix diverging prefix padding for OBS status outputs 2022-03-26 09:44:23 -04:00
rtmp-services rtmp-services: Remove defunct servers/services 2022-06-05 01:40:20 +02:00
sndio cmake: Fix diverging prefix padding for OBS status outputs 2022-03-26 09:44:23 -04:00
text-freetype2 cmake: Fix diverging prefix padding for OBS status outputs 2022-03-26 09:44:23 -04:00
vlc-video vlc-video: Fix sign-compare warning 2022-05-19 17:10:47 -04:00
win-capture win-capture: Rename Rec. 2020 to Rec. 2100 2022-05-27 04:38:02 -07:00
win-dshow win-dshow: Save and restore video device config props 2022-06-15 12:30:09 -07:00
win-ivcam cmake: Fix diverging prefix padding for OBS status outputs 2022-03-26 09:44:23 -04:00
win-mf plugins: Update CMakeLists.txt for included plugins 2022-03-16 23:11:08 +01:00
win-wasapi win-wasapi: Log source name when showing device errors 2022-05-17 02:47:08 -07:00
CMakeLists.txt cmake: Fix diverging prefix padding for OBS status outputs 2022-03-26 09:44:23 -04:00