30 #define AV_CAT_SEPARATOR "|"
51 for (
i = 0;
i !=
data->length;
i++)
56 return err < 0 ? -1 : 0;
61 char *node_uri =
NULL;
74 for (
i = 0,
len = 1; uri[
i];
i++) {
88 for (
i = 0; *uri;
i++) {
98 &
h->interrupt_callback,
NULL,
h->protocol_whitelist,
h->protocol_blacklist,
h);
119 else if (!(nodes =
av_realloc(nodes,
data->length *
sizeof(*nodes)))) {
124 data->total_size = total_size;
130 int result, total = 0;
133 size_t i =
data->current;
138 if (
i + 1 ==
data->length ||
144 return total ? total : result;
150 return total ? total : result;
161 return data->total_size;
169 for (
i = 0;
i !=
data->current;
i++)
186 result += nodes[--
i].
size;
198 .default_whitelist =
"concat,file,subfile",
int ffurl_read(URLContext *h, unsigned char *buf, int size)
Read up to size bytes from the resource accessed by h, and store the read bytes in buf.
int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const char *whitelist, const char *blacklist, URLContext *parent)
Create an URLContext for accessing to the resource indicated by url, and open it.
int64_t ffurl_seek(URLContext *h, int64_t pos, int whence)
Change the position that will be used by the next read/write operation on the resource accessed by h.
int64_t ffurl_size(URLContext *h)
Return the filesize of the resource accessed by h, AVERROR(ENOSYS) if the operation is not supported ...
int ffurl_closep(URLContext **hh)
Close the resource accessed by the URLContext h, and free the memory used by it.
int ffurl_close(URLContext *h)
#define AVSEEK_SIZE
ORing this as the "whence" parameter to a seek function causes it to return the filesize without seek...
#define flags(name, subs,...)
static int concat_read(URLContext *h, unsigned char *buf, int size)
static av_cold int concat_close(URLContext *h)
const URLProtocol ff_concat_protocol
static int64_t concat_seek(URLContext *h, int64_t pos, int whence)
static av_cold int concat_open(URLContext *h, const char *uri, int flags)
#define AVERROR_EOF
End of file.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_realloc(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory.
int av_reallocp(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory through a pointer to a pointer.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate, or free an array.
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
Memory handling functions.
size_t length
number of cat'ed nodes
size_t current
index of currently read node
struct concat_nodes * nodes
list of nodes to concat
URLContext * uc
node's URLContext
unbuffered private I/O API