FFmpeg
Loading...
Searching...
No Matches
ffplay_dir.c File Reference
#include "config.h"
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include "libavformat/avio.h"
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
#include "libavutil/dynarray.h"
#include "libavutil/error.h"
#include "libavutil/mem.h"
#include "ffplay_dir.h"

Go to the source code of this file.

Enumerations

enum  EntryKind { ENTRY_FILE , ENTRY_MAYBE_DIR , ENTRY_DIR }
 

Functions

static int compare_entries (const void *a, const void *b)
 
static int add_entry (DirList *dl, const char *name, enum EntryKind kind, int64_t size)
 
static int listed (const char *local_dir, AVIODirEntry *dirent)
 
static char * resolve_local (const char *path)
 
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)
 
static char * parent_path (const char *path)
 
char * dir_list_path (const DirList *dl, int entry)
 

Enumeration Type Documentation

◆ EntryKind

enum EntryKind
Enumerator
ENTRY_FILE 
ENTRY_MAYBE_DIR 
ENTRY_DIR 

Definition at line 38 of file ffplay_dir.c.

Function Documentation

◆ compare_entries()

static int compare_entries ( const void * a,
const void * b )
static

Definition at line 46 of file ffplay_dir.c.

Referenced by dir_list_read().

◆ add_entry()

static int add_entry ( DirList * dl,
const char * name,
enum EntryKind kind,
int64_t size )
static

Definition at line 56 of file ffplay_dir.c.

Referenced by dir_list_read().

◆ listed()

static int listed ( const char * local_dir,
AVIODirEntry * dirent )
static

Definition at line 73 of file ffplay_dir.c.

Referenced by dir_list_read().

◆ resolve_local()

static char * resolve_local ( const char * path)
static

Definition at line 98 of file ffplay_dir.c.

Referenced by dir_list_read().

◆ dir_list_read()

int dir_list_read ( DirList ** dl,
const char * path,
const AVIOInterruptCB * int_cb,
AVDictionary ** options )

Reads the directory into a new list.

Parameters
dlset to the list
patha local directory, or the URL of a directory its protocol can list
int_cbinterrupt callback, asked between entries and by the protocol, may be NULL
optionsoptions for avio_open_dir2(), which removes those it uses
Returns
0 or a negative error code

Definition at line 113 of file ffplay_dir.c.

Referenced by dir_thread_func().

◆ dir_list_free()

void dir_list_free ( DirList ** pdl)

Definition at line 159 of file ffplay_dir.c.

Referenced by dir_list_read(), do_exit(), and file_list_listed().

◆ parent_path()

static char * parent_path ( const char * path)
static

Definition at line 175 of file ffplay_dir.c.

Referenced by dir_list_path().

◆ dir_list_path()

char * dir_list_path ( const DirList * dl,
int entry )
Returns
the absolute path or the URL of the entry, without a trailing slash, to be freed with av_free(), NULL on allocation failure

Definition at line 184 of file ffplay_dir.c.

Referenced by file_list_choose().