avio: do not export avpriv_io_{move,delete}

They are private and not used by anything outside of lavf. There is no
reason for them to be exported.
pull/362/head
Anton Khirnov 5 years ago
parent f27e3ccf06
commit 9d4c018497
  1. 6
      libavformat/avio.c
  2. 19
      libavformat/avio.h
  3. 2
      libavformat/dashenc.c
  4. 2
      libavformat/internal.h
  5. 19
      libavformat/url.h

@ -487,7 +487,7 @@ int avio_check(const char *url, int flags)
return ret; return ret;
} }
int avpriv_io_move(const char *url_src, const char *url_dst) int ffurl_move(const char *url_src, const char *url_dst)
{ {
URLContext *h_src, *h_dst; URLContext *h_src, *h_dst;
int ret = ffurl_alloc(&h_src, url_src, AVIO_FLAG_READ_WRITE, NULL); int ret = ffurl_alloc(&h_src, url_src, AVIO_FLAG_READ_WRITE, NULL);
@ -509,7 +509,7 @@ int avpriv_io_move(const char *url_src, const char *url_dst)
return ret; return ret;
} }
int avpriv_io_delete(const char *url) int ffurl_delete(const char *url)
{ {
URLContext *h; URLContext *h;
int ret = ffurl_alloc(&h, url, AVIO_FLAG_WRITE, NULL); int ret = ffurl_alloc(&h, url, AVIO_FLAG_WRITE, NULL);
@ -661,7 +661,7 @@ int ff_check_interrupt(AVIOInterruptCB *cb)
int ff_rename(const char *url_src, const char *url_dst, void *logctx) int ff_rename(const char *url_src, const char *url_dst, void *logctx)
{ {
int ret = avpriv_io_move(url_src, url_dst); int ret = ffurl_move(url_src, url_dst);
if (ret < 0) if (ret < 0)
av_log(logctx, AV_LOG_ERROR, "failed to rename file %s to %s: %s\n", url_src, url_dst, av_err2str(ret)); av_log(logctx, AV_LOG_ERROR, "failed to rename file %s to %s: %s\n", url_src, url_dst, av_err2str(ret));
return ret; return ret;

@ -374,25 +374,6 @@ const char *avio_find_protocol_name(const char *url);
*/ */
int avio_check(const char *url, int flags); int avio_check(const char *url, int flags);
/**
* Move or rename a resource.
*
* @note url_src and url_dst should share the same protocol and authority.
*
* @param url_src url to resource to be moved
* @param url_dst new url to resource if the operation succeeded
* @return >=0 on success or negative on error.
*/
int avpriv_io_move(const char *url_src, const char *url_dst);
/**
* Delete a resource.
*
* @param url resource to be deleted.
* @return >=0 on success or negative on error.
*/
int avpriv_io_delete(const char *url);
/** /**
* Open directory for reading. * Open directory for reading.
* *

@ -1845,7 +1845,7 @@ static void dashenc_delete_file(AVFormatContext *s, char *filename) {
av_dict_free(&http_opts); av_dict_free(&http_opts);
ff_format_io_close(s, &out); ff_format_io_close(s, &out);
} else { } else {
int res = avpriv_io_delete(filename); int res = ffurl_delete(filename);
if (res < 0) { if (res < 0) {
char errbuf[AV_ERROR_MAX_STRING_SIZE]; char errbuf[AV_ERROR_MAX_STRING_SIZE];
av_strerror(res, errbuf, sizeof(errbuf)); av_strerror(res, errbuf, sizeof(errbuf));

@ -792,7 +792,7 @@ int ff_stream_add_bitstream_filter(AVStream *st, const char *name, const char *a
int ff_stream_encode_params_copy(AVStream *dst, const AVStream *src); int ff_stream_encode_params_copy(AVStream *dst, const AVStream *src);
/** /**
* Wrap avpriv_io_move and log if error happens. * Wrap ffurl_move() and log if error happens.
* *
* @param url_src source path * @param url_src source path
* @param url_dst destination path * @param url_dst destination path

@ -388,4 +388,23 @@ typedef struct URLComponents {
*/ */
int ff_url_decompose(URLComponents *uc, const char *url, const char *end); int ff_url_decompose(URLComponents *uc, const char *url, const char *end);
/**
* Move or rename a resource.
*
* @note url_src and url_dst should share the same protocol and authority.
*
* @param url_src url to resource to be moved
* @param url_dst new url to resource if the operation succeeded
* @return >=0 on success or negative on error.
*/
int ffurl_move(const char *url_src, const char *url_dst);
/**
* Delete a resource.
*
* @param url resource to be deleted.
* @return >=0 on success or negative on error.
*/
int ffurl_delete(const char *url);
#endif /* AVFORMAT_URL_H */ #endif /* AVFORMAT_URL_H */

Loading…
Cancel
Save