How satertek/moonlight-android works
Main Components Overview
The system should be divided into these key components:
a) Client-Side Components (Android App):
• UI Layer (Activities and Views)
• Input Handling System
• Audio/Video Decoders
• Network Communication Layer
• Configuration Management
b) External Components:
• NVIDIA GameStream Server
• Sunshine Server
• Game Host PC
Detailed Component Breakdown
Frontend Layer:
• UI components (StreamView, VirtualController)
• Connection to preferences and settings management
Core Streaming Components:
• To sub-components:
• Video Pipeline (MediaCodecDecoderRenderer)
• Audio Pipeline (AndroidAudioRenderer)
• Input Management (ControllerHandler)
• Network Communication (NvHTTP)
Input Handling System:
• Multiple input sources:
• Touch Input
• Physical Controllers
• Virtual Controller
• Keyboard/Mouse
• To input processing components
Connection Flows
• Discovery flow (mDNS discovery)
• Authentication flow (pairing process)
• Streaming flow (video/audio/input data)
• Control flow (game launch/stop)
Component Relationships
Clear boundaries between:
• Java/Kotlin code
• Native code (JNI layer)
• External services
• System services
Technical Details
Annotations for:
• Protocol information (GameStream protocol)
• Codec details (H.264/HEVC)
• Input protocols
• Network requirements
Architectural Patterns
Highlight:
• MVC pattern in UI
• Service-based architecture for background operations
• Observer pattern for event handling
• Factory pattern for component creation
Android platform integration
Keep the abstraction level high enough to be understandable but detailed enough to show the sophisticated nature of the streaming system. Use clear boundaries between the Android app components and external systems while showing their interactions.
This will provide a clear understanding of how Moonlight Android works as a game streaming client while maintaining the complexity necessary for a principal software engineer to understand the system's architecture.