diff options
author | Dudemanguy <random342@airmail.cc> | 2024-05-15 19:22:32 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-05-22 20:10:52 +0000 |
commit | f921b64ed798f818e9a2d2ce2dff9fc63e4b8409 (patch) | |
tree | 19d7be06250891abdd22f54ccc102ea16d436285 /common/av_common.h | |
parent | 406301f23d421f5bb6791b13f9397bde3b1f615a (diff) | |
download | mpv-f921b64ed798f818e9a2d2ce2dff9fc63e4b8409.tar.bz2 mpv-f921b64ed798f818e9a2d2ce2dff9fc63e4b8409.tar.xz |
stream: implement get_protocols method for stream_lavf
Previously, all stream protocols were a static list in mpv. This is okay
for own builtin stuff, but for protocols that depend on ffmpeg it's not
so great. Support for certain protocols may or may not be enabled in a
user's ffmpeg and the protocol list that mpv generates should ideally
match this. Fix this by implementing a get_protocols method for
stream_lavf that will have different results depending on the ffmpeg mpv
is built against. We keep the safe and unsafe protocols separation. The
former is essentially a whitelist. Any protocol that is found in ffmpeg
but is not in the safe whitelist is considered unsafe. In the stream
list, ffmpeg is moved to the bottom so any possible protocols that are
added in the future don't automatically take precedence over any builtin
mpv ones.
Diffstat (limited to 'common/av_common.h')
-rw-r--r-- | common/av_common.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/common/av_common.h b/common/av_common.h index c584085890..b019aa88e1 100644 --- a/common/av_common.h +++ b/common/av_common.h @@ -42,6 +42,7 @@ void mp_set_avcodec_threads(struct mp_log *l, AVCodecContext *avctx, int threads void mp_add_lavc_decoders(struct mp_decoder_list *list, enum AVMediaType type); void mp_add_lavc_encoders(struct mp_decoder_list *list); char **mp_get_lavf_demuxers(void); +char **mp_get_lavf_protocols(void); int mp_codec_to_av_codec_id(const char *codec); const char *mp_codec_from_av_codec_id(int codec_id); bool mp_codec_is_lossless(const char *codec); |