Grafika is a collection of experimental apps designed to explore and exercise various Android graphics and media features. It serves as a testbed and a companion to the Android System-Level Graphics Architecture. While not intended for production use, it offers insights into the underlying technology and provides examples of how to tackle specific graphics-related challenges. The project primarily uses Java and avoids the native NDK.
Grafika demonstrates various optimization techniques for graphics and media processing, notably including hardware scaling and multi-surface rendering. The project explores approaches to thread safety and garbage collection to mitigate performance issues. It features diverse functionalities ranging from video playback and recording to advanced camera utilization and display scheduling, making it a useful resource for developers researching low-level graphics implementation.
- Video Playback: Plays MP4 video files from a designated directory using a
TextureVieworSurfaceView. - Continuous Capture: Records video from the camera to a circular buffer, providing control over frame rate and duration.
- Hardware Scaler Exerciser: Reveals the behavior of the hardware scaler through on-the-fly surface size changes.
- Multi-Surface Test: Demonstrates screen layering and secure surface handling with a test showcasing HWC behavior.
- Live Camera: Directs the camera preview to a
TextureViewdemonstrating standard camera preview functionality. - Frame Buffer Objects (FBOs): Explores simultaneous drawing to the display and a video encoder, offering various rendering strategies.
- Scheduled Swap: Allows scheduling buffer submissions for display at a specific time, showcasing SurfaceFlinger's scheduling capabilities.
The Grafika project is archived and considered unstable. Development is infrequent, and the code is not extensively tested or documented. While it provides valuable insights into various graphics-related concepts, users should expect potential issues and limitations. The project is largely an exploration and not intended for production use, and contributions are not being accepted.
Grafika is beneficial for Android developers seeking to understand and experiment with low-level graphics and media concepts. It's valuable for researching hardware scaling, threading strategies, and advanced camera features. Developers can use it as a testing ground for their own projects, but should be aware of its instability and lack of comprehensive documentation.
