This Flutter application demonstrates and investigates rendering bugs related to Android textures and video playback on specific devices. It renders OpenGL ES textures on the Android native side and displays them via the Flutter Texture widget, leveraging Pigeon for platform communication.
- Initialization: Flutter app initializes
VideoRendererwhich, via Pigeon, prompts Android native code to create aTextureRegistry.SurfaceProducerand an associated nativeVideoRendererobject. - Start Rendering: Flutter calls
_renderApi.startRender(textureId)(via Pigeon). - Native Rendering: Android's
RenderManagerandTriangleRendererbegin periodically rendering frames to theSurfaceProducerassociated with thetextureId. - Display: Flutter's
VideoViewdisplays the continuously updated texture using theTexturewidget.
- Clone the repository:
git clone <repository_url> cd test-flutter-android-texture
- Get Flutter packages:
flutter pub get
- Generate Pigeon code:
./scripts/init.sh
- Run the application:
(Or open the project in your IDE and run it.)
flutter run
MIT
except third_party/webrtc which is copied from https://webrtc.googlesource.com/src/+/fb1f65a8d1e3f915d16a22aeda0e2f389e7fa879 and licensed under BSD-3-Clause. Modified code not to call any native methods to simplfy this projct's usage.