Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git://git.videolan.org/ffmpeg into flv-data

  • Loading branch information...
commit 31c012f8ff2a426da968f1df5c485cac61430722 2 parents db61541 + 76ba894
@josephwecker authored
View
39 avconv.c
@@ -253,8 +253,9 @@ typedef struct InputFile {
int eof_reached; /* true if eof reached */
int ist_index; /* index of first stream in ist_table */
int buffer_size; /* current total buffer size */
- int nb_streams;
int64_t ts_offset;
+ int nb_streams; /* number of stream that avconv is aware of; may be different
+ from ctx.nb_streams if new streams appear during av_read_frame() */
} InputFile;
typedef struct OutputStream {
@@ -1147,11 +1148,10 @@ static void do_video_out(AVFormatContext *s,
{
int nb_frames, i, ret, format_video_sync;
AVFrame *final_picture;
- AVCodecContext *enc, *dec;
+ AVCodecContext *enc;
double sync_ipts;
enc = ost->st->codec;
- dec = ist->st->codec;
sync_ipts = get_sync_ipts(ost) / av_q2d(enc->time_base);
@@ -1205,15 +1205,14 @@ static void do_video_out(AVFormatContext *s,
/* raw pictures are written as AVPicture structure to
avoid any copies. We support temporarily the older
method. */
- AVFrame* old_frame = enc->coded_frame;
- enc->coded_frame = dec->coded_frame; //FIXME/XXX remove this hack
+ enc->coded_frame->interlaced_frame = in_picture->interlaced_frame;
+ enc->coded_frame->top_field_first = in_picture->top_field_first;
pkt.data= (uint8_t *)final_picture;
pkt.size= sizeof(AVPicture);
pkt.pts= av_rescale_q(ost->sync_opts, enc->time_base, ost->st->time_base);
pkt.flags |= AV_PKT_FLAG_KEY;
write_frame(s, &pkt, ost->st->codec, ost->bitstream_filters);
- enc->coded_frame = old_frame;
} else {
AVFrame big_picture;
@@ -2587,12 +2586,6 @@ static int opt_frame_rate(const char *opt, const char *arg)
return 0;
}
-static int opt_frame_crop(const char *opt, const char *arg)
-{
- fprintf(stderr, "Option '%s' has been removed, use the crop filter instead\n", opt);
- return AVERROR(EINVAL);
-}
-
static int opt_frame_size(const char *opt, const char *arg)
{
if (av_parse_video_size(&frame_width, &frame_height, arg) < 0) {
@@ -2602,11 +2595,6 @@ static int opt_frame_size(const char *opt, const char *arg)
return 0;
}
-static int opt_pad(const char *opt, const char *arg) {
- fprintf(stderr, "Option '%s' has been removed, use the pad filter instead\n", opt);
- return -1;
-}
-
static int opt_frame_pix_fmt(const char *opt, const char *arg)
{
if (strcmp(arg, "list")) {
@@ -2785,13 +2773,13 @@ static int opt_map(const char *opt, const char *arg)
}
if (*sync)
sync++;
- for (i = 0; i < input_files[sync_file_idx].ctx->nb_streams; i++)
+ for (i = 0; i < input_files[sync_file_idx].nb_streams; i++)
if (check_stream_specifier(input_files[sync_file_idx].ctx,
input_files[sync_file_idx].ctx->streams[i], sync) == 1) {
sync_stream_idx = i;
break;
}
- if (i == input_files[sync_file_idx].ctx->nb_streams) {
+ if (i == input_files[sync_file_idx].nb_streams) {
av_log(NULL, AV_LOG_ERROR, "Sync stream specification in map %s does not "
"match any streams.\n", arg);
exit_program(1);
@@ -2814,7 +2802,7 @@ static int opt_map(const char *opt, const char *arg)
m->disabled = 1;
}
else
- for (i = 0; i < input_files[file_idx].ctx->nb_streams; i++) {
+ for (i = 0; i < input_files[file_idx].nb_streams; i++) {
if (check_stream_specifier(input_files[file_idx].ctx, input_files[file_idx].ctx->streams[i],
*p == ':' ? p + 1 : p) <= 0)
continue;
@@ -4001,7 +3989,7 @@ static int opt_target(const char *opt, const char *arg)
if(nb_input_files) {
int i, j;
for (j = 0; j < nb_input_files; j++) {
- for (i = 0; i < input_files[j].ctx->nb_streams; i++) {
+ for (i = 0; i < input_files[j].nb_streams; i++) {
AVCodecContext *c = input_files[j].ctx->streams[i]->codec;
if(c->codec_type != AVMEDIA_TYPE_VIDEO)
continue;
@@ -4222,15 +4210,6 @@ static const OptionDef options[] = {
{ "aspect", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_aspect_ratio}, "set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)", "aspect" },
{ "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_frame_pix_fmt}, "set pixel format, 'list' as argument shows all the pixel formats supported", "format" },
{ "bits_per_raw_sample", OPT_INT | HAS_ARG | OPT_VIDEO, {(void*)&frame_bits_per_raw_sample}, "set the number of bits per raw sample", "number" },
- { "croptop", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_crop}, "Removed, use the crop filter instead", "size" },
- { "cropbottom", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_crop}, "Removed, use the crop filter instead", "size" },
- { "cropleft", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_crop}, "Removed, use the crop filter instead", "size" },
- { "cropright", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_crop}, "Removed, use the crop filter instead", "size" },
- { "padtop", HAS_ARG | OPT_VIDEO, {(void*)opt_pad}, "Removed, use the pad filter instead", "size" },
- { "padbottom", HAS_ARG | OPT_VIDEO, {(void*)opt_pad}, "Removed, use the pad filter instead", "size" },
- { "padleft", HAS_ARG | OPT_VIDEO, {(void*)opt_pad}, "Removed, use the pad filter instead", "size" },
- { "padright", HAS_ARG | OPT_VIDEO, {(void*)opt_pad}, "Removed, use the pad filter instead", "size" },
- { "padcolor", HAS_ARG | OPT_VIDEO, {(void*)opt_pad}, "Removed, use the pad filter instead", "color" },
{ "vn", OPT_BOOL | OPT_VIDEO, {(void*)&video_disable}, "disable video" },
{ "vdt", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&video_discard}, "discard threshold", "n" },
{ "qscale", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_qscale}, "use fixed video quantizer scale (VBR)", "q" },
View
18 doc/APIchanges
@@ -13,25 +13,25 @@ libavutil: 2011-04-18
API changes, most recent first:
-2011-08-22 - xxxxxx - lavf 53.10.0
+2011-08-22 - dacd827 - lavf 53.10.0
Add av_find_program_from_stream().
-2011-08-20 - xxxxxx - lavu 51.13.0
+2011-08-20 - 69e2c1a - lavu 51.13.0
Add av_get_media_type_string().
-2011-08-14 - xxxxxx - lavu 51.12.0
+2011-08-14 - 323b930 - lavu 51.12.0
Add av_fifo_peek2(), deprecate av_fifo_peek().
-2011-08-xx - xxxxxxx - lavf 53.4.0
+2011-08-xx - 48f9e45 - lavf 53.8.0
Add avformat_query_codec().
-2011-08-xx - xxxxxxx - lavc 53.8.0
+2011-08-xx - bca06e7 - lavc 53.11.0
Add avcodec_get_type().
-2011-08-06 - 2f63440 - lavf 53.4.0
+2011-08-06 - 2f63440 - lavf 53.7.0
Add error_recognition to AVFormatContext.
-2011-08-02 - 9d39cbf - lavc 53.7.1
+2011-08-02 - 9d39cbf - lavc 53.9.1
Add AV_PKT_FLAG_CORRUPT AVPacket flag.
2011-07-16 - b57df29 - lavfi 2.27.0
@@ -42,10 +42,10 @@ API changes, most recent first:
avfilter_set_common_packing_formats()
avfilter_all_packing_formats()
-2011-07-10 - a67c061 - lavf 53.3.0
+2011-07-10 - a67c061 - lavf 53.6.0
Add avformat_find_stream_info(), deprecate av_find_stream_info().
-2011-07-10 - 0b950fe - lavc 53.6.0
+2011-07-10 - 0b950fe - lavc 53.8.0
Add avcodec_open2(), deprecate avcodec_open().
2011-07-01 - b442ca6 - lavf 53.5.0 - avformat.h
View
14 doc/avconv.texi
@@ -274,20 +274,6 @@ form @var{num}:@var{den}, where @var{num} and @var{den} are the
numerator and denominator of the aspect ratio. For example "4:3",
"16:9", "1.3333", and "1.7777" are valid argument values.
-@item -croptop @var{size}
-@item -cropbottom @var{size}
-@item -cropleft @var{size}
-@item -cropright @var{size}
-All the crop options have been removed. Use -vf
-crop=width:height:x:y instead.
-
-@item -padtop @var{size}
-@item -padbottom @var{size}
-@item -padleft @var{size}
-@item -padright @var{size}
-@item -padcolor @var{hex_color}
-All the pad options have been removed. Use -vf
-pad=width:height:x:y:color instead.
@item -vn
Disable video recording.
@item -bt @var{tolerance}
View
60 doc/issue_tracker.txt
@@ -8,29 +8,31 @@ Overview:
FFmpeg uses Trac for tracking issues, new issues and changes to
existing issues can be done through a web interface.
It is possible to subscribe to individual issues by adding yourself to the
-nosy list or to subscribe to the ffmpeg-issues mailing list which receives
-a mail for every change to every issue. Replies to such mails will also
-be properly added to the respective issue.
+Cc list or to subscribe to the ffmpeg-trac mailing list which receives
+a mail for every change to every issue.
(the above does all work already after light testing)
The subscription URL for the ffmpeg-trac list is:
http(s)://ffmpeg.org/mailman/listinfo/ffmpeg-trac
The URL of the webinterface of the tracker is:
http(s)://ffmpeg.org/trac/ffmpeg
-NOTE: issue = (bug report || patch || feature request)
+NOTE: issue = (bug report || patch || feature request || license violation)
Type:
-----
-bug
+bug / defect
An error, flaw, mistake, failure, or fault in FFmpeg or libav* that
prevents it from behaving as intended.
-feature request
+feature request / enhancement
Request of support for encoding or decoding of a new codec, container
or variant.
Request of support for more, less or plain different output or behavior
where the current implementation cannot be considered wrong.
+license violation
+ ticket to keep track of (L)GPL violations of ffmpeg by others
+
patch
A patch as generated by diff which conforms to the patch submission and
development policy.
@@ -51,6 +53,8 @@ important
the separation to normal is somewhat fuzzy.
For feature requests this priority would be used for things many people
want.
+ Regressions also should be marked as important, regressions are bugs that
+ dont exist in a past revission or another branch.
normal
@@ -80,6 +84,17 @@ closed
final state
+Analyzed flag:
+--------------
+Bugs which have been analyzed and where it is understood what causes them
+and which exact chain of events triggers them. This analysis should be
+available as a message in the bug report.
+Note, do not change the status to analyzed without also providing a clear
+and understandable analysis.
+This state implicates that the bug either has been reproduced or that
+reproduction is not needed as the bug is already understood.
+
+
Type/Status/Substatus:
----------
*/new/new
@@ -107,24 +122,6 @@ Type/Status/Substatus:
Issues for which some information has been requested by the developers,
but which has not been provided by anyone within reasonable time.
-bug/open/reproduced
- Bugs which have been reproduced.
-
-bug/open/analyzed
- Bugs which have been analyzed and where it is understood what causes them
- and which exact chain of events triggers them. This analysis should be
- available as a message in the bug report.
- Note, do not change the status to analyzed without also providing a clear
- and understandable analysis.
- This state implicates that the bug either has been reproduced or that
- reproduction is not needed as the bug is already understood.
-
-bug/open/needs_more_info
- Bug reports which are incomplete and or where more information is needed
- from the submitter or another person who can provide it.
- This state implicates that the bug has not been analyzed or reproduced.
- Note, the idea behind needs_more_info is to offload work from the
- developers to the users whenever possible.
bug/closed/fixed
Bugs which have to the best of our knowledge been fixed.
@@ -158,10 +155,6 @@ patch/closed/applied
patch/closed/rejected
Patches which have been rejected.
-feature_request/open/needs_more_info
- Feature requests where it is not clear what exactly is wanted
- (these also could be closed as invalid ...).
-
feature_request/closed/implemented
Feature requests which have been implemented.
@@ -175,10 +168,8 @@ above without asking on ffmpeg-dev first!
Note2, if you provide the requested info do not forget to remove the
needs_more_info substate.
-Topic:
-------
-A topic is a tag you should add to your issue in order to make grouping them
-easier.
+Component:
+----------
avcodec
issues in libavcodec/*
@@ -198,6 +189,9 @@ ffmpeg
ffplay
issues in or related to ffplay.c
+ffprobe
+ issues in or related to ffprobe.c
+
ffserver
issues in or related to ffserver.c
@@ -207,5 +201,5 @@ build system
regression
bugs which were working in a past revision
-roundup
+trac
issues related to our issue tracker
View
2,424 ffmpeg.c
1,136 additions, 1,288 deletions not shown
View
288 ffprobe.c
@@ -41,6 +41,8 @@ static int use_value_prefix = 0;
static int use_byte_value_binary_prefix = 0;
static int use_value_sexagesimal_format = 0;
+static char *print_format;
+
/* globals */
static const OptionDef options[];
@@ -121,141 +123,215 @@ static const char *media_type_string(enum AVMediaType media_type)
return s ? s : "unknown";
}
-static void show_packet(AVFormatContext *fmt_ctx, AVPacket *pkt)
+
+struct writer {
+ const char *name;
+ const char *item_sep; ///< separator between key/value couples
+ const char *items_sep; ///< separator between sets of key/value couples
+ const char *section_sep; ///< separator between sections (streams, packets, ...)
+ const char *header, *footer;
+ void (*print_header)(const char *);
+ void (*print_footer)(const char *);
+ void (*print_fmt_f)(const char *, const char *, va_list ap);
+ void (*print_int_f)(const char *, int);
+ void (*show_tags)(struct writer *w, AVDictionary *dict);
+};
+
+
+/* Default output */
+
+static void default_print_header(const char *section)
+{
+ printf("[%s]\n", section);
+}
+
+static void default_print_fmt(const char *key, const char *fmt, va_list ap)
+{
+ printf("%s=", key);
+ vprintf(fmt, ap);
+}
+
+static void default_print_int(const char *key, int value)
+{
+ printf("%s=%d", key, value);
+}
+
+static void default_print_footer(const char *section)
+{
+ printf("\n[/%s]", section);
+}
+
+
+/* Print helpers */
+
+static void print_vfmt0(struct writer *w, const char *key, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ w->print_fmt_f(key, fmt, ap);
+ va_end(ap);
+}
+
+#define print_fmt0(k, f, a...) print_vfmt0(w, k, f, ##a)
+#define print_fmt( k, f, a...) do { \
+ if (w->item_sep) \
+ printf("%s", w->item_sep); \
+ print_vfmt0(w, k, f, ##a); \
+} while (0)
+
+#define print_int0(k, v) w->print_int_f(k, v)
+#define print_int( k, v) do { \
+ if (w->item_sep) \
+ printf("%s", w->item_sep); \
+ print_int0(k, v); \
+} while (0)
+
+#define print_str0(k, v) print_fmt0(k, "%s", v)
+#define print_str( k, v) print_fmt (k, "%s", v)
+
+
+static void show_packet(struct writer *w, AVFormatContext *fmt_ctx, AVPacket *pkt, int packet_idx)
{
char val_str[128];
AVStream *st = fmt_ctx->streams[pkt->stream_index];
- printf("[PACKET]\n");
- printf("codec_type=%s\n" , media_type_string(st->codec->codec_type));
- printf("stream_index=%d\n" , pkt->stream_index);
- printf("pts=%s\n" , ts_value_string (val_str, sizeof(val_str), pkt->pts));
- printf("pts_time=%s\n" , time_value_string(val_str, sizeof(val_str), pkt->pts, &st->time_base));
- printf("dts=%s\n" , ts_value_string (val_str, sizeof(val_str), pkt->dts));
- printf("dts_time=%s\n" , time_value_string(val_str, sizeof(val_str), pkt->dts, &st->time_base));
- printf("duration=%s\n" , ts_value_string (val_str, sizeof(val_str), pkt->duration));
- printf("duration_time=%s\n", time_value_string(val_str, sizeof(val_str), pkt->duration, &st->time_base));
- printf("size=%s\n" , value_string (val_str, sizeof(val_str), pkt->size, unit_byte_str));
- printf("pos=%"PRId64"\n" , pkt->pos);
- printf("flags=%c\n" , pkt->flags & AV_PKT_FLAG_KEY ? 'K' : '_');
- printf("[/PACKET]\n");
+ if (packet_idx)
+ printf("%s", w->items_sep);
+ w->print_header("PACKET");
+ print_str0("codec_type", media_type_string(st->codec->codec_type));
+ print_int("stream_index", pkt->stream_index);
+ print_str("pts", ts_value_string (val_str, sizeof(val_str), pkt->pts));
+ print_str("pts_time", time_value_string(val_str, sizeof(val_str), pkt->pts, &st->time_base));
+ print_str("dts", ts_value_string (val_str, sizeof(val_str), pkt->dts));
+ print_str("dts_time", time_value_string(val_str, sizeof(val_str), pkt->dts, &st->time_base));
+ print_str("duration", ts_value_string (val_str, sizeof(val_str), pkt->duration));
+ print_str("duration_time", time_value_string(val_str, sizeof(val_str), pkt->duration, &st->time_base));
+ print_str("size", value_string (val_str, sizeof(val_str), pkt->size, unit_byte_str));
+ print_fmt("pos", "%"PRId64, pkt->pos);
+ print_fmt("flags", "%c", pkt->flags & AV_PKT_FLAG_KEY ? 'K' : '_');
+ w->print_footer("PACKET");
fflush(stdout);
}
-static void show_packets(AVFormatContext *fmt_ctx)
+static void show_packets(struct writer *w, AVFormatContext *fmt_ctx)
{
AVPacket pkt;
+ int i = 0;
av_init_packet(&pkt);
while (!av_read_frame(fmt_ctx, &pkt))
- show_packet(fmt_ctx, &pkt);
+ show_packet(w, fmt_ctx, &pkt, i++);
+}
+
+static void default_show_tags(struct writer *w, AVDictionary *dict)
+{
+ AVDictionaryEntry *tag = NULL;
+ while ((tag = av_dict_get(dict, "", tag, AV_DICT_IGNORE_SUFFIX))) {
+ printf("\nTAG:");
+ print_str0(tag->key, tag->value);
+ }
}
-static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
+static void show_stream(struct writer *w, AVFormatContext *fmt_ctx, int stream_idx)
{
AVStream *stream = fmt_ctx->streams[stream_idx];
AVCodecContext *dec_ctx;
AVCodec *dec;
char val_str[128];
- AVDictionaryEntry *tag = NULL;
AVRational display_aspect_ratio;
- printf("[STREAM]\n");
+ if (stream_idx)
+ printf("%s", w->items_sep);
+ w->print_header("STREAM");
- printf("index=%d\n", stream->index);
+ print_int0("index", stream->index);
if ((dec_ctx = stream->codec)) {
if ((dec = dec_ctx->codec)) {
- printf("codec_name=%s\n", dec->name);
- printf("codec_long_name=%s\n", dec->long_name);
+ print_str("codec_name", dec->name);
+ print_str("codec_long_name", dec->long_name);
} else {
- printf("codec_name=unknown\n");
+ print_str("codec_name", "unknown");
}
- printf("codec_type=%s\n", media_type_string(dec_ctx->codec_type));
- printf("codec_time_base=%d/%d\n", dec_ctx->time_base.num, dec_ctx->time_base.den);
+ print_str("codec_type", media_type_string(dec_ctx->codec_type));
+ print_fmt("codec_time_base", "%d/%d", dec_ctx->time_base.num, dec_ctx->time_base.den);
/* print AVI/FourCC tag */
av_get_codec_tag_string(val_str, sizeof(val_str), dec_ctx->codec_tag);
- printf("codec_tag_string=%s\n", val_str);
- printf("codec_tag=0x%04x\n", dec_ctx->codec_tag);
+ print_str("codec_tag_string", val_str);
+ print_fmt("codec_tag", "0x%04x", dec_ctx->codec_tag);
switch (dec_ctx->codec_type) {
case AVMEDIA_TYPE_VIDEO:
- printf("width=%d\n", dec_ctx->width);
- printf("height=%d\n", dec_ctx->height);
- printf("has_b_frames=%d\n", dec_ctx->has_b_frames);
+ print_int("width", dec_ctx->width);
+ print_int("height", dec_ctx->height);
+ print_int("has_b_frames", dec_ctx->has_b_frames);
if (dec_ctx->sample_aspect_ratio.num) {
- printf("sample_aspect_ratio=%d:%d\n", dec_ctx->sample_aspect_ratio.num,
- dec_ctx->sample_aspect_ratio.den);
+ print_fmt("sample_aspect_ratio", "%d:%d",
+ dec_ctx->sample_aspect_ratio.num,
+ dec_ctx->sample_aspect_ratio.den);
av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
dec_ctx->width * dec_ctx->sample_aspect_ratio.num,
dec_ctx->height * dec_ctx->sample_aspect_ratio.den,
1024*1024);
- printf("display_aspect_ratio=%d:%d\n", display_aspect_ratio.num,
- display_aspect_ratio.den);
+ print_fmt("display_aspect_ratio", "%d:%d",
+ display_aspect_ratio.num,
+ display_aspect_ratio.den);
}
- printf("pix_fmt=%s\n", dec_ctx->pix_fmt != PIX_FMT_NONE ?
- av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown");
- printf("level=%d\n", dec_ctx->level);
+ print_str("pix_fmt", dec_ctx->pix_fmt != PIX_FMT_NONE ? av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown");
+ print_int("level", dec_ctx->level);
break;
case AVMEDIA_TYPE_AUDIO:
- printf("sample_rate=%s\n", value_string(val_str, sizeof(val_str),
- dec_ctx->sample_rate,
- unit_hertz_str));
- printf("channels=%d\n", dec_ctx->channels);
- printf("bits_per_sample=%d\n", av_get_bits_per_sample(dec_ctx->codec_id));
+ print_str("sample_rate", value_string(val_str, sizeof(val_str), dec_ctx->sample_rate, unit_hertz_str));
+ print_int("channels", dec_ctx->channels);
+ print_int("bits_per_sample", av_get_bits_per_sample(dec_ctx->codec_id));
break;
}
} else {
- printf("codec_type=unknown\n");
+ print_fmt("codec_type", "unknown");
}
if (fmt_ctx->iformat->flags & AVFMT_SHOW_IDS)
- printf("id=0x%x\n", stream->id);
- printf("r_frame_rate=%d/%d\n", stream->r_frame_rate.num, stream->r_frame_rate.den);
- printf("avg_frame_rate=%d/%d\n", stream->avg_frame_rate.num, stream->avg_frame_rate.den);
- printf("time_base=%d/%d\n", stream->time_base.num, stream->time_base.den);
- printf("start_time=%s\n", time_value_string(val_str, sizeof(val_str), stream->start_time,
- &stream->time_base));
- printf("duration=%s\n", time_value_string(val_str, sizeof(val_str), stream->duration,
- &stream->time_base));
+ print_fmt("id=", "0x%x", stream->id);
+ print_fmt("r_frame_rate", "%d/%d", stream->r_frame_rate.num, stream->r_frame_rate.den);
+ print_fmt("avg_frame_rate", "%d/%d", stream->avg_frame_rate.num, stream->avg_frame_rate.den);
+ print_fmt("time_base", "%d/%d", stream->time_base.num, stream->time_base.den);
+ print_str("start_time", time_value_string(val_str, sizeof(val_str), stream->start_time, &stream->time_base));
+ print_str("duration", time_value_string(val_str, sizeof(val_str), stream->duration, &stream->time_base));
if (stream->nb_frames)
- printf("nb_frames=%"PRId64"\n", stream->nb_frames);
+ print_fmt("nb_frames", "%"PRId64, stream->nb_frames);
- while ((tag = av_dict_get(stream->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
- printf("TAG:%s=%s\n", tag->key, tag->value);
+ w->show_tags(w, stream->metadata);
- printf("[/STREAM]\n");
+ w->print_footer("STREAM");
fflush(stdout);
}
-static void show_format(AVFormatContext *fmt_ctx)
+static void show_streams(struct writer *w, AVFormatContext *fmt_ctx)
+{
+ int i;
+ for (i = 0; i < fmt_ctx->nb_streams; i++)
+ show_stream(w, fmt_ctx, i);
+}
+
+static void show_format(struct writer *w, AVFormatContext *fmt_ctx)
{
- AVDictionaryEntry *tag = NULL;
char val_str[128];
- printf("[FORMAT]\n");
-
- printf("filename=%s\n", fmt_ctx->filename);
- printf("nb_streams=%d\n", fmt_ctx->nb_streams);
- printf("format_name=%s\n", fmt_ctx->iformat->name);
- printf("format_long_name=%s\n", fmt_ctx->iformat->long_name);
- printf("start_time=%s\n", time_value_string(val_str, sizeof(val_str), fmt_ctx->start_time,
- &AV_TIME_BASE_Q));
- printf("duration=%s\n", time_value_string(val_str, sizeof(val_str), fmt_ctx->duration,
- &AV_TIME_BASE_Q));
- printf("size=%s\n", value_string(val_str, sizeof(val_str), fmt_ctx->file_size,
- unit_byte_str));
- printf("bit_rate=%s\n", value_string(val_str, sizeof(val_str), fmt_ctx->bit_rate,
- unit_bit_per_second_str));
-
- while ((tag = av_dict_get(fmt_ctx->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
- printf("TAG:%s=%s\n", tag->key, tag->value);
-
- printf("[/FORMAT]\n");
+ w->print_header("FORMAT");
+ print_str0("filename", fmt_ctx->filename);
+ print_int("nb_streams", fmt_ctx->nb_streams);
+ print_str("format_name", fmt_ctx->iformat->name);
+ print_str("format_long_name", fmt_ctx->iformat->long_name);
+ print_str("start_time", time_value_string(val_str, sizeof(val_str), fmt_ctx->start_time, &AV_TIME_BASE_Q));
+ print_str("duration", time_value_string(val_str, sizeof(val_str), fmt_ctx->duration, &AV_TIME_BASE_Q));
+ print_str("size", value_string(val_str, sizeof(val_str), fmt_ctx->file_size, unit_byte_str));
+ print_str("bit_rate", value_string(val_str, sizeof(val_str), fmt_ctx->bit_rate, unit_bit_per_second_str));
+ w->show_tags(w, fmt_ctx->metadata);
+ w->print_footer("FORMAT");
fflush(stdout);
}
@@ -301,23 +377,67 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
return 0;
}
+#define WRITER_FUNC(func) \
+ .print_header = func ## _print_header, \
+ .print_footer = func ## _print_footer, \
+ .print_fmt_f = func ## _print_fmt, \
+ .print_int_f = func ## _print_int, \
+ .show_tags = func ## _show_tags
+
+static struct writer writers[] = {{
+ .name = "default",
+ .item_sep = "\n",
+ .items_sep = "\n",
+ .section_sep = "\n",
+ .footer = "\n",
+ WRITER_FUNC(default),
+ }
+};
+
+static int get_writer(const char *name)
+{
+ int i;
+ if (!name)
+ return 0;
+ for (i = 0; i < FF_ARRAY_ELEMS(writers); i++)
+ if (!strcmp(writers[i].name, name))
+ return i;
+ return -1;
+}
+
+#define SECTION_PRINT(name, left) do { \
+ if (do_show_ ## name) { \
+ show_ ## name (w, fmt_ctx); \
+ if (left) \
+ printf("%s", w->section_sep); \
+ } \
+} while (0)
+
static int probe_file(const char *filename)
{
AVFormatContext *fmt_ctx;
- int ret, i;
+ int ret, writer_id;
+ struct writer *w;
+
+ writer_id = get_writer(print_format);
+ if (writer_id < 0) {
+ fprintf(stderr, "Invalid output format '%s'\n", print_format);
+ return AVERROR(EINVAL);
+ }
+ w = &writers[writer_id];
if ((ret = open_input_file(&fmt_ctx, filename)))
return ret;
- if (do_show_packets)
- show_packets(fmt_ctx);
+ if (w->header)
+ printf("%s", w->header);
- if (do_show_streams)
- for (i = 0; i < fmt_ctx->nb_streams; i++)
- show_stream(fmt_ctx, i);
+ SECTION_PRINT(packets, do_show_streams || do_show_format);
+ SECTION_PRINT(streams, do_show_format);
+ SECTION_PRINT(format, 0);
- if (do_show_format)
- show_format(fmt_ctx);
+ if (w->footer)
+ printf("%s", w->footer);
av_close_input_file(fmt_ctx);
return 0;
View
3  libavcodec/h264.c
@@ -2601,9 +2601,6 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
s->avctx->sample_aspect_ratio= h->sps.sar;
av_assert0(s->avctx->sample_aspect_ratio.den);
- h->s.avctx->coded_width = 16*s->mb_width;
- h->s.avctx->coded_height = 16*s->mb_height;
-
if(h->sps.video_signal_type_present_flag){
s->avctx->color_range = h->sps.full_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
if(h->sps.colour_description_present_flag){
View
9 libavcodec/h264_ps.c
@@ -406,7 +406,14 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
av_log(h->s.avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ... (left: %d, top: %d)\n", sps->crop_left, sps->crop_top);
}
if(sps->crop_right >= crop_horizontal_limit || sps->crop_bottom >= crop_vertical_limit){
- av_log(h->s.avctx, AV_LOG_ERROR, "brainfart cropping not supported, this could look slightly wrong ... (right: %d, bottom: %d)\n", sps->crop_right, sps->crop_bottom);
+ av_log(h->s.avctx, AV_LOG_ERROR, "brainfart cropping not supported, cropping disabled (right: %d, bottom: %d)\n", sps->crop_right, sps->crop_bottom);
+ /* It is very unlikely that partial cropping will make anybody happy.
+ * Not cropping at all fixes for example playback of Sisvel 3D streams
+ * in applications supporting Sisvel 3D. */
+ sps->crop_left =
+ sps->crop_right =
+ sps->crop_top =
+ sps->crop_bottom= 0;
}
}else{
sps->crop_left =
View
3  libavcodec/h264_sei.c
@@ -177,6 +177,9 @@ int ff_h264_decode_sei(H264Context *h){
size+= show_bits(&s->gb, 8);
}while(get_bits(&s->gb, 8) == 255);
+ if(s->avctx->debug&FF_DEBUG_STARTCODE)
+ av_log(h->s.avctx, AV_LOG_DEBUG, "SEI %d len:%d\n", type, size);
+
switch(type){
case SEI_TYPE_PIC_TIMING: // Picture timing SEI
if(decode_picture_timing(h) < 0)
View
24 libavcodec/rv40dsp.c
@@ -106,10 +106,6 @@ static void OPNAME ## rv40_qpel ## SIZE ## _mc10_c(uint8_t *dst, uint8_t *src, i
OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 52, 20, 6);\
}\
\
-static void OPNAME ## rv40_qpel ## SIZE ## _mc20_c(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 20, 20, 5);\
-}\
-\
static void OPNAME ## rv40_qpel ## SIZE ## _mc30_c(uint8_t *dst, uint8_t *src, int stride){\
OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 20, 52, 6);\
}\
@@ -139,10 +135,6 @@ static void OPNAME ## rv40_qpel ## SIZE ## _mc31_c(uint8_t *dst, uint8_t *src, i
OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
}\
\
-static void OPNAME ## rv40_qpel ## SIZE ## _mc02_c(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, src, stride, stride, SIZE, 20, 20, 5);\
-}\
-\
static void OPNAME ## rv40_qpel ## SIZE ## _mc12_c(uint8_t *dst, uint8_t *src, int stride){\
uint8_t full[SIZE*(SIZE+5)];\
uint8_t * const full_mid = full + SIZE*2;\
@@ -305,13 +297,13 @@ RV40_WEIGHT_FUNC(8)
av_cold void ff_rv40dsp_init(RV34DSPContext *c, DSPContext* dsp) {
c->put_pixels_tab[0][ 0] = dsp->put_h264_qpel_pixels_tab[0][0];
c->put_pixels_tab[0][ 1] = put_rv40_qpel16_mc10_c;
- c->put_pixels_tab[0][ 2] = put_rv40_qpel16_mc20_c;
+ c->put_pixels_tab[0][ 2] = dsp->put_h264_qpel_pixels_tab[0][2];
c->put_pixels_tab[0][ 3] = put_rv40_qpel16_mc30_c;
c->put_pixels_tab[0][ 4] = put_rv40_qpel16_mc01_c;
c->put_pixels_tab[0][ 5] = put_rv40_qpel16_mc11_c;
c->put_pixels_tab[0][ 6] = put_rv40_qpel16_mc21_c;
c->put_pixels_tab[0][ 7] = put_rv40_qpel16_mc31_c;
- c->put_pixels_tab[0][ 8] = put_rv40_qpel16_mc02_c;
+ c->put_pixels_tab[0][ 8] = dsp->put_h264_qpel_pixels_tab[0][8];
c->put_pixels_tab[0][ 9] = put_rv40_qpel16_mc12_c;
c->put_pixels_tab[0][10] = put_rv40_qpel16_mc22_c;
c->put_pixels_tab[0][11] = put_rv40_qpel16_mc32_c;
@@ -321,13 +313,13 @@ av_cold void ff_rv40dsp_init(RV34DSPContext *c, DSPContext* dsp) {
c->put_pixels_tab[0][15] = ff_put_rv40_qpel16_mc33_c;
c->avg_pixels_tab[0][ 0] = dsp->avg_h264_qpel_pixels_tab[0][0];
c->avg_pixels_tab[0][ 1] = avg_rv40_qpel16_mc10_c;
- c->avg_pixels_tab[0][ 2] = avg_rv40_qpel16_mc20_c;
+ c->avg_pixels_tab[0][ 2] = dsp->avg_h264_qpel_pixels_tab[0][2];
c->avg_pixels_tab[0][ 3] = avg_rv40_qpel16_mc30_c;
c->avg_pixels_tab[0][ 4] = avg_rv40_qpel16_mc01_c;
c->avg_pixels_tab[0][ 5] = avg_rv40_qpel16_mc11_c;
c->avg_pixels_tab[0][ 6] = avg_rv40_qpel16_mc21_c;
c->avg_pixels_tab[0][ 7] = avg_rv40_qpel16_mc31_c;
- c->avg_pixels_tab[0][ 8] = avg_rv40_qpel16_mc02_c;
+ c->avg_pixels_tab[0][ 8] = dsp->avg_h264_qpel_pixels_tab[0][8];
c->avg_pixels_tab[0][ 9] = avg_rv40_qpel16_mc12_c;
c->avg_pixels_tab[0][10] = avg_rv40_qpel16_mc22_c;
c->avg_pixels_tab[0][11] = avg_rv40_qpel16_mc32_c;
@@ -337,13 +329,13 @@ av_cold void ff_rv40dsp_init(RV34DSPContext *c, DSPContext* dsp) {
c->avg_pixels_tab[0][15] = ff_avg_rv40_qpel16_mc33_c;
c->put_pixels_tab[1][ 0] = dsp->put_h264_qpel_pixels_tab[1][0];
c->put_pixels_tab[1][ 1] = put_rv40_qpel8_mc10_c;
- c->put_pixels_tab[1][ 2] = put_rv40_qpel8_mc20_c;
+ c->put_pixels_tab[1][ 2] = dsp->put_h264_qpel_pixels_tab[1][2];
c->put_pixels_tab[1][ 3] = put_rv40_qpel8_mc30_c;
c->put_pixels_tab[1][ 4] = put_rv40_qpel8_mc01_c;
c->put_pixels_tab[1][ 5] = put_rv40_qpel8_mc11_c;
c->put_pixels_tab[1][ 6] = put_rv40_qpel8_mc21_c;
c->put_pixels_tab[1][ 7] = put_rv40_qpel8_mc31_c;
- c->put_pixels_tab[1][ 8] = put_rv40_qpel8_mc02_c;
+ c->put_pixels_tab[1][ 8] = dsp->put_h264_qpel_pixels_tab[1][8];
c->put_pixels_tab[1][ 9] = put_rv40_qpel8_mc12_c;
c->put_pixels_tab[1][10] = put_rv40_qpel8_mc22_c;
c->put_pixels_tab[1][11] = put_rv40_qpel8_mc32_c;
@@ -353,13 +345,13 @@ av_cold void ff_rv40dsp_init(RV34DSPContext *c, DSPContext* dsp) {
c->put_pixels_tab[1][15] = ff_put_rv40_qpel8_mc33_c;
c->avg_pixels_tab[1][ 0] = dsp->avg_h264_qpel_pixels_tab[1][0];
c->avg_pixels_tab[1][ 1] = avg_rv40_qpel8_mc10_c;
- c->avg_pixels_tab[1][ 2] = avg_rv40_qpel8_mc20_c;
+ c->avg_pixels_tab[1][ 2] = dsp->avg_h264_qpel_pixels_tab[1][2];
c->avg_pixels_tab[1][ 3] = avg_rv40_qpel8_mc30_c;
c->avg_pixels_tab[1][ 4] = avg_rv40_qpel8_mc01_c;
c->avg_pixels_tab[1][ 5] = avg_rv40_qpel8_mc11_c;
c->avg_pixels_tab[1][ 6] = avg_rv40_qpel8_mc21_c;
c->avg_pixels_tab[1][ 7] = avg_rv40_qpel8_mc31_c;
- c->avg_pixels_tab[1][ 8] = avg_rv40_qpel8_mc02_c;
+ c->avg_pixels_tab[1][ 8] = dsp->avg_h264_qpel_pixels_tab[1][8];
c->avg_pixels_tab[1][ 9] = avg_rv40_qpel8_mc12_c;
c->avg_pixels_tab[1][10] = avg_rv40_qpel8_mc22_c;
c->avg_pixels_tab[1][11] = avg_rv40_qpel8_mc32_c;
View
31 libavfilter/avfilter.c
@@ -26,6 +26,7 @@
#include "libavutil/audioconvert.h"
#include "libavutil/imgutils.h"
#include "libavutil/avassert.h"
+#include "libavutil/avstring.h"
#include "avfilter.h"
#include "internal.h"
@@ -44,6 +45,15 @@ const char *avfilter_license(void)
return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
}
+static void command_queue_pop(AVFilterContext *filter)
+{
+ AVFilterCommand *c= filter->command_queue;
+ av_freep(&c->arg);
+ av_freep(&c->command);
+ filter->command_queue= c->next;
+ av_free(c);
+}
+
AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
{
AVFilterBufferRef *ret = av_malloc(sizeof(AVFilterBufferRef));
@@ -533,6 +543,7 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
void (*start_frame)(AVFilterLink *, AVFilterBufferRef *);
AVFilterPad *dst = link->dstpad;
int perms = picref->perms;
+ AVFilterCommand *cmd= link->dst->command_queue;
FF_DPRINTF_START(NULL, start_frame); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " "); ff_dlog_ref(NULL, picref, 1);
@@ -555,6 +566,12 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
else
link->cur_buf = picref;
+ while(cmd && cmd->time <= picref->pts * av_q2d(link->time_base)){
+ avfilter_process_command(link->dst, cmd->command, cmd->arg, 0, 0, cmd->flags);
+ command_queue_pop(link->dst);
+ cmd= link->dst->command_queue;
+ }
+
start_frame(link, link->cur_buf);
}
@@ -616,6 +633,17 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
draw_slice(link, y, h, slice_dir);
}
+int avfilter_process_command(AVFilterContext *filter, const char *cmd, const char *arg, char *res, int res_len, int flags)
+{
+ if(!strcmp(cmd, "ping")){
+ av_strlcatf(res, res_len, "pong from:%s %s\n", filter->filter->name, filter->name);
+ return 0;
+ }else if(filter->filter->process_command) {
+ return filter->filter->process_command(filter, cmd, arg, res, res_len, flags);
+ }
+ return AVERROR(ENOSYS);
+}
+
void avfilter_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
{
void (*filter_samples)(AVFilterLink *, AVFilterBufferRef *);
@@ -803,6 +831,9 @@ void avfilter_free(AVFilterContext *filter)
av_freep(&filter->inputs);
av_freep(&filter->outputs);
av_freep(&filter->priv);
+ while(filter->command_queue){
+ command_queue_pop(filter);
+ }
av_free(filter);
}
View
27 libavfilter/avfilter.h
@@ -29,7 +29,7 @@
#include "libavutil/rational.h"
#define LIBAVFILTER_VERSION_MAJOR 2
-#define LIBAVFILTER_VERSION_MINOR 35
+#define LIBAVFILTER_VERSION_MINOR 37
#define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -552,6 +552,20 @@ typedef struct AVFilter {
* NULL_IF_CONFIG_SMALL() macro to define it.
*/
const char *description;
+
+ /**
+ * Make the filter instance process a command.
+ *
+ * @param cmd the command to process, for handling simplicity all commands must be alphanumeric only
+ * @param arg the argument for the command
+ * @param res a buffer with size res_size where the filter(s) can return a response. This must not change when the command is not supported.
+ * @param flags if AVFILTER_CMD_FLAG_FAST is set and the command would be
+ * timeconsuming then a filter should treat it like an unsupported command
+ *
+ * @returns >=0 on success otherwise an error code.
+ * AVERROR(ENOSYS) on unsupported commands
+ */
+ int (*process_command)(AVFilterContext *, const char *cmd, const char *arg, char *res, int res_len, int flags);
} AVFilter;
/** An instance of a filter */
@@ -571,6 +585,8 @@ struct AVFilterContext {
AVFilterLink **outputs; ///< array of pointers to output links
void *priv; ///< private data for use by the filter
+
+ struct AVFilterCommand *command_queue;
};
enum AVFilterPacking {
@@ -791,6 +807,15 @@ void avfilter_end_frame(AVFilterLink *link);
*/
void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
+#define AVFILTER_CMD_FLAG_ONE 1 ///< Stop once a filter understood the command (for target=all for example), fast filters are favored automatically
+#define AVFILTER_CMD_FLAG_FAST 2 ///< Only execute command when its fast (like a video out that supports contrast adjustment in hw)
+
+/**
+ * Make the filter instance process a command.
+ * It is recommanded to use avfilter_graph_send_command().
+ */
+int avfilter_process_command(AVFilterContext *filter, const char *cmd, const char *arg, char *res, int res_len, int flags);
+
/**
* Send a buffer of audio samples to the next filter.
*
View
58 libavfilter/avfiltergraph.c
@@ -253,3 +253,61 @@ int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)
return 0;
}
+
+int avfilter_graph_send_command(AVFilterGraph *graph, const char *target, const char *cmd, const char *arg, char *res, int res_len, int flags)
+{
+ int i, r = AVERROR(ENOSYS);
+
+ if(!graph)
+ return r;
+
+ if((flags & AVFILTER_CMD_FLAG_ONE) && !(flags & AVFILTER_CMD_FLAG_FAST)) {
+ r=avfilter_graph_send_command(graph, target, cmd, arg, res, res_len, flags | AVFILTER_CMD_FLAG_FAST);
+ if(r != AVERROR(ENOSYS))
+ return r;
+ }
+
+ if(res_len && res)
+ res[0]= 0;
+
+ for (i = 0; i < graph->filter_count; i++) {
+ AVFilterContext *filter = graph->filters[i];
+ if(!strcmp(target, "all") || !strcmp(target, filter->name) || !strcmp(target, filter->filter->name)){
+ r = avfilter_process_command(filter, cmd, arg, res, res_len, flags);
+ if(r != AVERROR(ENOSYS)) {
+ if((flags & AVFILTER_CMD_FLAG_ONE) || r<0)
+ return r;
+ }
+ }
+ }
+
+ return r;
+}
+
+int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const char *command, const char *arg, int flags, double ts)
+{
+ int i;
+
+ if(!graph)
+ return 0;
+
+ for (i = 0; i < graph->filter_count; i++) {
+ AVFilterContext *filter = graph->filters[i];
+ if(filter && (!strcmp(target, "all") || !strcmp(target, filter->name) || !strcmp(target, filter->filter->name))){
+ AVFilterCommand **que = &filter->command_queue, *next;
+ while(*que && (*que)->time <= ts)
+ que = &(*que)->next;
+ next= *que;
+ *que= av_mallocz(sizeof(AVFilterCommand));
+ (*que)->command = av_strdup(command);
+ (*que)->arg = av_strdup(arg);
+ (*que)->time = ts;
+ (*que)->flags = flags;
+ (*que)->next = next;
+ if(flags & AVFILTER_CMD_FLAG_ONE)
+ return 0;
+ }
+ }
+
+ return 0;
+}
View
35 libavfilter/avfiltergraph.h
@@ -136,4 +136,39 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
AVFilterInOut **inputs, AVFilterInOut **outputs,
void *log_ctx);
+/**
+ * Send a command to one or more filter instances.
+ *
+ * @param graph the filter graph
+ * @param target the filter(s) to which the command should be sent
+ * "all" sends to all filters
+ * otherwise it can be a filter or filter instance name
+ * which will send the command to all matching filters.
+ * @param cmd the command to sent, for handling simplicity all commands must be alphanumeric only
+ * @param arg the argument for the command
+ * @param res a buffer with size res_size where the filter(s) can return a response.
+ *
+ * @returns >=0 on success otherwise an error code.
+ * AVERROR(ENOSYS) on unsupported commands
+ */
+int avfilter_graph_send_command(AVFilterGraph *graph, const char *target, const char *cmd, const char *arg, char *res, int res_len, int flags);
+
+/**
+ * Queue a command for one or more filter instances.
+ *
+ * @param graph the filter graph
+ * @param target the filter(s) to which the command should be sent
+ * "all" sends to all filters
+ * otherwise it can be a filter or filter instance name
+ * which will send the command to all matching filters.
+ * @param cmd the command to sent, for handling simplicity all commands must be alphanummeric only
+ * @param arg the argument for the command
+ * @param ts time at which the command should be sent to the filter
+ *
+ * @note As this executes commands after this function returns, no return code
+ * from the filter is provided, also AVFILTER_CMD_FLAG_ONE is not supported.
+ */
+int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const char *cmd, const char *arg, int flags, double ts);
+
+
#endif /* AVFILTER_AVFILTERGRAPH_H */
View
2  libavfilter/graphparser.c
@@ -99,7 +99,7 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind
char tmp_args[256];
int ret;
- snprintf(inst_name, sizeof(inst_name), "Parsed filter %d %s", index, filt_name);
+ snprintf(inst_name, sizeof(inst_name), "Parsed_%s_%d", filt_name, index);
filt = avfilter_get_by_name(filt_name);
View
7 libavfilter/internal.h
@@ -33,6 +33,13 @@ typedef struct AVFilterPool {
int count;
} AVFilterPool;
+typedef struct AVFilterCommand {
+ double time;
+ char *command, *arg;
+ int flags;
+ struct AVFilterCommand *next;
+} AVFilterCommand;
+
/**
* Check for the validity of graph.
*
View
18 libavfilter/vf_drawtext.c
@@ -81,6 +81,7 @@ typedef struct {
int pixel_step[4]; ///< distance in bytes between the component of each pixel
uint8_t rgba_map[4]; ///< map RGBA offsets to the positions in the packed RGBA format
uint8_t *box_line[4]; ///< line used for filling the box background
+ int64_t basetime; ///< base pts time in the real world for display
} DrawTextContext;
#define OFFSET(x) offsetof(DrawTextContext, x)
@@ -99,6 +100,8 @@ static const AVOption drawtext_options[]= {
{"shadowx", "set x", OFFSET(shadowx), FF_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX },
{"shadowy", "set y", OFFSET(shadowy), FF_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX },
{"tabsize", "set tab size", OFFSET(tabsize), FF_OPT_TYPE_INT, {.dbl=4}, 0, INT_MAX },
+{"basetime", "set base time", OFFSET(basetime), FF_OPT_TYPE_INT64, {.dbl=AV_NOPTS_VALUE}, INT64_MIN, INT64_MAX },
+
/* FT_LOAD_* flags */
{"ft_load_flags", "set font loading flags for libfreetype", OFFSET(ft_load_flags), FF_OPT_TYPE_FLAGS, {.dbl=FT_LOAD_DEFAULT|FT_LOAD_RENDER}, 0, INT_MAX, 0, "ft_load_flags" },
@@ -355,6 +358,7 @@ static av_cold void uninit(AVFilterContext *ctx)
av_freep(&dtext->fontcolor_string);
av_freep(&dtext->boxcolor_string);
av_freep(&dtext->positions);
+ dtext->nb_positions = 0;
av_freep(&dtext->shadowcolor_string);
av_tree_enumerate(dtext->glyphs, NULL, NULL, glyph_enu_free);
av_tree_destroy(dtext->glyphs);
@@ -401,6 +405,16 @@ static int config_input(AVFilterLink *inlink)
return 0;
}
+static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
+{
+ if(!strcmp(cmd, "reinit")){
+ uninit(ctx);
+ return init(ctx, arg, NULL);
+ }
+
+ return AVERROR(ENOSYS);
+}
+
#define GET_BITMAP_VAL(r, c) \
bitmap->pixel_mode == FT_PIXEL_MODE_MONO ? \
(bitmap->buffer[(r) * bitmap->pitch + ((c)>>3)] & (0x80 >> ((c)&7))) * 255 : \
@@ -563,6 +577,9 @@ static int draw_text(AVFilterContext *ctx, AVFilterBufferRef *picref,
uint8_t *buf = dtext->expanded_text;
int buf_size = dtext->expanded_text_size;
+ if(dtext->basetime != AV_NOPTS_VALUE)
+ now= picref->pts*av_q2d(ctx->inputs[0]->time_base) + dtext->basetime/1000000;
+
if (!buf) {
buf_size = 2*strlen(dtext->text)+1;
buf = av_malloc(buf_size);
@@ -707,4 +724,5 @@ AVFilter avfilter_vf_drawtext = {
.outputs = (AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}},
+ .process_command = command,
};
View
4 libavfilter/vsrc_testsrc.c
@@ -132,6 +132,10 @@ static int request_frame(AVFilterLink *outlink)
picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
test->w, test->h);
picref->pts = test->pts++;
+ picref->pos = -1;
+ picref->video->key_frame = 1;
+ picref->video->interlaced = 0;
+ picref->video->pict_type = AV_PICTURE_TYPE_I;
picref->video->sample_aspect_ratio = test->sar;
test->nb_frame++;
test->fill_picture_fn(outlink->src, picref);
View
19 libavformat/isom.c
@@ -137,11 +137,18 @@ const AVCodecTag codec_movvideo_tags[] = {
{ CODEC_ID_RAWVIDEO, MKTAG('W', 'R', 'A', 'W') },
{ CODEC_ID_H264, MKTAG('a', 'v', 'c', '1') }, /* AVC-1/H.264 */
- { CODEC_ID_H264, MKTAG('a', 'i', '5', '5') }, /* AVC Intra 50 / 1080 interlace */
- { CODEC_ID_H264, MKTAG('a', 'i', '5', 'q') }, /* AVC Intra 50 / 720 */
- { CODEC_ID_H264, MKTAG('a', 'i', '1', '5') }, /* AVC Intra 100 / 1080 interlace */
- { CODEC_ID_H264, MKTAG('a', 'i', '1', 'q') }, /* AVC Intra 100 / 720 */
- { CODEC_ID_H264, MKTAG('a', 'i', '1', '2') }, /* AVC Intra 100 / 1080 */
+ { CODEC_ID_H264, MKTAG('a', 'i', '5', 'p') }, /* AVC-Intra 50M 720p24/30/60 */
+ { CODEC_ID_H264, MKTAG('a', 'i', '5', 'q') }, /* AVC-Intra 50M 720p25/50 */
+ { CODEC_ID_H264, MKTAG('a', 'i', '5', '2') }, /* AVC-Intra 50M 1080p25/50 */
+ { CODEC_ID_H264, MKTAG('a', 'i', '5', '3') }, /* AVC-Intra 50M 1080p24/30/60 */
+ { CODEC_ID_H264, MKTAG('a', 'i', '5', '5') }, /* AVC-Intra 50M 1080i50 */
+ { CODEC_ID_H264, MKTAG('a', 'i', '5', '6') }, /* AVC-Intra 50M 1080i60 */
+ { CODEC_ID_H264, MKTAG('a', 'i', '1', 'p') }, /* AVC-Intra 100M 720p24/30/60 */
+ { CODEC_ID_H264, MKTAG('a', 'i', '1', 'q') }, /* AVC-Intra 100M 720p25/50 */
+ { CODEC_ID_H264, MKTAG('a', 'i', '1', '2') }, /* AVC-Intra 100M 1080p25/50 */
+ { CODEC_ID_H264, MKTAG('a', 'i', '1', '3') }, /* AVC-Intra 100M 1080p24/30/60 */
+ { CODEC_ID_H264, MKTAG('a', 'i', '1', '5') }, /* AVC-Intra 100M 1080i50 */
+ { CODEC_ID_H264, MKTAG('a', 'i', '1', '6') }, /* AVC-Intra 100M 1080i60 */
{ CODEC_ID_MPEG1VIDEO, MKTAG('m', '1', 'v', '1') }, /* Apple MPEG-1 Camcorder */
{ CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'e', 'g') }, /* MPEG */
@@ -254,6 +261,8 @@ const AVCodecTag codec_movaudio_tags[] = {
{ CODEC_ID_GSM, MKTAG('a', 'g', 's', 'm') },
{ CODEC_ID_ALAC, MKTAG('a', 'l', 'a', 'c') }, /* Apple Lossless */
+ { CODEC_ID_NELLYMOSER, MKTAG('n', 'm', 'o', 's') },
+
{ CODEC_ID_QCELP, MKTAG('Q','c','l','p') },
{ CODEC_ID_QCELP, MKTAG('Q','c','l','q') },
{ CODEC_ID_QCELP, MKTAG('s','q','c','p') }, /* ISO Media fourcc */
View
2  libavformat/matroskaenc.c
@@ -1235,7 +1235,6 @@ AVOutputFormat ff_matroska_muxer = {
.write_packet = mkv_write_packet,
.write_trailer = mkv_write_trailer,
.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
- .codec_tag = (const AVCodecTag* const []){ff_codec_bmp_tags, ff_codec_wav_tags, 0},
.subtitle_codec = CODEC_ID_SSA,
.query_codec = mkv_query_codec,
};
@@ -1274,6 +1273,5 @@ AVOutputFormat ff_matroska_audio_muxer = {
.write_packet = mkv_write_packet,
.write_trailer = mkv_write_trailer,
.flags = AVFMT_GLOBALHEADER,
- .codec_tag = (const AVCodecTag* const []){ff_codec_wav_tags, 0},
};
#endif
View
13 libavformat/mov.c
@@ -1193,7 +1193,18 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
st->codec->width = sc->width;
st->codec->height = sc->height;
} else {
- /* other codec type, just skip (rtp, mp4s, tmcd ...) */
+ if (st->codec->codec_tag == MKTAG('t','m','c','d')) {
+ int val;
+ avio_rb32(pb); /* reserved */
+ val = avio_rb32(pb); /* flags */
+ if (val & 1)
+ st->codec->flags2 |= CODEC_FLAG2_DROP_FRAME_TIMECODE;
+ avio_rb32(pb);
+ avio_rb32(pb);
+ st->codec->time_base.den = get_byte(pb);
+ st->codec->time_base.num = 1;
+ }
+ /* other codec type, just skip (rtp, mp4s, ...) */
avio_skip(pb, size - (avio_tell(pb) - start_pos));
}
/* this will read extra atoms at the end (wave, alac, damr, avcC, SMI ...) */
View
1  libavformat/mp3enc.c
@@ -183,6 +183,7 @@ AVOutputFormat ff_mp2_muxer = {
.video_codec = CODEC_ID_NONE,
.write_packet = ff_raw_write_packet,
.write_trailer = mp2_write_trailer,
+ .flags = AVFMT_NOTIMESTAMPS,
};
#endif
View
4 libavformat/mpegts.c
@@ -525,7 +525,9 @@ static const StreamType ISO_types[] = {
{ 0x04, AVMEDIA_TYPE_AUDIO, CODEC_ID_MP3 },
{ 0x0f, AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC },
{ 0x10, AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG4 },
- { 0x11, AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC_LATM }, /* LATM syntax */
+ /* Makito encoder sets stream type 0x11 for AAC,
+ * so auto-detect LOAS/LATM instead of hardcoding it. */
+// { 0x11, AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC_LATM }, /* LATM syntax */
{ 0x1b, AVMEDIA_TYPE_VIDEO, CODEC_ID_H264 },
{ 0xd1, AVMEDIA_TYPE_VIDEO, CODEC_ID_DIRAC },
{ 0xea, AVMEDIA_TYPE_VIDEO, CODEC_ID_VC1 },
View
1  libavformat/riff.c
@@ -325,6 +325,7 @@ const AVCodecTag ff_codec_wav_tags[] = {
{ CODEC_ID_PCM_MULAW, 0x6c75 },
{ CODEC_ID_AAC, 0x706d },
{ CODEC_ID_AAC, 0x4143 },
+ { CODEC_ID_SPEEX, 0xA109 },
{ CODEC_ID_FLAC, 0xF1AC },
{ CODEC_ID_ADPCM_SWF, ('S'<<8)+'F' },
{ CODEC_ID_VORBIS, ('V'<<8)+'o' }, //HACK/FIXME, does vorbis in WAV/AVI have an (in)official id?
View
8 libavutil/audioconvert.c
@@ -51,10 +51,10 @@ static const struct {
{ "stereo", 2, AV_CH_LAYOUT_STEREO },
{ "4.0", 4, AV_CH_LAYOUT_4POINT0 },
{ "quad", 4, AV_CH_LAYOUT_QUAD },
- { "5.0", 5, AV_CH_LAYOUT_5POINT0 },
- { "5.0(back)", 5, AV_CH_LAYOUT_5POINT0_BACK },
- { "5.1", 6, AV_CH_LAYOUT_5POINT1 },
- { "5.1(back)", 6, AV_CH_LAYOUT_5POINT1_BACK },
+ { "5.0(side)", 5, AV_CH_LAYOUT_5POINT0 },
+ { "5.0", 5, AV_CH_LAYOUT_5POINT0_BACK },
+ { "5.1(side)", 6, AV_CH_LAYOUT_5POINT1 },
+ { "5.1", 6, AV_CH_LAYOUT_5POINT1_BACK },
{ "5.1+downmix", 8, AV_CH_LAYOUT_5POINT1|AV_CH_LAYOUT_STEREO_DOWNMIX, },
{ "7.1", 8, AV_CH_LAYOUT_7POINT1 },
{ "7.1(wide)", 8, AV_CH_LAYOUT_7POINT1_WIDE },
View
2  libavutil/fifo.h
@@ -94,6 +94,8 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void
/**
* Resize an AVFifoBuffer.
+ * In case of reallocation failure, the old FIFO is kept unchanged.
+ *
* @param f AVFifoBuffer to resize
* @param size new AVFifoBuffer size in bytes
* @return <0 for failure, >=0 otherwise
View
2  tests/Makefile
@@ -91,7 +91,7 @@ endif
FATE_UTILS = base64 tiny_psnr
-TOOL = avconv
+TOOL = ffmpeg
fate: $(FATE)
Please sign in to comment.
Something went wrong with that request. Please try again.