stream_curl: add support for Icecast metadata#17907
Open
kasper93 wants to merge 17 commits into
Open
Conversation
stream-lavf-o[cookies] only feeds the lavf stream backend. Instead of side-loading it, use core `--cookies-file` option.
Will be useful for future commits
Introduces stream_http, an internal libcurl-driven backend for http:// and https:// URLs. Runs all transfers on a dedicated curl multi thread with a producer-side ring buffer, and exposes HTTP/2 multiplexing, QUIC/HTTP/3 (when libcurl supports it), HSTS and TCP keep-alive. Should generally be more stable and faster than FFmpeg HTTP/1.1 impl, additionally connections are kept-alive between files open, so if you open playlist of network files and navigate through them, it will re-use the same connection. Build is gated on the new 'libcurl' meson option (auto). When disabled or unavailable, mpv silently falls back to FFmpeg's HTTP implementation.
Hook AVFormatContext.io_open so HLS/DASH segment fetches and other nested FFmpeg I/O go through stream_http when libcurl is available. This lets segments inherit the connection reuse, HTTP/2 multiplexing, mid-stream resume and conditional compression of the top-level stream. Falls back to FFmpeg's default I/O for non-HTTP URLs and when the curl backend is not built in.
Allow only subset of supported protocols by libcurl.
This is for stream_curl.
At the initial file open, the buffer may be populated with more data, than later requested by decoder, but don't drop this data. This fixes initial open to perform multiple reads of the area, especially for images that are likelly fully read for probbing already.
It's significantly more stable than Lavf. Fixes seeking out of cached ranges. Additionally correctly marks demuxer_is_network for ftp too.
Member
Author
|
This is extracting the metadata in similar way to http.c in lavf. However, I'm not certain if the in-line metadata, shouldn't be handled by the demuxer itself, to updated them as they are playing in current time, not as they arrive at transport level. Though, it was like that in lavf forever. Just for context, there are two kinds of information, in http header response, that mostly describe the stream and in data payload, interleaved with audio stream. Currently both are handled at transport level, but I doubt it's correct... |
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.
No description provided.