FFmpeg
Loading...
Searching...
No Matches
ffplay_dir.h
Go to the documentation of this file.
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19/**
20 * @file
21 * The content of a directory as list entries, leaving out hidden entries, special files and links to them.
22 */
23
24#ifndef FFTOOLS_FFPLAY_DIR_H
25#define FFTOOLS_FFPLAY_DIR_H
26
27#include "ffplay_list.h"
28
29typedef struct DirList {
30 char *path; ///< the directory as an absolute path, or its URL
31 ListEntry *entries; ///< ".." first, then the subdirectories and then the files, each by name; directories end with a slash
33 int nb_dirs; ///< the entries up to this one are directories
34 int nb_maybe_dirs; ///< the entries after the directories up to this one may list as one, without a slash
35} DirList;
36
37/**
38 * Reads the directory into a new list.
39 *
40 * @param dl set to the list
41 * @param path a local directory, or the URL of a directory its protocol can list
42 * @param int_cb interrupt callback, asked between entries and by the protocol, may be NULL
43 * @param options options for avio_open_dir2(), which removes those it uses
44 * @return 0 or a negative error code
45 */
47
49
50/**
51 * @return the absolute path or the URL of the entry, without a trailing slash, to be freed with av_free(), NULL on
52 * allocation failure
53 */
54char *dir_list_path(const DirList *dl, int entry);
55
56#endif /* FFTOOLS_FFPLAY_DIR_H */
#define entry
const AVIOInterruptCB int_cb
Definition ffmpeg.c:322
char * path
Definition ffplay.c:385
DirList * dl
Definition ffplay.c:390
void dir_list_free(DirList **dl)
Definition ffplay_dir.c:159
int dir_list_read(DirList **dl, const char *path, const AVIOInterruptCB *int_cb, AVDictionary **options)
Reads the directory into a new list.
Definition ffplay_dir.c:113
char * dir_list_path(const DirList *dl, int entry)
Definition ffplay_dir.c:184
A list overlay for ffplay: entries with title, artist, length and metadata that the user can sort,...
Callback for checking whether to abort blocking functions.
Definition avio.h:59
int nb_dirs
the entries up to this one are directories
Definition ffplay_dir.h:33
int nb_entries
Definition ffplay_dir.h:32
int nb_maybe_dirs
the entries after the directories up to this one may list as one, without a slash
Definition ffplay_dir.h:34
ListEntry * entries
".." first, then the subdirectories and then the files, each by name; directories end with a slash
Definition ffplay_dir.h:31
char * path
the directory as an absolute path, or its URL
Definition ffplay_dir.h:30