Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-01-10 14:10:09 +0300
committerAnton Khirnov <anton@khirnov.net>2020-03-16 11:23:37 +0300
commit15546f772c686412d3e823ff8db266796541846e (patch)
tree874c4b3afe3c6a51d011eace420100b1311b1e1e /doc/examples
parent7f0a7e3e63ff0d342772cbc7e6e5d652900d6710 (diff)
examples/avio_dir_cmd: drop support for move/delete operations
They use non-public functions, which is unacceptable for a public API example. Rename the example back to avio_list_dir. This effectively reverts c84d208c275d6a43b3c3421d38772179abf8acee and 767d780ec001167b2fd8f6cfe4ef78a3a8b1e34c.
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/.gitignore2
-rw-r--r--doc/examples/Makefile2
-rw-r--r--doc/examples/Makefile.example2
-rw-r--r--doc/examples/avio_list_dir.c (renamed from doc/examples/avio_dir_cmd.c)56
4 files changed, 7 insertions, 55 deletions
diff --git a/doc/examples/.gitignore b/doc/examples/.gitignore
index 75152cb50b..44960e1de7 100644
--- a/doc/examples/.gitignore
+++ b/doc/examples/.gitignore
@@ -1,4 +1,4 @@
-/avio_dir_cmd
+/avio_list_dir
/avio_reading
/decode_audio
/decode_video
diff --git a/doc/examples/Makefile b/doc/examples/Makefile
index 2935424e54..81bfd34d5d 100644
--- a/doc/examples/Makefile
+++ b/doc/examples/Makefile
@@ -1,4 +1,4 @@
-EXAMPLES-$(CONFIG_AVIO_DIR_CMD_EXAMPLE) += avio_dir_cmd
+EXAMPLES-$(CONFIG_AVIO_LIST_DIR_EXAMPLE) += avio_list_dir
EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE) += avio_reading
EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE) += decode_audio
EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE) += decode_video
diff --git a/doc/examples/Makefile.example b/doc/examples/Makefile.example
index 6428154c51..a232d97f98 100644
--- a/doc/examples/Makefile.example
+++ b/doc/examples/Makefile.example
@@ -11,7 +11,7 @@ CFLAGS += -Wall -g
CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
-EXAMPLES= avio_dir_cmd \
+EXAMPLES= avio_list_dir \
avio_reading \
decode_audio \
decode_video \
diff --git a/doc/examples/avio_dir_cmd.c b/doc/examples/avio_list_dir.c
index 0722bd9ab1..3073baaefa 100644
--- a/doc/examples/avio_dir_cmd.c
+++ b/doc/examples/avio_list_dir.c
@@ -102,38 +102,15 @@ static int list_op(const char *input_dir)
return ret;
}
-static int del_op(const char *url)
-{
- int ret = avpriv_io_delete(url);
- if (ret < 0)
- av_log(NULL, AV_LOG_ERROR, "Cannot delete '%s': %s.\n", url, av_err2str(ret));
- return ret;
-}
-
-static int move_op(const char *src, const char *dst)
-{
- int ret = avpriv_io_move(src, dst);
- if (ret < 0)
- av_log(NULL, AV_LOG_ERROR, "Cannot move '%s' into '%s': %s.\n", src, dst, av_err2str(ret));
- return ret;
-}
-
-
static void usage(const char *program_name)
{
- fprintf(stderr, "usage: %s OPERATION entry1 [entry2]\n"
- "API example program to show how to manipulate resources "
- "accessed through AVIOContext.\n"
- "OPERATIONS:\n"
- "list list content of the directory\n"
- "move rename content in directory\n"
- "del delete content in directory\n",
- program_name);
+ fprintf(stderr, "usage: %s input_dir\n"
+ "API example program to show how to list files in directory "
+ "accessed through AVIOContext.\n", program_name);
}
int main(int argc, char *argv[])
{
- const char *op = NULL;
int ret;
av_log_set_level(AV_LOG_DEBUG);
@@ -145,32 +122,7 @@ int main(int argc, char *argv[])
avformat_network_init();
- op = argv[1];
- if (strcmp(op, "list") == 0) {
- if (argc < 3) {
- av_log(NULL, AV_LOG_INFO, "Missing argument for list operation.\n");
- ret = AVERROR(EINVAL);
- } else {
- ret = list_op(argv[2]);
- }
- } else if (strcmp(op, "del") == 0) {
- if (argc < 3) {
- av_log(NULL, AV_LOG_INFO, "Missing argument for del operation.\n");
- ret = AVERROR(EINVAL);
- } else {
- ret = del_op(argv[2]);
- }
- } else if (strcmp(op, "move") == 0) {
- if (argc < 4) {
- av_log(NULL, AV_LOG_INFO, "Missing argument for move operation.\n");
- ret = AVERROR(EINVAL);
- } else {
- ret = move_op(argv[2], argv[3]);
- }
- } else {
- av_log(NULL, AV_LOG_INFO, "Invalid operation %s\n", op);
- ret = AVERROR(EINVAL);
- }
+ ret = list_op(argv[1]);
avformat_network_deinit();