History

Merge remote-tracking branch 'qatar/master'

* qatar/master: fix hardcoded tables compililation caused by missing math constants lavf: Make codec_tag arrays constant twinvq: give massive struct a name. lavf, lavu: version bumps and APIchanges for av_gettime() move lavfi/audio: don't set cur_buf in ff_filter_samples(). lavfi/fifo: add audio version of the fifo filter. fifo: fix parenthesis placement. lavfi: rename vf_fifo.c -> fifo.c lavc: remove stats_in from AVCodecContext options table. Conflicts: doc/APIchanges libavfilter/Makefile libavfilter/allfilters.c libavfilter/audio.c libavfilter/fifo.c libavformat/version.h libavutil/avutil.h

Michael Niedermayer committed 14 years ago

Commit 87dced82 parents fd0b8c6 1d01fee15 files · +75 −43Browse files

Unified · Split

15 files
  1. configure +1 −1
  2. doc/APIchanges +3 −0
  3. libavcodec/aacps_tablegen.h +1 −0
  4. libavcodec/cos_tablegen.c +0 −3
  5. libavcodec/options_table.h +0 −1
  6. libavcodec/sinewin_tablegen.c +0 −3
  7. libavcodec/twinvq_data.h +1 −1
  8. libavfilter/Makefile +2 −1
  9. libavfilter/allfilters.c +1 −0
  10. libavfilter/audio.c +10 −8
  11. libavfilter/fifo.c +52 −21
  12. libavformat/cafdec.c +1 −1
  13. libavformat/ivfdec.c +1 −1
  14. libavformat/version.h +1 −1
  15. libavutil/avutil.h +1 −1
configure+1−1
@@ -1903,7 +1903,7 @@ AS_O='-o $@' · 1902 unmodified lines
19031903 CC_O='-o $@'
19041904 CXX_O='-o $@'
19051905
1906−host_cflags='-D_ISOC99_SOURCE -O3 -g'
1906+host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g'
19071907 host_libs='-lm'
19081908
19091909 target_path='$(CURDIR)'
doc/APIchanges+3−0
@@ -38,6 +38,9 @@ API changes, most recent first: · 37 unmodified lines
3838 2012-03-26 - a67d9cf - lavfi 2.66.100
3939 Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.
4040
41+2012-06-20 - ae0a301 - lavu 51.33.0
42+ Move av_gettime() to libavutil, add libavutil/time.h
43+
4144 2012-xx-xx - xxxxxxx - lavr 0.0.3
4245 Add a parameter to avresample_build_matrix() for Dolby/DPLII downmixing.
4346
libavcodec/aacps_tablegen.h+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #ifndef AACPS_TABLEGEN_H
2424 #define AACPS_TABLEGEN_H
2525
26+#include <math.h>
2627 #include <stdint.h>
2728
2829 #if CONFIG_HARDCODED_TABLES
libavcodec/cos_tablegen.c+0−3
@@ -24,9 +24,6 @@ · 23 unmodified lines
2424 #include <string.h>
2525 #include <math.h>
2626
27−#ifndef M_PI
28−#define M_PI 3.14159265358979323846
29−#endif
3027 #define BITS 16
3128 #define FLOATFMT "%.18e"
3229 #define FIXEDFMT "%6d"
libavcodec/options_table.h+0−1
@@ -167,7 +167,6 @@ static const AVOption options[]={ · 166 unmodified lines
167167 {"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
168168 {"mpeg_quant", "use MPEG quantizers instead of H.263", OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
169169 {"stats_out", NULL, OFFSET(stats_out), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX},
170−{"stats_in", NULL, OFFSET(stats_in), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX},
171170 {"qsquish", "how to keep quantizer between qmin and qmax (0 = clip, 1 = use differentiable function)", OFFSET(rc_qsquish), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 99, V|E},
172171 {"rc_qmod_amp", "experimental quantizer modulation", OFFSET(rc_qmod_amp), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, -FLT_MAX, FLT_MAX, V|E},
173172 {"rc_qmod_freq", "experimental quantizer modulation", OFFSET(rc_qmod_freq), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
libavcodec/sinewin_tablegen.c+0−3
@@ -26,9 +26,6 @@ · 25 unmodified lines
2626 #define SINETABLE(size) \
2727 float ff_sine_##size[size]
2828 #define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
29−#ifndef M_PI
30−#define M_PI 3.14159265358979323846
31−#endif
3229 #include "sinewin_tablegen.h"
3330 #include "tableprint.h"
3431
libavcodec/twinvq_data.h+1−1
@@ -135,7 +135,7 @@ static const uint16_t bark_tab_s44_128[] = { · 134 unmodified lines
135135 *
136136 * without risking a segfault on malformed files.
137137 */
138−static const struct {
138+static const struct twinvq_data {
139139 float lsp08[504];
140140 int16_t fcb08l[640];
141141 int16_t fcb08m[320];
libavfilter/Makefile+2−1
@@ -47,6 +47,7 @@ OBJS-$(CONFIG_AVFORMAT) += lavfutils.o · 46 unmodified lines
4747 OBJS-$(CONFIG_SWSCALE) += lswsutils.o
4848
4949 OBJS-$(CONFIG_ACONVERT_FILTER) += af_aconvert.o
50+OBJS-$(CONFIG_AFIFO_FILTER) += fifo.o
5051 OBJS-$(CONFIG_AFORMAT_FILTER) += af_aformat.o
5152 OBJS-$(CONFIG_AMERGE_FILTER) += af_amerge.o
5253 OBJS-$(CONFIG_AMIX_FILTER) += af_amix.o
@@ -87,7 +88,7 @@ OBJS-$(CONFIG_DRAWBOX_FILTER) += vf_drawbox.o · 34 unmodified lines
8788 OBJS-$(CONFIG_DRAWTEXT_FILTER) += vf_drawtext.o
8889 OBJS-$(CONFIG_FADE_FILTER) += vf_fade.o
8990 OBJS-$(CONFIG_FIELDORDER_FILTER) += vf_fieldorder.o
90−OBJS-$(CONFIG_FIFO_FILTER) += vf_fifo.o
91+OBJS-$(CONFIG_FIFO_FILTER) += fifo.o
9192 OBJS-$(CONFIG_FORMAT_FILTER) += vf_format.o
9293 OBJS-$(CONFIG_FPS_FILTER) += vf_fps.o
9394 OBJS-$(CONFIG_FREI0R_FILTER) += vf_frei0r.o
libavfilter/allfilters.c+1−0
@@ -35,6 +35,7 @@ void avfilter_register_all(void) · 34 unmodified lines
3535 initialized = 1;
3636
3737 REGISTER_FILTER (ACONVERT, aconvert, af);
38+ REGISTER_FILTER (AFIFO, afifo, af);
3839 REGISTER_FILTER (AFORMAT, aformat, af);
3940 REGISTER_FILTER (AMERGE, amerge, af);
4041 REGISTER_FILTER (AMIX, amix, af);
libavfilter/audio.c+10−8
@@ -181,6 +181,7 @@ void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) · 180 unmodified lines
181181 void (*filter_samples)(AVFilterLink *, AVFilterBufferRef *);
182182 AVFilterPad *dst = link->dstpad;
183183 int64_t pts;
184+ AVFilterBufferRef *buf_out;
184185
185186 FF_TPRINTF_START(NULL, filter_samples); ff_tlog_link(NULL, link, 1);
186187
@@ -194,22 +195,23 @@ void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) · 7 unmodified lines
194195 "Copying audio data in avfilter (have perms %x, need %x, reject %x)\n",
195196 samplesref->perms, link->dstpad->min_perms, link->dstpad->rej_perms);
196197
197− link->cur_buf = ff_default_get_audio_buffer(link, dst->min_perms,
198− samplesref->audio->nb_samples);
199− link->cur_buf->pts = samplesref->pts;
200− link->cur_buf->audio->sample_rate = samplesref->audio->sample_rate;
198+ buf_out = ff_default_get_audio_buffer(link, dst->min_perms,
199+ samplesref->audio->nb_samples);
200+ buf_out->pts = samplesref->pts;
201+ buf_out->audio->sample_rate = samplesref->audio->sample_rate;
201202
202203 /* Copy actual data into new samples buffer */
203− av_samples_copy(link->cur_buf->extended_data, samplesref->extended_data,
204+ av_samples_copy(buf_out->extended_data, samplesref->extended_data,
204205 0, 0, samplesref->audio->nb_samples,
205206 av_get_channel_layout_nb_channels(link->channel_layout),
206207 link->format);
207208
208209 avfilter_unref_buffer(samplesref);
209210 } else
210− link->cur_buf = samplesref;
211+ buf_out = samplesref;
211212
212− pts = link->cur_buf->pts;
213− filter_samples(link, link->cur_buf);
213+ link->cur_buf = buf_out;
214+ pts = buf_out->pts;
215+ filter_samples(link, buf_out);
214216 ff_update_link_current_pts(link, pts);
215217 }
libavfilter/fifo.crenamed from libavfilter/vf_fifo.c+52−21
@@ -20,21 +20,22 @@ · 19 unmodified lines
2020
2121 /**
2222 * @file
23− * FIFO buffering video filter
23+ * FIFO buffering filter
2424 */
2525
26+#include "audio.h"
2627 #include "avfilter.h"
2728 #include "internal.h"
2829 #include "video.h"
2930
30−typedef struct BufPic {
31− AVFilterBufferRef *picref;
32− struct BufPic *next;
33−} BufPic;
31+typedef struct Buf {
32+ AVFilterBufferRef *buf;
33+ struct Buf *next;
34+} Buf;
3435
3536 typedef struct {
36− BufPic root;
37− BufPic *last; ///< last buffered picture
37+ Buf root;
38+ Buf *last; ///< last buffered frame
3839 } FifoContext;
3940
4041 static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
@@ -49,22 +50,22 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) · 8 unmodified lines
4950 static av_cold void uninit(AVFilterContext *ctx)
5051 {
5152 FifoContext *fifo = ctx->priv;
52− BufPic *pic, *tmp;
53+ Buf *buf, *tmp;
5354
54− for (pic = fifo->root.next; pic; pic = tmp) {
55− tmp = pic->next;
56− avfilter_unref_buffer(pic->picref);
57− av_free(pic);
55+ for (buf = fifo->root.next; buf; buf = tmp) {
56+ tmp = buf->next;
57+ avfilter_unref_buffer(buf->buf);
58+ av_free(buf);
5859 }
5960 }
6061
61−static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
62+static void add_to_queue(AVFilterLink *inlink, AVFilterBufferRef *buf)
6263 {
6364 FifoContext *fifo = inlink->dst->priv;
6465
65− fifo->last->next = av_mallocz(sizeof(BufPic));
66+ fifo->last->next = av_mallocz(sizeof(Buf));
6667 fifo->last = fifo->last->next;
67− fifo->last->picref = picref;
68+ fifo->last->buf = buf;
6869 }
6970
7071 static void end_frame(AVFilterLink *inlink) { }
@@ -74,19 +75,28 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) { } · 3 unmodified lines
7475 static int request_frame(AVFilterLink *outlink)
7576 {
7677 FifoContext *fifo = outlink->src->priv;
77− BufPic *tmp;
78+ Buf *tmp;
7879 int ret;
7980
8081 if (!fifo->root.next) {
81− if ((ret = avfilter_request_frame(outlink->src->inputs[0])) < 0)
82+ if ((ret = ff_request_frame(outlink->src->inputs[0])) < 0)
8283 return ret;
8384 }
8485
8586 /* by doing this, we give ownership of the reference to the next filter,
8687 * so we don't have to worry about dereferencing it ourselves. */
87− ff_start_frame(outlink, fifo->root.next->picref);
88− ff_draw_slice (outlink, 0, outlink->h, 1);
89− ff_end_frame (outlink);
88+ switch (outlink->type) {
89+ case AVMEDIA_TYPE_VIDEO:
90+ ff_start_frame(outlink, fifo->root.next->buf);
91+ ff_draw_slice (outlink, 0, outlink->h, 1);
92+ ff_end_frame (outlink);
93+ break;
94+ case AVMEDIA_TYPE_AUDIO:
95+ ff_filter_samples(outlink, fifo->root.next->buf);
96+ break;
97+ default:
98+ return AVERROR(EINVAL);
99+ }
90100
91101 if (fifo->last == fifo->root.next)
92102 fifo->last = &fifo->root;
@@ -109,7 +119,7 @@ AVFilter avfilter_vf_fifo = { · 16 unmodified lines
109119 .inputs = (const AVFilterPad[]) {{ .name = "default",
110120 .type = AVMEDIA_TYPE_VIDEO,
111121 .get_video_buffer= ff_null_get_video_buffer,
112− .start_frame = start_frame,
122+ .start_frame = add_to_queue,
113123 .draw_slice = draw_slice,
114124 .end_frame = end_frame,
115125 .rej_perms = AV_PERM_REUSE2, },
@@ -119,3 +129,24 @@ AVFilter avfilter_vf_fifo = { · 3 unmodified lines
119129 .request_frame = request_frame, },
120130 { .name = NULL}},
121131 };
132+
133+AVFilter avfilter_af_afifo = {
134+ .name = "afifo",
135+ .description = NULL_IF_CONFIG_SMALL("Buffer input frames and send them when they are requested."),
136+
137+ .init = init,
138+ .uninit = uninit,
139+
140+ .priv_size = sizeof(FifoContext),
141+
142+ .inputs = (AVFilterPad[]) {{ .name = "default",
143+ .type = AVMEDIA_TYPE_AUDIO,
144+ .get_audio_buffer = ff_null_get_audio_buffer,
145+ .filter_samples = add_to_queue,
146+ .rej_perms = AV_PERM_REUSE2, },
147+ { .name = NULL}},
148+ .outputs = (AVFilterPad[]) {{ .name = "default",
149+ .type = AVMEDIA_TYPE_AUDIO,
150+ .request_frame = request_frame, },
151+ { .name = NULL}},
152+};
libavformat/cafdec.c+1−1
@@ -410,5 +410,5 @@ AVInputFormat ff_caf_demuxer = { · 409 unmodified lines
410410 .read_header = read_header,
411411 .read_packet = read_packet,
412412 .read_seek = read_seek,
413− .codec_tag = (const AVCodecTag*[]){ ff_codec_caf_tags, 0 },
413+ .codec_tag = (const AVCodecTag* const []){ ff_codec_caf_tags, 0 },
414414 };
libavformat/ivfdec.c+1−1
@@ -87,5 +87,5 @@ AVInputFormat ff_ivf_demuxer = { · 86 unmodified lines
8787 .read_header = read_header,
8888 .read_packet = read_packet,
8989 .flags = AVFMT_GENERIC_INDEX,
90− .codec_tag = (const AVCodecTag*[]){ ff_codec_bmp_tags, 0 },
90+ .codec_tag = (const AVCodecTag* const []){ ff_codec_bmp_tags, 0 },
9191 };
libavformat/version.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #include "libavutil/avutil.h"
3131
3232 #define LIBAVFORMAT_VERSION_MAJOR 54
33−#define LIBAVFORMAT_VERSION_MINOR 10
33+#define LIBAVFORMAT_VERSION_MINOR 11
3434 #define LIBAVFORMAT_VERSION_MICRO 100
3535
3636 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
libavutil/avutil.h+1−1
@@ -153,7 +153,7 @@ · 152 unmodified lines
153153 */
154154
155155 #define LIBAVUTIL_VERSION_MAJOR 51
156−#define LIBAVUTIL_VERSION_MINOR 59
156+#define LIBAVUTIL_VERSION_MINOR 60
157157 #define LIBAVUTIL_VERSION_MICRO 100
158158
159159 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t