OBS Studio - Free from stubborn peops https://obsproject.com
Find a file
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
.github CI: Update obs-crowdin-sync to 0.2.1 2022-06-18 11:16:22 +10:00
additional_install_files Improve additional_install_files for debug/release 2014-07-18 22:41:11 -07:00
CI CI: Fix FreeBSD definition of streaming service 2022-06-06 03:12:46 -04:00
cmake cmake: Fix handling of optional debug wrapper libraries for obs-browser 2022-06-20 14:24:52 -04:00
deps deps/media-playback: Fix metadata for hw_accel 2022-06-18 16:03:34 -07:00
docs/sphinx libobs/util: Add function to get Rosetta translation status 2022-06-19 01:37:15 +02:00
libobs libobs/util: Add function to get Rosetta translation status 2022-06-19 01:37:15 +02:00
libobs-d3d11 libobs-d3d11: Add monitor to HDR status cache 2022-04-14 09:36:09 -07:00
libobs-opengl libobs-opengl: Remove unnecessary call to retrieve screen number 2022-06-08 08:55:03 -03:00
libobs-winrt libobs-winrt: Support window transparency for WGC 2022-05-03 01:03:23 -07:00
plugins mac-virtualcam: Fix IOSurface memory leak 2022-06-25 16:12:26 -07:00
test test: Fix cmocka unused-parameter warnings 2022-05-04 01:37:10 -07:00
UI UI: Fix crash if missing module in context bar 2022-06-25 16:09:30 -07:00
.cirrus.yml CI: Fix swig dependency on FreeBSD 2020-10-03 05:38:46 -07:00
.clang-format Apply clang-format to objective c code 2019-07-09 13:39:13 -05:00
.cmake-format.json CI: Update build scripts and Github actions workflow 2022-03-16 23:13:26 +01:00
.editorconfig CI: Update editorconfig to match CMake-format configuration 2022-03-18 05:46:21 -07:00
.git-blame-ignore-revs .git-blame-ignore-revs: Add file to handle mass reformatting 2019-06-27 01:09:31 +09:00
.gitattributes CI: Add Crowdin Synchronization 2021-11-25 20:59:11 +11:00
.gitignore CI: Update build scripts and Github actions workflow 2022-03-16 23:13:26 +01:00
.gitmodules enc-amf: Update to 2.5.0.1 and update repository address 2018-09-28 10:54:19 +02:00
.mailmap .mailmap: Disambiguate many more authors 2021-01-11 17:45:01 -08:00
AUTHORS Update translations from Crowdin 2022-02-11 00:34:08 +00:00
CMakeLists.txt cmake: Fix enabling PulseAudio monitoring 2022-05-28 18:36:36 -04:00
COC.rst Revert "docs: Rename Code of Conduct to fix GitHub detection" 2021-08-07 20:40:29 +10:00
COMMITMENT Add GPL Cooperation Commitment to base directory 2019-01-24 02:02:49 -05:00
CONTRIBUTING.rst CONTRIBUTING.rst: Add service submission guidelines (#5562) 2021-11-22 08:29:39 -06:00
COPYING COPYING: Use license file from gnu.org 2021-10-24 00:35:27 -07:00
INSTALL Update INSTALL 2018-07-14 08:21:00 +01:00
README.rst docs: Remove block quotes (#4621) 2021-05-01 19:46:54 -05:00

OBS Studio <https://obsproject.com>
===================================

.. image:: https://github.com/obsproject/obs-studio/actions/workflows/main.yml/badge.svg?branch=master&event=push
   :alt: OBS Studio Build Status - GitHub Actions
   :target: https://github.com/obsproject/obs-studio/actions/workflows/main.yml?query=event%3Apush+branch%3Amaster

.. image:: https://d322cqt584bo4o.cloudfront.net/obs-studio/localized.svg
   :alt: OBS Studio Translation Project Progress
   :target: https://crowdin.com/project/obs-studio

.. image:: https://img.shields.io/discord/348973006581923840.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2
   :alt: OBS Studio Discord Server
   :target: https://obsproject.com/discord

What is OBS Studio?
-------------------

OBS Studio is software designed for capturing, compositing, encoding,
recording, and streaming video content, efficiently.

It's distributed under the GNU General Public License v2 (or any later
version) - see the accompanying COPYING file for more details.

Quick Links
-----------

- Website: https://obsproject.com

- Help/Documentation/Guides: https://github.com/obsproject/obs-studio/wiki

- Forums: https://obsproject.com/forum/

- Build Instructions: https://github.com/obsproject/obs-studio/wiki/Install-Instructions

- Developer/API Documentation: https://obsproject.com/docs

- Donating/backing/sponsoring: https://obsproject.com/contribute

- Bug Tracker: https://github.com/obsproject/obs-studio/issues

Contributing
------------

- If you would like to help fund or sponsor the project, you can do so
  via `Patreon <https://www.patreon.com/obsproject>`_, `OpenCollective
  <https://opencollective.com/obsproject>`_, or `PayPal
  <https://www.paypal.me/obsproject>`_.  See our `contribute page
  <https://obsproject.com/contribute>`_ for more information.

- If you wish to contribute code to the project, please make sure to
  read the coding and commit guidelines:
  https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.rst

- Developer/API documentation can be found here:
  https://obsproject.com/docs

- If you wish to contribute translations, do not submit pull requests.
  Instead, please use Crowdin.  For more information read this thread:
  https://obsproject.com/forum/threads/how-to-contribute-translations-for-obs.16327/

- Other ways to contribute are by helping people out with support on
  our forums or in our community chat.  Please limit support to topics
  you fully understand -- bad advice is worse than no advice.  When it
  comes to something that you don't fully know or understand, please
  defer to the official help or official channels.