mirror of https://git.ffmpeg.org/ffmpeg.git
Merge commit 'fab8156b2f30666adabe227b3d7712fd193873b1'
* commit 'fab8156b2f30666adabe227b3d7712fd193873b1': avio: Copy URLContext generic options into child URLContexts Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
This commit is contained in:
commit
f8e89d8a29
|
@ -251,7 +251,7 @@ static int async_open(URLContext *h, const char *arg, int flags, AVDictionary **
|
||||||
|
|
||||||
/* wrap interrupt callback */
|
/* wrap interrupt callback */
|
||||||
c->interrupt_callback = h->interrupt_callback;
|
c->interrupt_callback = h->interrupt_callback;
|
||||||
ret = ffurl_open_whitelist(&c->inner, arg, flags, &interrupt_callback, options, h->protocol_whitelist, h->protocol_blacklist);
|
ret = ffurl_open_whitelist(&c->inner, arg, flags, &interrupt_callback, options, h->protocol_whitelist, h->protocol_blacklist, h);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
av_log(h, AV_LOG_ERROR, "ffurl_open failed : %s, %s\n", av_err2str(ret), arg);
|
av_log(h, AV_LOG_ERROR, "ffurl_open failed : %s, %s\n", av_err2str(ret), arg);
|
||||||
goto url_fail;
|
goto url_fail;
|
||||||
|
|
|
@ -305,13 +305,16 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags,
|
||||||
|
|
||||||
int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags,
|
int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags,
|
||||||
const AVIOInterruptCB *int_cb, AVDictionary **options,
|
const AVIOInterruptCB *int_cb, AVDictionary **options,
|
||||||
const char *whitelist, const char* blacklist)
|
const char *whitelist, const char* blacklist,
|
||||||
|
URLContext *parent)
|
||||||
{
|
{
|
||||||
AVDictionary *tmp_opts = NULL;
|
AVDictionary *tmp_opts = NULL;
|
||||||
AVDictionaryEntry *e;
|
AVDictionaryEntry *e;
|
||||||
int ret = ffurl_alloc(puc, filename, flags, int_cb);
|
int ret = ffurl_alloc(puc, filename, flags, int_cb);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
if (parent)
|
||||||
|
av_opt_copy(*puc, parent);
|
||||||
if (options &&
|
if (options &&
|
||||||
(ret = av_opt_set_dict(*puc, options)) < 0)
|
(ret = av_opt_set_dict(*puc, options)) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -352,7 +355,7 @@ int ffurl_open(URLContext **puc, const char *filename, int flags,
|
||||||
const AVIOInterruptCB *int_cb, AVDictionary **options)
|
const AVIOInterruptCB *int_cb, AVDictionary **options)
|
||||||
{
|
{
|
||||||
return ffurl_open_whitelist(puc, filename, flags,
|
return ffurl_open_whitelist(puc, filename, flags,
|
||||||
int_cb, options, NULL, NULL);
|
int_cb, options, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int retry_transfer_wrapper(URLContext *h, uint8_t *buf,
|
static inline int retry_transfer_wrapper(URLContext *h, uint8_t *buf,
|
||||||
|
|
|
@ -989,7 +989,7 @@ int ffio_open_whitelist(AVIOContext **s, const char *filename, int flags,
|
||||||
URLContext *h;
|
URLContext *h;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = ffurl_open_whitelist(&h, filename, flags, int_cb, options, whitelist, blacklist);
|
err = ffurl_open_whitelist(&h, filename, flags, int_cb, options, whitelist, blacklist, NULL);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
err = ffio_fdopen(s, h);
|
err = ffio_fdopen(s, h);
|
||||||
|
|
|
@ -87,7 +87,7 @@ static int cache_open(URLContext *h, const char *arg, int flags, AVDictionary **
|
||||||
av_freep(&buffername);
|
av_freep(&buffername);
|
||||||
|
|
||||||
return ffurl_open_whitelist(&c->inner, arg, flags, &h->interrupt_callback,
|
return ffurl_open_whitelist(&c->inner, arg, flags, &h->interrupt_callback,
|
||||||
options, h->protocol_whitelist, h->protocol_blacklist);
|
options, h->protocol_whitelist, h->protocol_blacklist, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int add_entry(URLContext *h, const unsigned char *buf, int size)
|
static int add_entry(URLContext *h, const unsigned char *buf, int size)
|
||||||
|
|
|
@ -98,7 +98,7 @@ static av_cold int concat_open(URLContext *h, const char *uri, int flags)
|
||||||
|
|
||||||
/* creating URLContext */
|
/* creating URLContext */
|
||||||
err = ffurl_open_whitelist(&uc, node_uri, flags,
|
err = ffurl_open_whitelist(&uc, node_uri, flags,
|
||||||
&h->interrupt_callback, NULL, h->protocol_whitelist, h->protocol_blacklist);
|
&h->interrupt_callback, NULL, h->protocol_whitelist, h->protocol_blacklist, h);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ static int crypto_open2(URLContext *h, const char *uri, int flags, AVDictionary
|
||||||
|
|
||||||
if ((ret = ffurl_open_whitelist(&c->hd, nested_url, flags,
|
if ((ret = ffurl_open_whitelist(&c->hd, nested_url, flags,
|
||||||
&h->interrupt_callback, options,
|
&h->interrupt_callback, options,
|
||||||
h->protocol_whitelist, h->protocol_blacklist)) < 0) {
|
h->protocol_whitelist, h->protocol_blacklist, h)) < 0) {
|
||||||
av_log(h, AV_LOG_ERROR, "Unable to open resource: %s\n", nested_url);
|
av_log(h, AV_LOG_ERROR, "Unable to open resource: %s\n", nested_url);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -543,7 +543,7 @@ static int ftp_connect_control_connection(URLContext *h)
|
||||||
} /* if option is not given, don't pass it and let tcp use its own default */
|
} /* if option is not given, don't pass it and let tcp use its own default */
|
||||||
err = ffurl_open_whitelist(&s->conn_control, buf, AVIO_FLAG_READ_WRITE,
|
err = ffurl_open_whitelist(&s->conn_control, buf, AVIO_FLAG_READ_WRITE,
|
||||||
&h->interrupt_callback, &opts,
|
&h->interrupt_callback, &opts,
|
||||||
h->protocol_whitelist, h->protocol_blacklist);
|
h->protocol_whitelist, h->protocol_blacklist, h);
|
||||||
av_dict_free(&opts);
|
av_dict_free(&opts);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
av_log(h, AV_LOG_ERROR, "Cannot open control connection\n");
|
av_log(h, AV_LOG_ERROR, "Cannot open control connection\n");
|
||||||
|
@ -597,7 +597,7 @@ static int ftp_connect_data_connection(URLContext *h)
|
||||||
} /* if option is not given, don't pass it and let tcp use its own default */
|
} /* if option is not given, don't pass it and let tcp use its own default */
|
||||||
err = ffurl_open_whitelist(&s->conn_data, buf, h->flags,
|
err = ffurl_open_whitelist(&s->conn_data, buf, h->flags,
|
||||||
&h->interrupt_callback, &opts,
|
&h->interrupt_callback, &opts,
|
||||||
h->protocol_whitelist, h->protocol_blacklist);
|
h->protocol_whitelist, h->protocol_blacklist, h);
|
||||||
av_dict_free(&opts);
|
av_dict_free(&opts);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
|
@ -94,7 +94,7 @@ static int gopher_open(URLContext *h, const char *uri, int flags)
|
||||||
|
|
||||||
s->hd = NULL;
|
s->hd = NULL;
|
||||||
err = ffurl_open_whitelist(&s->hd, buf, AVIO_FLAG_READ_WRITE,
|
err = ffurl_open_whitelist(&s->hd, buf, AVIO_FLAG_READ_WRITE,
|
||||||
&h->interrupt_callback, NULL, h->protocol_whitelist, h->protocol_blacklist);
|
&h->interrupt_callback, NULL, h->protocol_whitelist, h->protocol_blacklist, h);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
|
|
@ -307,7 +307,7 @@ retry:
|
||||||
av_log(h, AV_LOG_DEBUG, "opening %s\n", url);
|
av_log(h, AV_LOG_DEBUG, "opening %s\n", url);
|
||||||
ret = ffurl_open_whitelist(&s->seg_hd, url, AVIO_FLAG_READ,
|
ret = ffurl_open_whitelist(&s->seg_hd, url, AVIO_FLAG_READ,
|
||||||
&h->interrupt_callback, NULL,
|
&h->interrupt_callback, NULL,
|
||||||
h->protocol_whitelist, h->protocol_blacklist);
|
h->protocol_whitelist, h->protocol_blacklist, h);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (ff_check_interrupt(&h->interrupt_callback))
|
if (ff_check_interrupt(&h->interrupt_callback))
|
||||||
return AVERROR_EXIT;
|
return AVERROR_EXIT;
|
||||||
|
|
|
@ -221,7 +221,7 @@ static int http_open_cnx_internal(URLContext *h, AVDictionary **options)
|
||||||
if (!s->hd) {
|
if (!s->hd) {
|
||||||
err = ffurl_open_whitelist(&s->hd, buf, AVIO_FLAG_READ_WRITE,
|
err = ffurl_open_whitelist(&s->hd, buf, AVIO_FLAG_READ_WRITE,
|
||||||
&h->interrupt_callback, options,
|
&h->interrupt_callback, options,
|
||||||
h->protocol_whitelist, h->protocol_blacklist);
|
h->protocol_whitelist, h->protocol_blacklist, h);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -456,7 +456,7 @@ static int http_listen(URLContext *h, const char *uri, int flags,
|
||||||
goto fail;
|
goto fail;
|
||||||
if ((ret = ffurl_open_whitelist(&s->hd, lower_url, AVIO_FLAG_READ_WRITE,
|
if ((ret = ffurl_open_whitelist(&s->hd, lower_url, AVIO_FLAG_READ_WRITE,
|
||||||
&h->interrupt_callback, options,
|
&h->interrupt_callback, options,
|
||||||
h->protocol_whitelist, h->protocol_blacklist
|
h->protocol_whitelist, h->protocol_blacklist, h
|
||||||
)) < 0)
|
)) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
s->handshake_step = LOWER_PROTO;
|
s->handshake_step = LOWER_PROTO;
|
||||||
|
@ -1582,7 +1582,7 @@ static int http_proxy_open(URLContext *h, const char *uri, int flags)
|
||||||
redo:
|
redo:
|
||||||
ret = ffurl_open_whitelist(&s->hd, lower_url, AVIO_FLAG_READ_WRITE,
|
ret = ffurl_open_whitelist(&s->hd, lower_url, AVIO_FLAG_READ_WRITE,
|
||||||
&h->interrupt_callback, NULL,
|
&h->interrupt_callback, NULL,
|
||||||
h->protocol_whitelist, h->protocol_blacklist);
|
h->protocol_whitelist, h->protocol_blacklist, h);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,7 @@ static int icecast_open(URLContext *h, const char *uri, int flags)
|
||||||
ff_url_join(h_url, sizeof(h_url), "http", auth, host, port, "%s", path);
|
ff_url_join(h_url, sizeof(h_url), "http", auth, host, port, "%s", path);
|
||||||
// Finally open http proto handler
|
// Finally open http proto handler
|
||||||
ret = ffurl_open_whitelist(&s->hd, h_url, AVIO_FLAG_READ_WRITE, NULL,
|
ret = ffurl_open_whitelist(&s->hd, h_url, AVIO_FLAG_READ_WRITE, NULL,
|
||||||
&opt_dict, h->protocol_whitelist, h->protocol_blacklist);
|
&opt_dict, h->protocol_whitelist, h->protocol_blacklist, h);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
av_freep(&user);
|
av_freep(&user);
|
||||||
|
|
|
@ -71,7 +71,7 @@ static int md5_close(URLContext *h)
|
||||||
if (*filename) {
|
if (*filename) {
|
||||||
err = ffurl_open_whitelist(&out, filename, AVIO_FLAG_WRITE,
|
err = ffurl_open_whitelist(&out, filename, AVIO_FLAG_WRITE,
|
||||||
&h->interrupt_callback, NULL,
|
&h->interrupt_callback, NULL,
|
||||||
h->protocol_whitelist, h->protocol_blacklist);
|
h->protocol_whitelist, h->protocol_blacklist, h);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
err = ffurl_write(out, buf, i*2+1);
|
err = ffurl_write(out, buf, i*2+1);
|
||||||
|
|
|
@ -530,7 +530,7 @@ static int mms_open(URLContext *h, const char *uri, int flags)
|
||||||
ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, mmst->host, port, NULL);
|
ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, mmst->host, port, NULL);
|
||||||
err = ffurl_open_whitelist(&mms->mms_hd, tcpname, AVIO_FLAG_READ_WRITE,
|
err = ffurl_open_whitelist(&mms->mms_hd, tcpname, AVIO_FLAG_READ_WRITE,
|
||||||
&h->interrupt_callback, NULL,
|
&h->interrupt_callback, NULL,
|
||||||
h->protocol_whitelist, h->protocol_blacklist);
|
h->protocol_whitelist, h->protocol_blacklist, h);
|
||||||
if (err)
|
if (err)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
|
|
@ -266,7 +266,7 @@ static int rtmpe_open(URLContext *h, const char *uri, int flags)
|
||||||
/* open the tcp or ffrtmphttp connection */
|
/* open the tcp or ffrtmphttp connection */
|
||||||
if ((ret = ffurl_open_whitelist(&rt->stream, url, AVIO_FLAG_READ_WRITE,
|
if ((ret = ffurl_open_whitelist(&rt->stream, url, AVIO_FLAG_READ_WRITE,
|
||||||
&h->interrupt_callback, NULL,
|
&h->interrupt_callback, NULL,
|
||||||
h->protocol_whitelist, h->protocol_blacklist)) < 0) {
|
h->protocol_whitelist, h->protocol_blacklist, h)) < 0) {
|
||||||
rtmpe_close(h);
|
rtmpe_close(h);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1120,7 +1120,7 @@ static int rtmp_calc_swfhash(URLContext *s)
|
||||||
/* Get the SWF player file. */
|
/* Get the SWF player file. */
|
||||||
if ((ret = ffurl_open_whitelist(&stream, rt->swfverify, AVIO_FLAG_READ,
|
if ((ret = ffurl_open_whitelist(&stream, rt->swfverify, AVIO_FLAG_READ,
|
||||||
&s->interrupt_callback, NULL,
|
&s->interrupt_callback, NULL,
|
||||||
s->protocol_whitelist, s->protocol_blacklist)) < 0) {
|
s->protocol_whitelist, s->protocol_blacklist, s)) < 0) {
|
||||||
av_log(s, AV_LOG_ERROR, "Cannot open connection %s.\n", rt->swfverify);
|
av_log(s, AV_LOG_ERROR, "Cannot open connection %s.\n", rt->swfverify);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
@ -2650,7 +2650,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
|
||||||
reconnect:
|
reconnect:
|
||||||
if ((ret = ffurl_open_whitelist(&rt->stream, buf, AVIO_FLAG_READ_WRITE,
|
if ((ret = ffurl_open_whitelist(&rt->stream, buf, AVIO_FLAG_READ_WRITE,
|
||||||
&s->interrupt_callback, &opts,
|
&s->interrupt_callback, &opts,
|
||||||
s->protocol_whitelist, s->protocol_blacklist)) < 0) {
|
s->protocol_whitelist, s->protocol_blacklist, s)) < 0) {
|
||||||
av_log(s , AV_LOG_ERROR, "Cannot open connection %s\n", buf);
|
av_log(s , AV_LOG_ERROR, "Cannot open connection %s\n", buf);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,7 +382,7 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
|
||||||
hostname, rtp_port, s->local_rtpport,
|
hostname, rtp_port, s->local_rtpport,
|
||||||
sources, block);
|
sources, block);
|
||||||
if (ffurl_open_whitelist(&s->rtp_hd, buf, flags, &h->interrupt_callback,
|
if (ffurl_open_whitelist(&s->rtp_hd, buf, flags, &h->interrupt_callback,
|
||||||
NULL, h->protocol_whitelist, h->protocol_blacklist) < 0)
|
NULL, h->protocol_whitelist, h->protocol_blacklist, h) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
s->local_rtpport = ff_udp_get_local_port(s->rtp_hd);
|
s->local_rtpport = ff_udp_get_local_port(s->rtp_hd);
|
||||||
if(s->local_rtpport == 65535) {
|
if(s->local_rtpport == 65535) {
|
||||||
|
@ -397,7 +397,7 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
|
||||||
sources, block);
|
sources, block);
|
||||||
if (ffurl_open_whitelist(&s->rtcp_hd, buf, rtcpflags,
|
if (ffurl_open_whitelist(&s->rtcp_hd, buf, rtcpflags,
|
||||||
&h->interrupt_callback, NULL,
|
&h->interrupt_callback, NULL,
|
||||||
h->protocol_whitelist, h->protocol_blacklist) < 0) {
|
h->protocol_whitelist, h->protocol_blacklist, h) < 0) {
|
||||||
s->local_rtpport = s->local_rtcpport = -1;
|
s->local_rtpport = s->local_rtcpport = -1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -407,7 +407,7 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
|
||||||
hostname, s->rtcp_port, s->local_rtcpport,
|
hostname, s->rtcp_port, s->local_rtcpport,
|
||||||
sources, block);
|
sources, block);
|
||||||
if (ffurl_open_whitelist(&s->rtcp_hd, buf, rtcpflags, &h->interrupt_callback,
|
if (ffurl_open_whitelist(&s->rtcp_hd, buf, rtcpflags, &h->interrupt_callback,
|
||||||
NULL, h->protocol_whitelist, h->protocol_blacklist) < 0)
|
NULL, h->protocol_whitelist, h->protocol_blacklist, h) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1469,7 +1469,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
|
||||||
/* we will use two ports per rtp stream (rtp and rtcp) */
|
/* we will use two ports per rtp stream (rtp and rtcp) */
|
||||||
j += 2;
|
j += 2;
|
||||||
err = ffurl_open_whitelist(&rtsp_st->rtp_handle, buf, AVIO_FLAG_READ_WRITE,
|
err = ffurl_open_whitelist(&rtsp_st->rtp_handle, buf, AVIO_FLAG_READ_WRITE,
|
||||||
&s->interrupt_callback, &opts, s->protocol_whitelist, s->protocol_blacklist);
|
&s->interrupt_callback, &opts, s->protocol_whitelist, s->protocol_blacklist, NULL);
|
||||||
|
|
||||||
av_dict_free(&opts);
|
av_dict_free(&opts);
|
||||||
|
|
||||||
|
@ -1612,7 +1612,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
|
||||||
ff_url_join(url, sizeof(url), "rtp", NULL, namebuf,
|
ff_url_join(url, sizeof(url), "rtp", NULL, namebuf,
|
||||||
port, "%s", optbuf);
|
port, "%s", optbuf);
|
||||||
if (ffurl_open_whitelist(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE,
|
if (ffurl_open_whitelist(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE,
|
||||||
&s->interrupt_callback, NULL, s->protocol_whitelist, s->protocol_blacklist) < 0) {
|
&s->interrupt_callback, NULL, s->protocol_whitelist, s->protocol_blacklist, NULL) < 0) {
|
||||||
err = AVERROR_INVALIDDATA;
|
err = AVERROR_INVALIDDATA;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
@ -1801,7 +1801,7 @@ redirect:
|
||||||
host, port,
|
host, port,
|
||||||
"?timeout=%d", rt->stimeout);
|
"?timeout=%d", rt->stimeout);
|
||||||
if ((ret = ffurl_open_whitelist(&rt->rtsp_hd, tcpname, AVIO_FLAG_READ_WRITE,
|
if ((ret = ffurl_open_whitelist(&rt->rtsp_hd, tcpname, AVIO_FLAG_READ_WRITE,
|
||||||
&s->interrupt_callback, NULL, s->protocol_whitelist, s->protocol_blacklist)) < 0) {
|
&s->interrupt_callback, NULL, s->protocol_whitelist, s->protocol_blacklist, NULL)) < 0) {
|
||||||
err = ret;
|
err = ret;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
@ -2317,7 +2317,7 @@ static int sdp_read_header(AVFormatContext *s)
|
||||||
rtsp_st->nb_exclude_source_addrs,
|
rtsp_st->nb_exclude_source_addrs,
|
||||||
rtsp_st->exclude_source_addrs);
|
rtsp_st->exclude_source_addrs);
|
||||||
err = ffurl_open_whitelist(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ,
|
err = ffurl_open_whitelist(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ,
|
||||||
&s->interrupt_callback, &opts, s->protocol_whitelist, s->protocol_blacklist);
|
&s->interrupt_callback, &opts, s->protocol_whitelist, s->protocol_blacklist, NULL);
|
||||||
|
|
||||||
av_dict_free(&opts);
|
av_dict_free(&opts);
|
||||||
|
|
||||||
|
@ -2387,7 +2387,7 @@ static int rtp_read_header(AVFormatContext *s)
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
|
|
||||||
ret = ffurl_open_whitelist(&in, s->filename, AVIO_FLAG_READ,
|
ret = ffurl_open_whitelist(&in, s->filename, AVIO_FLAG_READ,
|
||||||
&s->interrupt_callback, NULL, s->protocol_whitelist, s->protocol_blacklist);
|
&s->interrupt_callback, NULL, s->protocol_whitelist, s->protocol_blacklist, NULL);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
|
|
@ -296,7 +296,7 @@ static int rtsp_read_setup(AVFormatContext *s, char* host, char *controlurl)
|
||||||
av_log(s, AV_LOG_TRACE, "Opening: %s", url);
|
av_log(s, AV_LOG_TRACE, "Opening: %s", url);
|
||||||
ret = ffurl_open_whitelist(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE,
|
ret = ffurl_open_whitelist(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE,
|
||||||
&s->interrupt_callback, &opts,
|
&s->interrupt_callback, &opts,
|
||||||
s->protocol_whitelist, s->protocol_blacklist);
|
s->protocol_whitelist, s->protocol_blacklist, NULL);
|
||||||
av_dict_free(&opts);
|
av_dict_free(&opts);
|
||||||
if (ret)
|
if (ret)
|
||||||
localport += 2;
|
localport += 2;
|
||||||
|
@ -665,7 +665,7 @@ static int rtsp_listen(AVFormatContext *s)
|
||||||
|
|
||||||
if (ret = ffurl_open_whitelist(&rt->rtsp_hd, tcpname, AVIO_FLAG_READ_WRITE,
|
if (ret = ffurl_open_whitelist(&rt->rtsp_hd, tcpname, AVIO_FLAG_READ_WRITE,
|
||||||
&s->interrupt_callback, NULL,
|
&s->interrupt_callback, NULL,
|
||||||
s->protocol_whitelist, s->protocol_blacklist)) {
|
s->protocol_whitelist, s->protocol_blacklist, NULL)) {
|
||||||
av_log(s, AV_LOG_ERROR, "Unable to open RTSP for listening\n");
|
av_log(s, AV_LOG_ERROR, "Unable to open RTSP for listening\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ static int sap_read_header(AVFormatContext *s)
|
||||||
port);
|
port);
|
||||||
ret = ffurl_open_whitelist(&sap->ann_fd, url, AVIO_FLAG_READ,
|
ret = ffurl_open_whitelist(&sap->ann_fd, url, AVIO_FLAG_READ,
|
||||||
&s->interrupt_callback, NULL,
|
&s->interrupt_callback, NULL,
|
||||||
s->protocol_whitelist, s->protocol_blacklist);
|
s->protocol_whitelist, s->protocol_blacklist, NULL);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ static int sap_write_header(AVFormatContext *s)
|
||||||
base_port += 2;
|
base_port += 2;
|
||||||
ret = ffurl_open_whitelist(&fd, url, AVIO_FLAG_WRITE,
|
ret = ffurl_open_whitelist(&fd, url, AVIO_FLAG_WRITE,
|
||||||
&s->interrupt_callback, NULL,
|
&s->interrupt_callback, NULL,
|
||||||
s->protocol_whitelist, s->protocol_blacklist);
|
s->protocol_whitelist, s->protocol_blacklist, NULL);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ret = AVERROR(EIO);
|
ret = AVERROR(EIO);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -171,7 +171,7 @@ static int sap_write_header(AVFormatContext *s)
|
||||||
"?ttl=%d&connect=1", ttl);
|
"?ttl=%d&connect=1", ttl);
|
||||||
ret = ffurl_open_whitelist(&sap->ann_fd, url, AVIO_FLAG_WRITE,
|
ret = ffurl_open_whitelist(&sap->ann_fd, url, AVIO_FLAG_WRITE,
|
||||||
&s->interrupt_callback, NULL,
|
&s->interrupt_callback, NULL,
|
||||||
s->protocol_whitelist, s->protocol_blacklist);
|
s->protocol_whitelist, s->protocol_blacklist, NULL);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ret = AVERROR(EIO);
|
ret = AVERROR(EIO);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
@ -123,7 +123,7 @@ static int64_t ism_seek(void *opaque, int64_t offset, int whence)
|
||||||
os->tail_out = os->out;
|
os->tail_out = os->out;
|
||||||
av_dict_set(&opts, "truncate", "0", 0);
|
av_dict_set(&opts, "truncate", "0", 0);
|
||||||
ret = ffurl_open_whitelist(&os->out, frag->file, AVIO_FLAG_WRITE,
|
ret = ffurl_open_whitelist(&os->out, frag->file, AVIO_FLAG_WRITE,
|
||||||
&os->ctx->interrupt_callback, &opts, os->ctx->protocol_whitelist, os->ctx->protocol_blacklist);
|
&os->ctx->interrupt_callback, &opts, os->ctx->protocol_whitelist, os->ctx->protocol_blacklist, NULL);
|
||||||
av_dict_free(&opts);
|
av_dict_free(&opts);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
os->out = os->tail_out;
|
os->out = os->tail_out;
|
||||||
|
@ -132,7 +132,7 @@ static int64_t ism_seek(void *opaque, int64_t offset, int whence)
|
||||||
}
|
}
|
||||||
av_dict_set(&opts, "truncate", "0", 0);
|
av_dict_set(&opts, "truncate", "0", 0);
|
||||||
ffurl_open_whitelist(&os->out2, frag->infofile, AVIO_FLAG_WRITE,
|
ffurl_open_whitelist(&os->out2, frag->infofile, AVIO_FLAG_WRITE,
|
||||||
&os->ctx->interrupt_callback, &opts, os->ctx->protocol_whitelist, os->ctx->protocol_blacklist);
|
&os->ctx->interrupt_callback, &opts, os->ctx->protocol_whitelist, os->ctx->protocol_blacklist, NULL);
|
||||||
av_dict_free(&opts);
|
av_dict_free(&opts);
|
||||||
ffurl_seek(os->out, offset - frag->start_pos, SEEK_SET);
|
ffurl_seek(os->out, offset - frag->start_pos, SEEK_SET);
|
||||||
if (os->out2)
|
if (os->out2)
|
||||||
|
@ -526,7 +526,7 @@ static int ism_flush(AVFormatContext *s, int final)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
snprintf(filename, sizeof(filename), "%s/temp", os->dirname);
|
snprintf(filename, sizeof(filename), "%s/temp", os->dirname);
|
||||||
ret = ffurl_open_whitelist(&os->out, filename, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL, s->protocol_whitelist, s->protocol_blacklist);
|
ret = ffurl_open_whitelist(&os->out, filename, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL, s->protocol_whitelist, s->protocol_blacklist, NULL);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
break;
|
break;
|
||||||
os->cur_start_pos = os->tail_pos;
|
os->cur_start_pos = os->tail_pos;
|
||||||
|
|
|
@ -81,7 +81,7 @@ static int srtp_open(URLContext *h, const char *uri, int flags)
|
||||||
path, sizeof(path), uri);
|
path, sizeof(path), uri);
|
||||||
ff_url_join(buf, sizeof(buf), "rtp", NULL, hostname, rtp_port, "%s", path);
|
ff_url_join(buf, sizeof(buf), "rtp", NULL, hostname, rtp_port, "%s", path);
|
||||||
if ((ret = ffurl_open_whitelist(&s->rtp_hd, buf, flags, &h->interrupt_callback,
|
if ((ret = ffurl_open_whitelist(&s->rtp_hd, buf, flags, &h->interrupt_callback,
|
||||||
NULL, h->protocol_whitelist, h->protocol_blacklist)) < 0)
|
NULL, h->protocol_whitelist, h->protocol_blacklist, h)) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
h->max_packet_size = FFMIN(s->rtp_hd->max_packet_size,
|
h->max_packet_size = FFMIN(s->rtp_hd->max_packet_size,
|
||||||
|
|
|
@ -78,7 +78,7 @@ static int subfile_open(URLContext *h, const char *filename, int flags,
|
||||||
}
|
}
|
||||||
av_strstart(filename, "subfile:", &filename);
|
av_strstart(filename, "subfile:", &filename);
|
||||||
ret = ffurl_open_whitelist(&c->h, filename, flags, &h->interrupt_callback,
|
ret = ffurl_open_whitelist(&c->h, filename, flags, &h->interrupt_callback,
|
||||||
options, h->protocol_whitelist, h->protocol_blacklist);
|
options, h->protocol_whitelist, h->protocol_blacklist, h);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
c->pos = c->start;
|
c->pos = c->start;
|
||||||
|
|
|
@ -106,5 +106,5 @@ int ff_tls_open_underlying(TLSShared *c, URLContext *parent, const char *uri, AV
|
||||||
|
|
||||||
return ffurl_open_whitelist(&c->tcp, buf, AVIO_FLAG_READ_WRITE,
|
return ffurl_open_whitelist(&c->tcp, buf, AVIO_FLAG_READ_WRITE,
|
||||||
&parent->interrupt_callback, options,
|
&parent->interrupt_callback, options,
|
||||||
parent->protocol_whitelist, parent->protocol_blacklist);
|
parent->protocol_whitelist, parent->protocol_blacklist, parent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,12 +136,15 @@ int ffurl_connect(URLContext *uc, AVDictionary **options);
|
||||||
* @param options A dictionary filled with protocol-private options. On return
|
* @param options A dictionary filled with protocol-private options. On return
|
||||||
* this parameter will be destroyed and replaced with a dict containing options
|
* this parameter will be destroyed and replaced with a dict containing options
|
||||||
* that were not found. May be NULL.
|
* that were not found. May be NULL.
|
||||||
|
* @param parent An enclosing URLContext, whose generic options should
|
||||||
|
* be applied to this URLContext as well.
|
||||||
* @return >= 0 in case of success, a negative value corresponding to an
|
* @return >= 0 in case of success, a negative value corresponding to an
|
||||||
* AVERROR code in case of failure
|
* AVERROR code in case of failure
|
||||||
*/
|
*/
|
||||||
int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags,
|
int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags,
|
||||||
const AVIOInterruptCB *int_cb, AVDictionary **options,
|
const AVIOInterruptCB *int_cb, AVDictionary **options,
|
||||||
const char *whitelist, const char* blacklist);
|
const char *whitelist, const char* blacklist,
|
||||||
|
URLContext *parent);
|
||||||
|
|
||||||
int ffurl_open(URLContext **puc, const char *filename, int flags,
|
int ffurl_open(URLContext **puc, const char *filename, int flags,
|
||||||
const AVIOInterruptCB *int_cb, AVDictionary **options);
|
const AVIOInterruptCB *int_cb, AVDictionary **options);
|
||||||
|
|
Loading…
Reference in New Issue