A description of the currently available protocols follows.
-@section applehttp
+@section hls
Read Apple HTTP Live Streaming compliant segmented stream as
a uniform one. The M3U8 playlists describing the segments can be
remote HTTP resources or local files, accessed using the standard
file protocol.
-HTTP is default, specific protocol can be declared by specifying
-"+@var{proto}" after the applehttp URI scheme name, where @var{proto}
+The nested protocol is declared by specifying
+"+@var{proto}" after the hls URI scheme name, where @var{proto}
is either "file" or "http".
@example
-applehttp://host/path/to/remote/resource.m3u8
-applehttp+http://host/path/to/remote/resource.m3u8
-applehttp+file://path/to/local/resource.m3u8
+hls+http://host/path/to/remote/resource.m3u8
+hls+file://path/to/local/resource.m3u8
@end example
@section concat
# protocols I/O
OBJS+= avio.o aviobuf.o
-OBJS-$(CONFIG_APPLEHTTP_PROTOCOL) += applehttpproto.o
+OBJS-$(CONFIG_APPLEHTTP_PROTOCOL) += hlsproto.o
OBJS-$(CONFIG_CONCAT_PROTOCOL) += concat.o
OBJS-$(CONFIG_CRYPTO_PROTOCOL) += crypto.o
OBJS-$(CONFIG_FILE_PROTOCOL) += file.o
OBJS-$(CONFIG_GOPHER_PROTOCOL) += gopher.o
+OBJS-$(CONFIG_HLS_PROTOCOL) += hlsproto.o
OBJS-$(CONFIG_HTTP_PROTOCOL) += http.o httpauth.o
OBJS-$(CONFIG_HTTPPROXY_PROTOCOL) += http.o httpauth.o
OBJS-$(CONFIG_HTTPS_PROTOCOL) += http.o httpauth.o
#include "rtp.h"
#include "rdt.h"
#include "url.h"
+#include "version.h"
#define REGISTER_MUXER(X,x) { \
extern AVOutputFormat ff_##x##_muxer; \
REGISTER_MUXDEMUX (YUV4MPEGPIPE, yuv4mpegpipe);
/* protocols */
+#if FF_API_APPLEHTTP_PROTO
REGISTER_PROTOCOL (APPLEHTTP, applehttp);
+#endif
REGISTER_PROTOCOL (CONCAT, concat);
REGISTER_PROTOCOL (CRYPTO, crypto);
REGISTER_PROTOCOL (FILE, file);
REGISTER_PROTOCOL (GOPHER, gopher);
+ REGISTER_PROTOCOL (HLS, hls);
REGISTER_PROTOCOL (HTTP, http);
REGISTER_PROTOCOL (HTTPPROXY, httpproxy);
REGISTER_PROTOCOL (HTTPS, https);
#include "avformat.h"
#include "internal.h"
#include "url.h"
+#include "version.h"
#include <unistd.h>
/*
h->is_streamed = 1;
- if (av_strstart(uri, "applehttp+", &nested_url)) {
+ if (av_strstart(uri, "hls+", &nested_url)) {
av_strlcpy(s->playlisturl, nested_url, sizeof(s->playlisturl));
+ } else if (av_strstart(uri, "hls://", &nested_url)) {
+ av_log(h, AV_LOG_ERROR,
+ "No nested protocol specified. Specify e.g. hls+http://%s\n",
+ nested_url);
+ ret = AVERROR(EINVAL);
+ goto fail;
+#if FF_API_APPLEHTTP_PROTO
+ } else if (av_strstart(uri, "applehttp+", &nested_url)) {
+ av_strlcpy(s->playlisturl, nested_url, sizeof(s->playlisturl));
+ av_log(h, AV_LOG_WARNING,
+ "The applehttp protocol is deprecated, use hls+%s as url "
+ "instead.\n", nested_url);
} else if (av_strstart(uri, "applehttp://", &nested_url)) {
av_strlcpy(s->playlisturl, "http://", sizeof(s->playlisturl));
av_strlcat(s->playlisturl, nested_url, sizeof(s->playlisturl));
+ av_log(h, AV_LOG_WARNING,
+ "The applehttp protocol is deprecated, use hls+http://%s as url "
+ "instead.\n", nested_url);
+#endif
} else {
av_log(h, AV_LOG_ERROR, "Unsupported url %s\n", uri);
ret = AVERROR(EINVAL);
goto start;
}
+#if FF_API_APPLEHTTP_PROTO
URLProtocol ff_applehttp_protocol = {
.name = "applehttp",
.url_open = applehttp_open,
.flags = URL_PROTOCOL_FLAG_NESTED_SCHEME,
.priv_data_size = sizeof(AppleHTTPContext),
};
+#endif
+
+URLProtocol ff_hls_protocol = {
+ .name = "hls",
+ .url_open = applehttp_open,
+ .url_read = applehttp_read,
+ .url_close = applehttp_close,
+ .flags = URL_PROTOCOL_FLAG_NESTED_SCHEME,
+ .priv_data_size = sizeof(AppleHTTPContext),
+};