This repository has been archived by the owner on Jan 6, 2025. It is now read-only.
forked from arthenica/ffmpeg-kit
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use ffmpeg v4.4-dev-2765-g9f38fac053
- Loading branch information
1 parent
d94bd1b
commit 0cc4e89
Showing
50 changed files
with
1,733 additions
and
982 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,9 +83,6 @@ | |
#include "libavutil/ffversion.h" | ||
#include "libavutil/version.h" | ||
#include "fftools_cmdutils.h" | ||
#if CONFIG_NETWORK | ||
#include "libavformat/network.h" | ||
#endif | ||
#if HAVE_SYS_RESOURCE_H | ||
#include <sys/time.h> | ||
#include <sys/resource.h> | ||
|
@@ -152,7 +149,7 @@ void log_callback_report(void *ptr, int level, const char *fmt, va_list vl) | |
|
||
void init_dynload(void) | ||
{ | ||
#if HAVE_SETDLLDIRECTORY | ||
#if HAVE_SETDLLDIRECTORY && defined(_WIN32) | ||
/* Calling SetDllDirectory with the empty string (but not NULL) removes the | ||
* current working directory from the DLL search path as a security pre-caution. */ | ||
SetDllDirectory(""); | ||
|
@@ -218,7 +215,7 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags, | |
|
||
first = 1; | ||
for (po = options; po->name; po++) { | ||
char buf[64]; | ||
char buf[128]; | ||
|
||
if (((po->flags & req_flags) != req_flags) || | ||
(alt_flags && !(po->flags & alt_flags)) || | ||
|
@@ -241,13 +238,14 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags, | |
|
||
void show_help_children(const AVClass *class, int flags) | ||
{ | ||
const AVClass *child = NULL; | ||
void *iter = NULL; | ||
const AVClass *child; | ||
if (class->option) { | ||
av_opt_show2(&class, NULL, flags, 0); | ||
av_log(NULL, AV_LOG_STDERR, "\n"); | ||
} | ||
|
||
while ((child = av_opt_child_class_next(class, child))) | ||
while ((child = av_opt_child_class_iterate(class, &iter))) | ||
show_help_children(child, flags); | ||
} | ||
|
||
|
@@ -510,7 +508,7 @@ int locate_option(int argc, char **argv, const OptionDef *options, | |
return 0; | ||
} | ||
|
||
void dump_argument(const char *a) | ||
static void dump_argument(const char *a) | ||
{ | ||
const unsigned char *p; | ||
|
||
|
@@ -1020,7 +1018,7 @@ static void expand_filename_template(AVBPrint *bp, const char *template, | |
} | ||
} | ||
|
||
int init_report(const char *env) | ||
static int init_report(const char *env) | ||
{ | ||
char *filename_template = NULL; | ||
char *key, *val; | ||
|
@@ -1464,10 +1462,6 @@ static void print_codec(const AVCodec *c) | |
av_log(NULL, AV_LOG_STDERR, "threads "); | ||
if (c->capabilities & AV_CODEC_CAP_AVOID_PROBING) | ||
av_log(NULL, AV_LOG_STDERR, "avoidprobe "); | ||
if (c->capabilities & AV_CODEC_CAP_INTRA_ONLY) | ||
av_log(NULL, AV_LOG_STDERR, "intraonly "); | ||
if (c->capabilities & AV_CODEC_CAP_LOSSLESS) | ||
av_log(NULL, AV_LOG_STDERR, "lossless "); | ||
if (c->capabilities & AV_CODEC_CAP_HARDWARE) | ||
av_log(NULL, AV_LOG_STDERR, "hardware "); | ||
if (c->capabilities & AV_CODEC_CAP_HYBRID) | ||
|
@@ -1541,13 +1535,14 @@ static char get_media_type_char(enum AVMediaType type) | |
} | ||
} | ||
|
||
static const AVCodec *next_codec_for_id(enum AVCodecID id, const AVCodec *prev, | ||
static const AVCodec *next_codec_for_id(enum AVCodecID id, void **iter, | ||
int encoder) | ||
{ | ||
while ((prev = av_codec_next(prev))) { | ||
if (prev->id == id && | ||
(encoder ? av_codec_is_encoder(prev) : av_codec_is_decoder(prev))) | ||
return prev; | ||
const AVCodec *c; | ||
while ((c = av_codec_iterate(iter))) { | ||
if (c->id == id && | ||
(encoder ? av_codec_is_encoder(c) : av_codec_is_decoder(c))) | ||
return c; | ||
} | ||
return NULL; | ||
} | ||
|
@@ -1584,11 +1579,12 @@ static unsigned get_codecs_sorted(const AVCodecDescriptor ***rcodecs) | |
|
||
static void print_codecs_for_id(enum AVCodecID id, int encoder) | ||
{ | ||
const AVCodec *codec = NULL; | ||
void *iter = NULL; | ||
const AVCodec *codec; | ||
|
||
av_log(NULL, AV_LOG_STDERR, " (%s: ", encoder ? "encoders" : "decoders"); | ||
|
||
while ((codec = next_codec_for_id(id, codec, encoder))) | ||
while ((codec = next_codec_for_id(id, &iter, encoder))) | ||
av_log(NULL, AV_LOG_STDERR, "%s ", codec->name); | ||
|
||
av_log(NULL, AV_LOG_STDERR, ")"); | ||
|
@@ -1611,7 +1607,8 @@ int show_codecs(void *optctx, const char *opt, const char *arg) | |
" -------\n"); | ||
for (i = 0; i < nb_codecs; i++) { | ||
const AVCodecDescriptor *desc = codecs[i]; | ||
const AVCodec *codec = NULL; | ||
const AVCodec *codec; | ||
void *iter = NULL; | ||
|
||
if (strstr(desc->name, "_deprecated")) | ||
continue; | ||
|
@@ -1629,14 +1626,14 @@ int show_codecs(void *optctx, const char *opt, const char *arg) | |
|
||
/* print decoders/encoders when there's more than one or their | ||
* names are different from codec name */ | ||
while ((codec = next_codec_for_id(desc->id, codec, 0))) { | ||
while ((codec = next_codec_for_id(desc->id, &iter, 0))) { | ||
if (strcmp(codec->name, desc->name)) { | ||
print_codecs_for_id(desc->id, 0); | ||
break; | ||
} | ||
} | ||
codec = NULL; | ||
while ((codec = next_codec_for_id(desc->id, codec, 1))) { | ||
iter = NULL; | ||
while ((codec = next_codec_for_id(desc->id, &iter, 1))) { | ||
if (strcmp(codec->name, desc->name)) { | ||
print_codecs_for_id(desc->id, 1); | ||
break; | ||
|
@@ -1667,9 +1664,10 @@ static void print_codecs(int encoder) | |
encoder ? "Encoders" : "Decoders"); | ||
for (i = 0; i < nb_codecs; i++) { | ||
const AVCodecDescriptor *desc = codecs[i]; | ||
const AVCodec *codec = NULL; | ||
const AVCodec *codec; | ||
void *iter = NULL; | ||
|
||
while ((codec = next_codec_for_id(desc->id, codec, encoder))) { | ||
while ((codec = next_codec_for_id(desc->id, &iter, encoder))) { | ||
av_log(NULL, AV_LOG_STDERR, " %c", get_media_type_char(desc->type)); | ||
av_log(NULL, AV_LOG_STDERR, (codec->capabilities & AV_CODEC_CAP_FRAME_THREADS) ? "F" : "."); | ||
av_log(NULL, AV_LOG_STDERR, (codec->capabilities & AV_CODEC_CAP_SLICE_THREADS) ? "S" : "."); | ||
|
@@ -1874,9 +1872,10 @@ static void show_help_codec(const char *name, int encoder) | |
if (codec) | ||
print_codec(codec); | ||
else if ((desc = avcodec_descriptor_get_by_name(name))) { | ||
void *iter = NULL; | ||
int printed = 0; | ||
|
||
while ((codec = next_codec_for_id(desc->id, codec, encoder))) { | ||
while ((codec = next_codec_for_id(desc->id, &iter, encoder))) { | ||
printed = 1; | ||
print_codec(codec); | ||
} | ||
|
@@ -1911,6 +1910,24 @@ static void show_help_demuxer(const char *name) | |
show_help_children(fmt->priv_class, AV_OPT_FLAG_DECODING_PARAM); | ||
} | ||
|
||
static void show_help_protocol(const char *name) | ||
{ | ||
const AVClass *proto_class; | ||
|
||
if (!name) { | ||
av_log(NULL, AV_LOG_ERROR, "No protocol name specified.\n"); | ||
return; | ||
} | ||
|
||
proto_class = avio_protocol_get_class(name); | ||
if (!proto_class) { | ||
av_log(NULL, AV_LOG_ERROR, "Unknown protocol '%s'.\n", name); | ||
return; | ||
} | ||
|
||
show_help_children(proto_class, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM); | ||
} | ||
|
||
static void show_help_muxer(const char *name) | ||
{ | ||
const AVCodecDescriptor *desc; | ||
|
@@ -2044,6 +2061,8 @@ int show_help(void *optctx, const char *opt, const char *arg) | |
show_help_demuxer(par); | ||
} else if (!strcmp(topic, "muxer")) { | ||
show_help_muxer(par); | ||
} else if (!strcmp(topic, "protocol")) { | ||
show_help_protocol(par); | ||
#if CONFIG_AVFILTER | ||
} else if (!strcmp(topic, "filter")) { | ||
show_help_filter(par); | ||
|
@@ -2087,7 +2106,7 @@ FILE *get_preset_file(char *filename, size_t filename_size, | |
av_strlcpy(filename, preset_name, filename_size); | ||
f = fopen(filename, "r"); | ||
} else { | ||
#if HAVE_GETMODULEHANDLE | ||
#if HAVE_GETMODULEHANDLE && defined(_WIN32) | ||
char datadir[MAX_PATH], *ls; | ||
base[2] = NULL; | ||
|
||
|
@@ -2240,7 +2259,7 @@ double get_rotation(AVStream *st) | |
if (fabs(theta - 90*round(theta/90)) > 2) | ||
av_log(NULL, AV_LOG_WARNING, "Odd rotation angle.\n" | ||
"If you want to help, upload a sample " | ||
"of this file to ftp://upload.ffmpeg.org/incoming/ " | ||
"of this file to https://streams.videolan.org/upload/ " | ||
"and contact the ffmpeg-devel mailing list. ([email protected])"); | ||
|
||
return theta; | ||
|
@@ -2337,7 +2356,7 @@ int show_sources(void *optctx, const char *opt, const char *arg) | |
int ret = 0; | ||
int error_level = av_log_get_level(); | ||
|
||
av_log_set_level(AV_LOG_ERROR); | ||
av_log_set_level(AV_LOG_WARNING); | ||
|
||
if ((ret = show_sinks_sources_parse_arg(arg, &dev, &opts)) < 0) | ||
goto fail; | ||
|
@@ -2375,7 +2394,7 @@ int show_sinks(void *optctx, const char *opt, const char *arg) | |
int ret = 0; | ||
int error_level = av_log_get_level(); | ||
|
||
av_log_set_level(AV_LOG_ERROR); | ||
av_log_set_level(AV_LOG_WARNING); | ||
|
||
if ((ret = show_sinks_sources_parse_arg(arg, &dev, &opts)) < 0) | ||
goto fail; | ||
|
Oops, something went wrong.