A professional Android application for USB camera capture, video streaming, and audio processing with support for MacroSilicon devices and HDMI capture.
- V4L2 Native Camera Capture - Direct video capture from USB cameras using native C++ code
- Video Streaming with OpenGL ES - Hardware-accelerated video rendering to SurfaceView
- Audio Capture & Playback - Native audio system integration with ALSA compatibility
- MacroSilicon Device Support - Full compatibility with MS2130 and MS2109 chipsets
- HDMI Capture Capabilities - Device-specific driver integration for HDMI input
- USB Device Management - Automatic device detection, enumeration, and management
- Background Services - Capture monitoring and auto-start functionality
- Configuration Management - Settings persistence and device preferences
- Multi-Architecture Support - ARM64, ARMv7, x86, x86_64
- API Level 21+ Compatibility - Supports Android 5.0 and above
- Native Performance - C++ implementation for high-performance video processing
- Comprehensive Logging - File-based logging and real-time performance monitoring
- Error Handling - Robust error handling with user feedback
- Permission Management - Camera, audio, USB, and storage permissions
- Android Studio - Latest version (Hedgehog or newer)
- Android SDK - API Level 34 (Android 14)
- Android NDK - Version 29.0.13599879 or newer
- CMake - Version 3.22.1 or newer
- Gradle - Version 8.12 or newer
- Java - OpenJDK 17 or newer
- Android Device - API Level 21+ (Android 5.0+)
- USB Camera - V4L2 compatible device
- MacroSilicon Devices - MS2130, MS2109, or compatible chipsets
- HDMI Capture - Supported capture cards (device-specific drivers)
git clone https://github.com/yourusername/ossuret-capture-viewer.git
cd ossuret-capture-viewer- Launch Android Studio
- Select "Open an existing Android Studio project"
- Navigate to the cloned repository and select it
- Wait for Gradle sync to complete
- Go to File → Settings → Appearance & Behavior → System Settings → Android SDK
- Click on "SDK Tools" tab
- Check "NDK (Side by side)" and install version 29.0.13599879
- Set the NDK path in
local.properties:
ndk.dir=C:\\Users\\YourUsername\\AppData\\Local\\Android\\Sdk\\ndk\\29.0.13599879# Clean build
./gradlew clean
# Build debug version
./gradlew assembleDebug
# Build release version
./gradlew assembleRelease# Install debug version
adb install app/build/outputs/apk/debug/app-debug.apk
# Install release version
adb install app/build/outputs/apk/release/app-release-unsigned.apkapp/
├── src/main/
│ ├── java/com/ossuret/captureviewer/
│ │ ├── MainActivity.kt # Main UI and device management
│ │ ├── DeviceAdapter.kt # RecyclerView adapter for devices
│ │ ├── CaptureDevice.kt # Device data model
│ │ ├── DeviceCapabilities.kt # Device capabilities model
│ │ ├── V4L2Camera.kt # V4L2 camera interface
│ │ ├── VideoStream.kt # Video streaming interface
│ │ ├── AudioCapture.kt # Audio capture interface
│ │ ├── AudioPlayback.kt # Audio playback interface
│ │ ├── SettingsManager.kt # Configuration management
│ │ ├── CaptureService.kt # Background service
│ │ ├── BootReceiver.kt # Auto-start receiver
│ │ ├── LogManager.kt # Logging system
│ │ └── PerformanceMonitor.kt # Performance tracking
│ ├── cpp/
│ │ ├── v4l2_camera.cpp # V4L2 camera implementation
│ │ ├── video_stream.cpp # Video streaming implementation
│ │ ├── audio_capture.cpp # Audio capture implementation
│ │ ├── audio_playback.cpp # Audio playback implementation
│ │ ├── video_renderer.cpp # OpenGL ES video rendering
│ │ └── jni_interface.cpp # JNI interface definitions
│ ├── res/
│ │ ├── layout/ # UI layouts
│ │ ├── drawable/ # Icons and graphics
│ │ ├── values/ # Strings, colors, styles
│ │ └── menu/ # Menu definitions
│ └── AndroidManifest.xml # App manifest and permissions
├── build.gradle # App-level build configuration
└── CMakeLists.txt # Native build configuration
- MainActivity: Main UI controller, device management, and user interactions
- V4L2Camera: JNI interface for V4L2 camera operations
- VideoStream: JNI interface for video streaming and rendering
- AudioCapture/AudioPlayback: JNI interfaces for audio processing
- SettingsManager: Configuration persistence and management
- CaptureService: Background monitoring and auto-start functionality
- v4l2_camera.cpp: V4L2 device enumeration, configuration, and capture
- video_stream.cpp: Video frame processing and OpenGL ES rendering
- audio_capture.cpp: Audio device management and capture
- audio_playback.cpp: Audio output and playback
- video_renderer.cpp: OpenGL ES shaders and rendering pipeline
- Kotlin: Follow official Kotlin coding conventions
- C++: Follow Google C++ Style Guide
- JNI: Use consistent naming conventions for JNI functions
- Comments: Comprehensive documentation for complex algorithms
- Use
LogManagerfor file-based logging - Use
PerformanceMonitorfor performance tracking - Include device-specific information in logs
- Log all error conditions with context
- Implement comprehensive error handling in both Kotlin and C++
- Provide user-friendly error messages
- Log detailed error information for debugging
- Graceful degradation when features are unavailable
- Test on multiple Android API levels (21+)
- Test with various USB camera devices
- Test MacroSilicon device compatibility
- Test HDMI capture functionality
- Test background service behavior
- Connect USB camera or MacroSilicon device
- App automatically detects and enumerates devices
- Device list shows with status and capabilities
- Select device to begin capture
- Select a device from the device list
- Tap "Start Streaming" to begin video capture
- Video displays in the main SurfaceView
- Use resolution and framerate controls to adjust quality
- Enable audio capture in settings
- Audio automatically captures with video
- Use audio playback controls to monitor audio
- Audio files saved to device storage
- Access settings through menu
- Configure default devices and preferences
- Set auto-start and background monitoring
- Configure logging and performance monitoring
- NDK not found: Ensure NDK is installed and path is correct in
local.properties - CMake errors: Update CMake to version 3.22.1 or newer
- Gradle sync fails: Clean project and invalidate caches
- Device not detected: Check USB permissions and device compatibility
- Video not streaming: Verify V4L2 device support and permissions
- Audio not working: Check audio permissions and device compatibility
- App crashes: Check logs for detailed error information
- High CPU usage: Reduce video resolution or framerate
- Memory leaks: Monitor memory usage with PerformanceMonitor
- Battery drain: Disable background services if not needed
# Monitor logs
adb logcat -s OssuretCaptureViewer
# Check device permissions
adb shell dumpsys package com.ossuret.captureviewer
# Monitor performance
adb shell dumpsys meminfo com.ossuret.captureviewer
# Check USB devices
adb shell lsusbThis project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For support and questions:
- Create an issue on GitHub
- Check the troubleshooting section
- Review the logs for error details
- Test with different devices and configurations
- Initial release with V4L2 camera support
- MacroSilicon device compatibility
- Video streaming with OpenGL ES
- Audio capture and playback
- Background services and auto-start
- Comprehensive logging and monitoring
- Multi-architecture support