-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
It looks like there is a huge memory leak when using external texture on macOS. The memory usage of the video_player plugin grows quickly to multiple GB. Could also be that I made some mistake of course.
I am still trying to create a more minimalistic reproduction but until then the example of the macOS port of the video_player plugin can be used to reproduce the issue:
https://github.com/cbenhagen/plugins/tree/video_player_macos_new/packages/video_player/video_player_macos/example
The relevant code returning the buffer is a copy of the iOS implementation:
- (CVPixelBufferRef)copyPixelBuffer {
CMTime outputItemTime = [_videoOutput itemTimeForHostTime:CACurrentMediaTime()];
if ([_videoOutput hasNewPixelBufferForItemTime:outputItemTime]) {
return [_videoOutput copyPixelBufferForItemTime:outputItemTime itemTimeForDisplay:NULL];
} else {
return NULL;
}
}The whole code can be found here:
https://github.com/cbenhagen/plugins/blob/video_player_macos_new/packages/video_player/video_player_macos/macos/Classes/FLTVideoPlayerPlugin.m
/cc @iskakaushik
[✓] Flutter (Channel master, 2.1.0-13.0.pre.416, on macOS 11.2.3 20D91 darwin-arm, locale en-CH)
• Flutter version 2.1.0-13.0.pre.416 at /Users/ben/development/flutter
• Framework revision b9638fb837 (11 hours ago), 2021-04-02 00:39:02 -0400
• Engine revision bed3a4a7a0
• Dart version 2.13.0 (build 2.13.0-192.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/ben/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Users/ben/Library/Application
Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7199119/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Users/ben/Library/Application
Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7199119/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.53.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.19.0
[✓] Connected device (3 available)
• iPad von Ben (mobile) • 00008027-000C45CA0A62402E • ios • iOS 14.4.2
• macOS (desktop) • macos • darwin-arm64 • macOS 11.2.3 20D91
darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.114
• No issues found!