Add HLS streaming support on Windows#173
Merged
kdroidFilter merged 6 commits intomasterfrom Mar 8, 2026
Merged
Conversation
…o device change - Fix washed-out video colors by setting alpha byte to 0xFF on RGB32 frames (MFVideoFormat_RGB32/X8R8G8B8 leaves the padding byte undefined) - Add thread-safe atomic access for instanceVolume and playbackSpeed - Fix WASAPI InitWASAPI cleanup to properly release COM objects on failure (#97) - Add audio format fallback: try native format first, fall back to 2ch/48kHz - Add DLL version check (GetNativeVersion) to detect JNA binding mismatches - Extract AcquireNextSample helper to eliminate ~120 lines of duplication - Add named constants for sync thresholds (replace magic numbers) - Fix division-by-zero guard for frame rate - Support WAVE_FORMAT_EXTENSIBLE and 24-bit PCM in volume scaling - Eagerly create audio device enumerator to avoid lazy-init race - Translate all French comments to English - Enhance GetVideoMetadata with title, bitrate, and extended MIME types
- Migrate from JNA to JNI with RegisterNatives for native bindings - Add SetOutputSize to scale decoder output to display surface size (saves ~500MB for 4K) - Fix playback clock desync: open media paused, start clock right before frame production - Fix resize race: keep isResizing flag until applyOutputScaling completes - Remove redundant SeekMedia(0) after OpenMedia - Remove unused sharedFrameBuffer allocation
- Recalibrate wall-clock on first decoded frame in AcquireNextSample, fixing HTTP/network sources where decode latency caused mass frame skipping (audio played but video was invisible) - Remove per-pixel alpha forcing loop in ReadVideoFrame (~8M ops/frame for 4K); Skia OPAQUE alpha type already handles this - Use tryLock for audio level polling to avoid blocking media operations - Remove unnecessary runBlocking wrapper and System.gc() calls
…ent Skia from using the alpha channel during compositing
…te handling - Remove redundant `LaunchedEffect` and simplify player state initialization - Add conditions to prevent unnecessary scaling during resize - Introduce resize timeout to avoid infinite waits - Ensure playback state is updated only when necessary
IMFSourceReader does not support HLS on desktop Win32 apps, so this adds a dual-path architecture: HLS URLs (.m3u8) use IMFMediaEngine which has native HLS support on Windows 10+, while all other media continues to use the existing IMFSourceReader path. Key changes: - New HLSPlayer class wrapping IMFMediaEngine with D3D11 frame extraction - Automatic HLS detection (URL pattern + fallback on source reader error) - Live stream handling (duration 0, seeking disabled, EOF retry) - Adaptive bitrate support (resolution re-queried per frame) - Audio handled internally by the engine (no WASAPI needed for HLS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IMFMediaEngine, sinceIMFSourceReaderdoes not support HLS on desktop Win32 appsIMFMediaEnginewith D3D11 frame extraction, all other media uses the existingIMFSourceReaderpathTest plan
https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8