This document describes how NX-Cast should think about source compatibility.
NX-Cast is a generic DLNA DMR. It should not become a source-native client for iQiyi, MangoTV, CCTV, Bilibili, or IPTV providers.
The expected path is:
controller app
-> SetAVTransportURI
-> renderer
-> libmpv loadfile
-> FFmpeg probing, networking, demuxing, decoding
The project should improve generic protocol compatibility and player robustness before adding source-specific logic.
Allowed compatibility work:
- More tolerant SSDP parsing.
- Correct absolute and relative URL handling in descriptions.
- Accurate
SinkProtocolInfo. - Correct SOAP argument parsing and XML entity decoding.
- Stable
LastChangestate. - Better seek target formatting.
- Better player state synchronization.
- Better logging around controller commands.
Avoid:
- Hard-coded source user-agent branches.
- Site-specific ad skipping.
- Reimplementing HLS in the protocol layer.
- Rewriting media URLs unless the controller provided a broken relative path inside a context we can safely resolve.
- DRM bypass, login emulation, or private API scraping.
HLS should normally be handled by libmpv/FFmpeg.
The project should not maintain a generic HLS gateway/proxy unless there is a precise, reproducible problem that cannot be solved by the media stack.
For relative segment URLs in playlists, the expected owner is FFmpeg's HLS demuxer. If it fails, first capture the original playlist and confirm whether the playlist itself is malformed or whether the media toolchain has a Switch-specific network bug.
Symptoms:
- Controller repeatedly requests
description.xml. - Controller never sends SOAP commands.
- Controller fetches SCPD but does not show the renderer as playable.
Likely areas:
- SSDP response headers.
LOCATION.- Device identity fields.
SCPDURL,controlURL, andeventSubURL.SinkProtocolInfo.
Symptoms:
- Controller sends commands but playback does not start.
- Actions are logged with unknown service/action.
- SOAP body is routed to the wrong service.
Likely areas:
- SOAPAction parsing.
- URL path mapping.
- XML namespace handling.
- Argument extraction.
Symptoms:
SetAVTransportURIsucceeds but media does not play.libmpvlogs demux or decode errors.- Playback stalls after ad insertion, seek, or pause/resume.
Likely areas:
- Media URL validity.
- FFmpeg protocol support.
- Hardware decode path.
- Cache/buffer behavior.
- Source-side stream changes.
Logs should identify:
- Source IP and port.
- Request path.
- User-Agent.
- SOAP service and action.
- Sequence number for media loads.
- Current URI.
- Player state transitions.
- Seek target and final position.
Sequence numbers are useful when a source inserts ads or sends multiple media URLs in quick succession.
When diagnosing a source:
- Capture SSDP, HTTP description, SCPD, SOAP, and player logs.
- Save the exact media URL passed through
SetAVTransportURI. - Test whether desktop mpv can open the same URL.
- Test whether Switch
libmpvcan open it without DLNA. - Compare hardware decode and software decode only when it helps isolate media-stack behavior.
The final product should use hardware decode, but software decode can still be useful as a diagnostic control.