mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avio: make url_connect internal.
This commit is contained in:
parent
5652bb9471
commit
62eaaeacb5
@ -137,7 +137,7 @@ static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int url_connect(URLContext* uc)
|
int ffurl_connect(URLContext* uc)
|
||||||
{
|
{
|
||||||
int err = uc->prot->url_open(uc, uc->filename, uc->flags);
|
int err = uc->prot->url_open(uc, uc->filename, uc->flags);
|
||||||
if (err)
|
if (err)
|
||||||
@ -160,7 +160,7 @@ int url_open_protocol (URLContext **puc, struct URLProtocol *up,
|
|||||||
ret = url_alloc_for_protocol(puc, up, filename, flags);
|
ret = url_alloc_for_protocol(puc, up, filename, flags);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto fail;
|
goto fail;
|
||||||
ret = url_connect(*puc);
|
ret = ffurl_connect(*puc);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return 0;
|
return 0;
|
||||||
fail:
|
fail:
|
||||||
@ -172,6 +172,10 @@ int url_alloc(URLContext **puc, const char *filename, int flags)
|
|||||||
{
|
{
|
||||||
return ffurl_alloc(puc, filename, flags);
|
return ffurl_alloc(puc, filename, flags);
|
||||||
}
|
}
|
||||||
|
int url_connect(URLContext* uc)
|
||||||
|
{
|
||||||
|
return ffurl_connect(uc);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define URL_SCHEME_CHARS \
|
#define URL_SCHEME_CHARS \
|
||||||
@ -212,7 +216,7 @@ int url_open(URLContext **puc, const char *filename, int flags)
|
|||||||
int ret = ffurl_alloc(puc, filename, flags);
|
int ret = ffurl_alloc(puc, filename, flags);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
ret = url_connect(*puc);
|
ret = ffurl_connect(*puc);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return 0;
|
return 0;
|
||||||
url_close(*puc);
|
url_close(*puc);
|
||||||
|
@ -103,13 +103,9 @@ typedef int URLInterruptCB(void);
|
|||||||
attribute_deprecated int url_open_protocol (URLContext **puc, struct URLProtocol *up,
|
attribute_deprecated int url_open_protocol (URLContext **puc, struct URLProtocol *up,
|
||||||
const char *url, int flags);
|
const char *url, int flags);
|
||||||
attribute_deprecated int url_alloc(URLContext **h, const char *url, int flags);
|
attribute_deprecated int url_alloc(URLContext **h, const char *url, int flags);
|
||||||
|
attribute_deprecated int url_connect(URLContext *h);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* Connect an URLContext that has been allocated by url_alloc
|
|
||||||
*/
|
|
||||||
int url_connect(URLContext *h);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an URLContext for accessing to the resource indicated by
|
* Create an URLContext for accessing to the resource indicated by
|
||||||
* url, and open it.
|
* url, and open it.
|
||||||
|
@ -248,7 +248,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags)
|
|||||||
host, port, mmsh->request_seq++);
|
host, port, mmsh->request_seq++);
|
||||||
ff_http_set_headers(mms->mms_hd, headers);
|
ff_http_set_headers(mms->mms_hd, headers);
|
||||||
|
|
||||||
err = url_connect(mms->mms_hd);
|
err = ffurl_connect(mms->mms_hd);
|
||||||
if (err) {
|
if (err) {
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@ -294,7 +294,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags)
|
|||||||
av_dlog(NULL, "out_buffer is %s", headers);
|
av_dlog(NULL, "out_buffer is %s", headers);
|
||||||
ff_http_set_headers(mms->mms_hd, headers);
|
ff_http_set_headers(mms->mms_hd, headers);
|
||||||
|
|
||||||
err = url_connect(mms->mms_hd);
|
err = ffurl_connect(mms->mms_hd);
|
||||||
if (err) {
|
if (err) {
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
@ -1411,7 +1411,7 @@ redirect:
|
|||||||
ff_http_set_headers(rt->rtsp_hd, headers);
|
ff_http_set_headers(rt->rtsp_hd, headers);
|
||||||
|
|
||||||
/* complete the connection */
|
/* complete the connection */
|
||||||
if (url_connect(rt->rtsp_hd)) {
|
if (ffurl_connect(rt->rtsp_hd)) {
|
||||||
err = AVERROR(EIO);
|
err = AVERROR(EIO);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@ -1453,7 +1453,7 @@ redirect:
|
|||||||
ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd);
|
ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd);
|
||||||
|
|
||||||
/* complete the connection */
|
/* complete the connection */
|
||||||
if (url_connect(rt->rtsp_hd_out)) {
|
if (ffurl_connect(rt->rtsp_hd_out)) {
|
||||||
err = AVERROR(EIO);
|
err = AVERROR(EIO);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
@ -40,4 +40,9 @@
|
|||||||
*/
|
*/
|
||||||
int ffurl_alloc(URLContext **h, const char *url, int flags);
|
int ffurl_alloc(URLContext **h, const char *url, int flags);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connect an URLContext that has been allocated by ffurl_alloc
|
||||||
|
*/
|
||||||
|
int ffurl_connect(URLContext *h);
|
||||||
|
|
||||||
#endif //AVFORMAT_URL_H
|
#endif //AVFORMAT_URL_H
|
||||||
|
Loading…
Reference in New Issue
Block a user