Unified · Split
| @@ -15,6 +15,10 @@ libavutil: 2014-08-09 · 14 unmodified lines | ||
| 15 | 15 | |
| 16 | 16 | API changes, most recent first: |
| 17 | 17 | |
| 18 | +2015-xx-xx - xxxxxxx - lavf 56.38.100 - avio.h url.h | |
| 19 | + Add avio_move(), avio_delete(). | |
| 20 | + Extend URLProtocol with url_move(), url_delete(). | |
| 21 | + | |
| 18 | 22 | -------- 8< --------- FFmpeg 2.7 was cut here -------- 8< --------- |
| 19 | 23 | |
| 20 | 24 | 2015-06-04 - cc17b43 - lswr 1.2.100 |
| @@ -421,6 +421,44 @@ int avio_check(const char *url, int flags) · 420 unmodified lines | ||
| 421 | 421 | return ret; |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | +int avio_move(const char *url_src, const char *url_dst) | |
| 425 | +{ | |
| 426 | + URLContext *h_src, *h_dst; | |
| 427 | + int ret = ffurl_alloc(&h_src, url_src, AVIO_FLAG_READ_WRITE, NULL); | |
| 428 | + if (ret < 0) | |
| 429 | + return ret; | |
| 430 | + ret = ffurl_alloc(&h_dst, url_dst, AVIO_FLAG_WRITE, NULL); | |
| 431 | + if (ret < 0) { | |
| 432 | + ffurl_close(h_src); | |
| 433 | + return ret; | |
| 434 | + } | |
| 435 | + | |
| 436 | + if (h_src->prot == h_dst->prot && h_src->prot->url_move) | |
| 437 | + ret = h_src->prot->url_move(h_src, h_dst); | |
| 438 | + else | |
| 439 | + ret = AVERROR(ENOSYS); | |
| 440 | + | |
| 441 | + ffurl_close(h_src); | |
| 442 | + ffurl_close(h_dst); | |
| 443 | + return ret; | |
| 444 | +} | |
| 445 | + | |
| 446 | +int avio_delete(const char *url) | |
| 447 | +{ | |
| 448 | + URLContext *h; | |
| 449 | + int ret = ffurl_alloc(&h, url, AVIO_FLAG_WRITE, NULL); | |
| 450 | + if (ret < 0) | |
| 451 | + return ret; | |
| 452 | + | |
| 453 | + if (h->prot->url_delete) | |
| 454 | + ret = h->prot->url_delete(h); | |
| 455 | + else | |
| 456 | + ret = AVERROR(ENOSYS); | |
| 457 | + | |
| 458 | + ffurl_close(h); | |
| 459 | + return ret; | |
| 460 | +} | |
| 461 | + | |
| 424 | 462 | int avio_open_dir(AVIODirContext **s, const char *url, AVDictionary **options) |
| 425 | 463 | { |
| 426 | 464 | URLContext *h = NULL; |
| @@ -229,6 +229,25 @@ const char *avio_find_protocol_name(const char *url); · 228 unmodified lines | ||
| 229 | 229 | */ |
| 230 | 230 | int avio_check(const char *url, int flags); |
| 231 | 231 | |
| 232 | +/** | |
| 233 | + * Move or rename a resource. | |
| 234 | + * | |
| 235 | + * @note url_src and url_dst should share the same protocol and authority. | |
| 236 | + * | |
| 237 | + * @param url_src url to resource to be moved | |
| 238 | + * @param url_dst new url to resource if the operation succeeded | |
| 239 | + * @return >=0 on success or negative on error. | |
| 240 | + */ | |
| 241 | +int avio_move(const char *url_src, const char *url_dst); | |
| 242 | + | |
| 243 | +/** | |
| 244 | + * Delete a resource. | |
| 245 | + * | |
| 246 | + * @param url resource to be deleted. | |
| 247 | + * @return >=0 on success or negative on error. | |
| 248 | + */ | |
| 249 | +int avio_delete(const char *url); | |
| 250 | + | |
| 232 | 251 | /** |
| 233 | 252 | * Open directory for reading. |
| 234 | 253 | * |
| @@ -90,6 +90,8 @@ typedef struct URLProtocol { · 89 unmodified lines | ||
| 90 | 90 | int (*url_open_dir)(URLContext *h); |
| 91 | 91 | int (*url_read_dir)(URLContext *h, AVIODirEntry **next); |
| 92 | 92 | int (*url_close_dir)(URLContext *h); |
| 93 | + int (*url_delete)(URLContext *h); | |
| 94 | + int (*url_move)(URLContext *h_src, URLContext *h_dst); | |
| 93 | 95 | } URLProtocol; |
| 94 | 96 | |
| 95 | 97 | /** |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | #include "libavutil/version.h" |
| 31 | 31 | |
| 32 | 32 | #define LIBAVFORMAT_VERSION_MAJOR 56 |
| 33 | −#define LIBAVFORMAT_VERSION_MINOR 37 | |
| 33 | +#define LIBAVFORMAT_VERSION_MINOR 38 | |
| 34 | 34 | #define LIBAVFORMAT_VERSION_MICRO 100 |
| 35 | 35 | |
| 36 | 36 | #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |