2016-02-19 09:39:29 +00:00
|
|
|
/*
|
2016-02-29 16:50:39 +00:00
|
|
|
* This file is part of FFmpeg.
|
2016-02-19 09:39:29 +00:00
|
|
|
*
|
2016-02-29 16:50:39 +00:00
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
2016-02-19 09:39:29 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
2016-02-29 16:50:39 +00:00
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
2016-02-19 09:39:29 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2016-02-29 16:50:39 +00:00
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
2016-02-19 09:39:29 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2016-02-19 10:17:22 +00:00
|
|
|
#include "libavutil/avstring.h"
|
|
|
|
#include "libavutil/mem.h"
|
|
|
|
|
2016-02-19 09:39:29 +00:00
|
|
|
#include "url.h"
|
|
|
|
|
2016-02-29 16:50:39 +00:00
|
|
|
extern const URLProtocol ff_async_protocol;
|
|
|
|
extern const URLProtocol ff_bluray_protocol;
|
|
|
|
extern const URLProtocol ff_cache_protocol;
|
2016-02-19 09:39:29 +00:00
|
|
|
extern const URLProtocol ff_concat_protocol;
|
|
|
|
extern const URLProtocol ff_crypto_protocol;
|
2016-02-29 16:50:39 +00:00
|
|
|
extern const URLProtocol ff_data_protocol;
|
2016-02-19 09:39:29 +00:00
|
|
|
extern const URLProtocol ff_ffrtmpcrypt_protocol;
|
|
|
|
extern const URLProtocol ff_ffrtmphttp_protocol;
|
|
|
|
extern const URLProtocol ff_file_protocol;
|
2016-02-29 16:50:39 +00:00
|
|
|
extern const URLProtocol ff_ftp_protocol;
|
2016-02-19 09:39:29 +00:00
|
|
|
extern const URLProtocol ff_gopher_protocol;
|
|
|
|
extern const URLProtocol ff_hls_protocol;
|
|
|
|
extern const URLProtocol ff_http_protocol;
|
|
|
|
extern const URLProtocol ff_httpproxy_protocol;
|
|
|
|
extern const URLProtocol ff_https_protocol;
|
|
|
|
extern const URLProtocol ff_icecast_protocol;
|
|
|
|
extern const URLProtocol ff_mmsh_protocol;
|
|
|
|
extern const URLProtocol ff_mmst_protocol;
|
|
|
|
extern const URLProtocol ff_md5_protocol;
|
|
|
|
extern const URLProtocol ff_pipe_protocol;
|
2016-06-02 14:28:13 +00:00
|
|
|
extern const URLProtocol ff_prompeg_protocol;
|
2016-02-19 09:39:29 +00:00
|
|
|
extern const URLProtocol ff_rtmp_protocol;
|
|
|
|
extern const URLProtocol ff_rtmpe_protocol;
|
|
|
|
extern const URLProtocol ff_rtmps_protocol;
|
|
|
|
extern const URLProtocol ff_rtmpt_protocol;
|
|
|
|
extern const URLProtocol ff_rtmpte_protocol;
|
|
|
|
extern const URLProtocol ff_rtmpts_protocol;
|
|
|
|
extern const URLProtocol ff_rtp_protocol;
|
|
|
|
extern const URLProtocol ff_sctp_protocol;
|
|
|
|
extern const URLProtocol ff_srtp_protocol;
|
2016-02-29 16:50:39 +00:00
|
|
|
extern const URLProtocol ff_subfile_protocol;
|
2016-07-18 12:42:22 +00:00
|
|
|
extern const URLProtocol ff_tee_protocol;
|
2016-02-19 09:39:29 +00:00
|
|
|
extern const URLProtocol ff_tcp_protocol;
|
|
|
|
extern const URLProtocol ff_tls_gnutls_protocol;
|
2016-02-29 16:50:39 +00:00
|
|
|
extern const URLProtocol ff_tls_schannel_protocol;
|
|
|
|
extern const URLProtocol ff_tls_securetransport_protocol;
|
2016-02-19 09:39:29 +00:00
|
|
|
extern const URLProtocol ff_tls_openssl_protocol;
|
|
|
|
extern const URLProtocol ff_udp_protocol;
|
2016-02-29 16:50:39 +00:00
|
|
|
extern const URLProtocol ff_udplite_protocol;
|
2016-02-19 09:39:29 +00:00
|
|
|
extern const URLProtocol ff_unix_protocol;
|
|
|
|
extern const URLProtocol ff_librtmp_protocol;
|
|
|
|
extern const URLProtocol ff_librtmpe_protocol;
|
|
|
|
extern const URLProtocol ff_librtmps_protocol;
|
|
|
|
extern const URLProtocol ff_librtmpt_protocol;
|
|
|
|
extern const URLProtocol ff_librtmpte_protocol;
|
2016-02-29 16:50:39 +00:00
|
|
|
extern const URLProtocol ff_libssh_protocol;
|
|
|
|
extern const URLProtocol ff_libsmbclient_protocol;
|
2016-02-19 09:39:29 +00:00
|
|
|
|
2016-03-20 09:00:58 +00:00
|
|
|
#include "libavformat/protocol_list.c"
|
2016-02-19 09:49:10 +00:00
|
|
|
|
2016-02-19 09:59:46 +00:00
|
|
|
const AVClass *ff_urlcontext_child_class_next(const AVClass *prev)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* find the protocol that corresponds to prev */
|
2016-02-29 18:04:54 +00:00
|
|
|
for (i = 0; prev && url_protocols[i]; i++) {
|
2016-02-19 10:17:22 +00:00
|
|
|
if (url_protocols[i]->priv_data_class == prev) {
|
2016-02-19 09:59:46 +00:00
|
|
|
i++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* find next protocol with priv options */
|
2016-02-19 10:17:22 +00:00
|
|
|
for (; url_protocols[i]; i++)
|
|
|
|
if (url_protocols[i]->priv_data_class)
|
|
|
|
return url_protocols[i]->priv_data_class;
|
2016-02-19 09:59:46 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-02-19 09:49:10 +00:00
|
|
|
const char *avio_enum_protocols(void **opaque, int output)
|
|
|
|
{
|
|
|
|
const URLProtocol **p = *opaque;
|
|
|
|
|
2016-02-19 10:17:22 +00:00
|
|
|
p = p ? p + 1 : url_protocols;
|
2016-02-19 09:49:10 +00:00
|
|
|
*opaque = p;
|
|
|
|
if (!*p) {
|
|
|
|
*opaque = NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if ((output && (*p)->url_write) || (!output && (*p)->url_read))
|
|
|
|
return (*p)->name;
|
|
|
|
return avio_enum_protocols(opaque, output);
|
|
|
|
}
|
2016-02-19 10:17:22 +00:00
|
|
|
|
|
|
|
const URLProtocol **ffurl_get_protocols(const char *whitelist,
|
|
|
|
const char *blacklist)
|
|
|
|
{
|
|
|
|
const URLProtocol **ret;
|
|
|
|
int i, ret_idx = 0;
|
|
|
|
|
|
|
|
ret = av_mallocz_array(FF_ARRAY_ELEMS(url_protocols), sizeof(*ret));
|
|
|
|
if (!ret)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
for (i = 0; url_protocols[i]; i++) {
|
|
|
|
const URLProtocol *up = url_protocols[i];
|
|
|
|
|
|
|
|
if (whitelist && *whitelist && !av_match_name(up->name, whitelist))
|
|
|
|
continue;
|
|
|
|
if (blacklist && *blacklist && av_match_name(up->name, blacklist))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
ret[ret_idx++] = up;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|