Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
e623e8cb
Commit
e623e8cb
authored
Apr 18, 2015
by
Mariusz Szczepańczyk
Committed by
Michael Niedermayer
Apr 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: add documentation on directory listing API
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
e739cbb2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
avformat.h
libavformat/avformat.h
+47
-0
No files found.
libavformat/avformat.h
View file @
e623e8cb
...
...
@@ -233,6 +233,53 @@
*
* @defgroup lavf_io I/O Read/Write
* @{
* @section lavf_io_dirlist Directory listing
* The directory listing API allows to list files on remote servers.
*
* Some of possible use cases:
* - an "open file" dialog to choose files from a remote location,
* - a recursive media finder providing a player with an ability to play all
* files from a given directory.
*
* @subsection lavf_io_dirlist_open Opening a directory
* At first, a directory needs to be opened by calling avio_open_dir()
* supplied with a URL and, optionally, ::AVDictionary containing
* protocol-specific parameters. The function returns zero or positive
* integer and allocates AVIODirContext on success.
*
* @code
* AVIODirContext *ctx = NULL;
* if (avio_open_dir(&ctx, "smb://example.com/some_dir", NULL) < 0) {
* fprintf(stderr, "Cannot open directory.\n");
* abort();
* }
* @endcode
*
* This code tries to open a sample directory using smb protocol without
* any additional parameters.
*
* @subsection lavf_io_dirlist_read Reading entries
* Each directory's entry (i.e. file, another directory, anything else
* within ::AVIODirEntryType) is represented by AVIODirEntry.
* Reading consecutive entries from an opened AVIODirContext is done by
* repeatedly calling avio_read_dir() on it. Each call returns zero or
* positive integer if successful. Reading can be stopped right after the
* NULL entry has been read -- it means there are no entries left to be
* read. The following code reads all entries from a directory associated
* with ctx and prints their names to standard output.
* @code
* AVIODirEntry *entry = NULL;
* for (;;) {
* if (avio_read_dir(ctx, &entry) < 0) {
* fprintf(stderr, "Cannot list directory.\n");
* abort();
* }
* if (!entry)
* break;
* printf("%s\n", entry->name);
* avio_free_directory_entry(&entry);
* }
* @endcode
* @}
*
* @defgroup lavf_codec Demuxers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment