# DJI Telemetry Viewer - Python Dependencies
# This file specifies all Python packages required to run the DJI Telemetry Overlay Viewer
# Install all dependencies using: pip install -r requirements.txt
# 
# It's recommended to use a virtual environment:
# python -m venv dji_viewer_env
# source dji_viewer_env/bin/activate  # On Windows: dji_viewer_env\Scripts\activate
# pip install --upgrade pip
# pip install -r requirements.txt

# =============================================================================
# CORE GUI FRAMEWORK
# =============================================================================

# PyQt5 - Main GUI framework for cross-platform desktop application
# Provides widgets, layouts, event handling, and window management
# Version 5.15.0+ required for stability and modern features
PyQt5>=5.15.0,<5.16.0

# PyQtWebEngine - Web engine integration for PyQt5 applications
# Required for displaying interactive maps using HTML/JavaScript (Folium/Leaflet)
# Provides QWebEngineView widget for embedding web content
PyQtWebEngine>=5.15.0,<5.16.0

# =============================================================================
# MEDIA PLAYBACK
# =============================================================================

# python-vlc - Python bindings for VLC media player
# Handles video playback, seeking, volume control, and media information
# Requires VLC media player to be installed on the system
# Version 3.0.12118+ includes important bug fixes for subtitle handling
python-vlc>=3.0.12118

# =============================================================================
# MAPPING AND VISUALIZATION
# =============================================================================

# folium - Python library for creating interactive maps
# Generates HTML/JavaScript maps using Leaflet.js
# Used for displaying flight paths and real-time drone position
# Version 0.12.0+ includes performance improvements and new map styles
folium>=0.12.0,<0.15.0

# =============================================================================
# DATA PROCESSING
# =============================================================================

# srt - Library for parsing and manipulating SubRip subtitle files
# DJI drones embed telemetry data in SRT format within MP4 files
# This library extracts and parses GPS coordinates, altitude, speed, etc.
# Version 3.5.0+ provides better error handling and Unicode support
srt>=3.5.0,<4.0.0

# =============================================================================
# OPTIONAL DEPENDENCIES (Recommended)
# =============================================================================

# requests - HTTP library for downloading map tiles and updates
# Used by folium for fetching map data from various tile servers
# Version 2.25.0+ includes security improvements
requests>=2.25.0,<3.0.0

# Pillow - Python Imaging Library for image processing
# Used for handling video thumbnails and image exports
# Version 8.0.0+ includes security fixes and performance improvements
Pillow>=8.0.0,<11.0.0

# numpy - Numerical computing library
# Used for efficient telemetry data processing and calculations
# Required by folium for coordinate transformations
numpy>=1.19.0,<2.0.0

# =============================================================================
# DEVELOPMENT DEPENDENCIES (Optional - for contributors)
# =============================================================================
# Uncomment these lines if you're developing or contributing to the project
# Install with: pip install -r requirements.txt -r requirements-dev.txt

# pytest>=6.0.0              # Testing framework
# pytest-qt>=4.0.0           # PyQt-specific testing utilities  
# black>=21.0.0               # Code formatter
# flake8>=3.8.0               # Linting tool
# mypy>=0.800                 # Type checking
# pre-commit>=2.10.0          # Git hooks for code quality

# =============================================================================
# SYSTEM-SPECIFIC NOTES
# =============================================================================

# WINDOWS USERS:
# - Install Microsoft Visual C++ Redistributable if you encounter DLL errors
# - Ensure FFmpeg is in your system PATH
# - Some antivirus software may flag python-vlc - add exceptions if needed

# MACOS USERS:  
# - Install Xcode command line tools: xcode-select --install
# - Use Homebrew for FFmpeg: brew install ffmpeg
# - You may need to install Rosetta 2 on Apple Silicon Macs

# LINUX USERS:
# - Install system packages: sudo apt install python3-dev python3-pip
# - Install FFmpeg: sudo apt install ffmpeg
# - For audio support: sudo apt install pulseaudio-dev
# - Qt dependencies: sudo apt install qt5-default

# =============================================================================
# TROUBLESHOOTING COMMON INSTALLATION ISSUES
# =============================================================================

# Issue: "Failed building wheel for PyQt5"
# Solution: Install pre-compiled binaries
# pip install --only-binary=all PyQt5 PyQtWebEngine

# Issue: "Microsoft Visual C++ 14.0 is required" (Windows)
# Solution: Install Microsoft C++ Build Tools
# Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/

# Issue: "vlc.dll not found" (Windows)
# Solution: Install VLC media player system-wide
# Download from: https://www.videolan.org/vlc/

# Issue: "No module named '_ctypes'" (Linux)
# Solution: Install libffi development package
# sudo apt install libffi-dev

# Issue: Segmentation fault on startup (Linux)
# Solution: Install additional Qt libraries
# sudo apt install python3-pyqt5.qtwebengine

# =============================================================================
# VERSION COMPATIBILITY MATRIX
# =============================================================================
# Python 3.7: All packages supported
# Python 3.8: All packages supported (recommended)
# Python 3.9: All packages supported (recommended)  
# Python 3.10: All packages supported
# Python 3.11: Most packages supported (some may need --pre flag)
# Python 3.12: Limited support (check individual packages)

# =============================================================================
# INSTALLATION VERIFICATION
# =============================================================================
# After installation, verify all dependencies with:
# python -c "import PyQt5, vlc, folium, srt, requests, PIL, numpy; print('✓ All dependencies installed successfully!')"

# Test GUI availability:
# python -c "from PyQt5.QtWidgets import QApplication; app = QApplication([]); print('✓ GUI framework ready')"

# Test VLC integration:
# python -c "import vlc; instance = vlc.Instance(); print('✓ VLC integration working')"