49 int kind = (eb->length > ea->
length) - (eb->length < ea->
length);
52 return kind ? kind :
cmp ?
cmp : strcmp(ea->
title, eb->title);
61 entry = &dl->entries[dl->nb_entries];
63 return AVERROR(ENOMEM);
75 if (!dirent->
name || !*dirent->
name || dirent->
name[0] ==
'.')
85 found = !stat(
path, &st);
87 if (!found || !(S_ISDIR(st.st_mode) ||
S_ISREG(st.st_mode)))
90 dirent->
size = st.st_size;
103 if (resolved && !
copy)
116 int local = !protocol || !strcmp(protocol,
"file");
147 for (
int i = 0;
i <
dl->nb_entries;
i++) {
150 dl->entries[
i].length = -1;
165 for (
int i = 0;
i <
dl->nb_entries;
i++) {
177 const char *scheme = *
path ==
'/' ?
NULL : strstr(
path,
"://");
178 const char *top = scheme ? strchr(scheme + 3,
'/') :
path;
179 const char *slash = top ? strrchr(top,
'/') :
NULL;
186 const char *title =
dl->entries[
entry].title;
static AVFormatContext * ctx
int avio_open_dir2(AVIODirContext **s, const char *url, const AVIOInterruptCB *int_cb, AVDictionary **options)
Open directory for reading, with an interrupt callback for the protocol.
int avio_close_dir(AVIODirContext **s)
Close directory.
void avio_free_directory_entry(AVIODirEntry **entry)
Free entry allocated by avio_read_dir().
int avio_read_dir(AVIODirContext *s, AVIODirEntry **next)
Get next directory entry.
const char * avio_find_protocol_name(const char *url)
Return the name of the protocol that will handle the passed URL.
@ AVIO_ENTRY_BLOCK_DEVICE
@ AVIO_ENTRY_SYMBOLIC_LINK
@ AVIO_ENTRY_CHARACTER_DEVICE
char * av_asprintf(const char *fmt,...)
#define i(width, name, range_min, range_max)
#define FF_DYNARRAY_ADD(av_size_max, av_elt_size, av_array, av_size, av_success, av_failure)
Add an element to a dynamic array.
const AVIOInterruptCB int_cb
static int add_entry(DirList *dl, const char *name, enum EntryKind kind, int64_t size)
static char * resolve_local(const char *path)
static int compare_entries(const void *a, const void *b)
static char * parent_path(const char *path)
static int listed(const char *local_dir, AVIODirEntry *dirent)
int dir_list_read(DirList **pdl, const char *path, const AVIOInterruptCB *int_cb, AVDictionary **options)
Reads the directory into a new list.
void dir_list_free(DirList **pdl)
char * dir_list_path(const DirList *dl, int entry)
The content of a directory as list entries, leaving out hidden entries, special files and links to th...
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set() that converts the value to a string and stores it.
#define AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
char * av_strndup(const char *s, size_t len)
Duplicate a substring of a string.
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
char * av_append_path_component(const char *path, const char *component)
Append path component to the existing path.
Memory handling functions.
static av_always_inline int cmp(MPVEncContext *const s, const int x, const int y, const int subx, const int suby, const int size, const int h, int ref_index, int src_index, me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags)
compares a block (either a full macroblock or a partition thereof) against a proposed motion-compensa...
Describes single entry of the directory.
int type
Type of the entry.
int64_t size
File size in bytes, -1 if unknown.
Callback for checking whether to abort blocking functions.
int64_t length
in AV_TIME_BASE units, negative when unknown
static void copy(const float *p1, float *p2, const int length)