summaryrefslogtreecommitdiff
path: root/libavfilter/f_ebur128.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-10 01:30:30 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-10 01:40:35 +0100
commita05a44e205d6ae13d5eb1cd8d4ad2dba6ec940b3 (patch)
tree450d7173e72748db59d6cfb7107c688bc825fc9a /libavfilter/f_ebur128.c
parent586ae70ba78e023d16c0c812b05a26c7d423833b (diff)
parent7e350379f87e7f74420b4813170fe808e2313911 (diff)
downloadffmpeg-a05a44e205d6ae13d5eb1cd8d4ad2dba6ec940b3.tar.gz
Merge commit '7e350379f87e7f74420b4813170fe808e2313911'
* commit '7e350379f87e7f74420b4813170fe808e2313911': lavfi: switch to AVFrame. Conflicts: doc/filters.texi libavfilter/af_ashowinfo.c libavfilter/audio.c libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/buffersink.c libavfilter/buffersrc.c libavfilter/buffersrc.h libavfilter/f_select.c libavfilter/f_setpts.c libavfilter/fifo.c libavfilter/split.c libavfilter/src_movie.c libavfilter/version.h libavfilter/vf_aspect.c libavfilter/vf_bbox.c libavfilter/vf_blackframe.c libavfilter/vf_delogo.c libavfilter/vf_drawbox.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_fieldorder.c libavfilter/vf_fps.c libavfilter/vf_frei0r.c libavfilter/vf_gradfun.c libavfilter/vf_hqdn3d.c libavfilter/vf_lut.c libavfilter/vf_overlay.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavfilter/vf_showinfo.c libavfilter/vf_transpose.c libavfilter/vf_vflip.c libavfilter/vf_yadif.c libavfilter/video.c libavfilter/vsrc_testsrc.c libavfilter/yadif.h Following are notes about the merge authorship and various technical details. Michael Niedermayer: * Main merge operation, notably avfilter.c and video.c * Switch to AVFrame: - afade - anullsrc - apad - aresample - blackframe - deshake - idet - il - mandelbrot - mptestsrc - noise - setfield - smartblur - tinterlace * various merge changes and fixes in: - ashowinfo - blackdetect - field - fps - select - testsrc - yadif Nicolas George: * Switch to AVFrame: - make rawdec work with refcounted frames. Adapted from commit 759001c534287a96dc96d1e274665feb7059145d by Anton Khirnov. Also, fix the use of || instead of | in a flags check. - make buffer sink and src, audio and video work all together Clément Bœsch: * Switch to AVFrame: - aevalsrc - alphaextract - blend - cellauto - colormatrix - concat - earwax - ebur128 - edgedetect - geq - histeq - histogram - hue - kerndeint - life - movie - mp (with the help of Michael) - overlay - pad - pan - pp - pp - removelogo - sendcmd - showspectrum - showwaves - silencedetect - stereo3d - subtitles - super2xsai - swapuv - thumbnail - tile Hendrik Leppkes: * Switch to AVFrame: - aconvert - amerge - asetnsamples - atempo - biquads Matthieu Bouron: * Switch to AVFrame - alphamerge - decimate - volumedetect Stefano Sabatini: * Switch to AVFrame: - astreamsync - flite - framestep Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Clément Bœsch <ubitux@gmail.com> Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com> Signed-off-by: Stefano Sabatini <stefasab@gmail.com> Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/f_ebur128.c')
-rw-r--r--libavfilter/f_ebur128.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c
index 66cc133704..05ea63033f 100644
--- a/libavfilter/f_ebur128.c
+++ b/libavfilter/f_ebur128.c
@@ -97,7 +97,7 @@ typedef struct {
struct rect text; ///< rectangle for the LU legend on the left
struct rect graph; ///< rectangle for the main graph in the center
struct rect gauge; ///< rectangle for the gauge on the right
- AVFilterBufferRef *outpicref; ///< output picture reference, updated regularly
+ AVFrame *outpicref; ///< output picture reference, updated regularly
int meter; ///< select a EBU mode between +9 and +18
int scale_range; ///< the range of LU values according to the meter
int y_zero_lu; ///< the y value (pixel position) for 0 LU
@@ -174,7 +174,7 @@ static const uint8_t font_colors[] = {
0x00, 0x96, 0x96,
};
-static void drawtext(AVFilterBufferRef *pic, int x, int y, int ftid, const uint8_t *color, const char *fmt, ...)
+static void drawtext(AVFrame *pic, int x, int y, int ftid, const uint8_t *color, const char *fmt, ...)
{
int i;
char buf[128] = {0};
@@ -207,7 +207,7 @@ static void drawtext(AVFilterBufferRef *pic, int x, int y, int ftid, const uint8
}
}
-static void drawline(AVFilterBufferRef *pic, int x, int y, int len, int step)
+static void drawline(AVFrame *pic, int x, int y, int len, int step)
{
int i;
uint8_t *p = pic->data[0] + y*pic->linesize[0] + x*3;
@@ -224,7 +224,7 @@ static int config_video_output(AVFilterLink *outlink)
uint8_t *p;
AVFilterContext *ctx = outlink->src;
EBUR128Context *ebur128 = ctx->priv;
- AVFilterBufferRef *outpicref;
+ AVFrame *outpicref;
/* check if there is enough space to represent everything decently */
if (ebur128->w < 640 || ebur128->h < 480) {
@@ -259,10 +259,9 @@ static int config_video_output(AVFilterLink *outlink)
av_assert0(ebur128->graph.h == ebur128->gauge.h);
/* prepare the initial picref buffer */
- avfilter_unref_bufferp(&ebur128->outpicref);
+ av_frame_free(&ebur128->outpicref);
ebur128->outpicref = outpicref =
- ff_get_video_buffer(outlink, AV_PERM_WRITE|AV_PERM_PRESERVE|AV_PERM_REUSE2,
- outlink->w, outlink->h);
+ ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!outpicref)
return AVERROR(ENOMEM);
outlink->sample_aspect_ratio = (AVRational){1,1};
@@ -450,15 +449,15 @@ static int gate_update(struct integrator *integ, double power,
return gate_hist_pos;
}
-static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
+static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
{
int i, ch, idx_insample;
AVFilterContext *ctx = inlink->dst;
EBUR128Context *ebur128 = ctx->priv;
const int nb_channels = ebur128->nb_channels;
- const int nb_samples = insamples->audio->nb_samples;
+ const int nb_samples = insamples->nb_samples;
const double *samples = (double *)insamples->data[0];
- AVFilterBufferRef *pic = ebur128->outpicref;
+ AVFrame *pic = ebur128->outpicref;
for (idx_insample = 0; idx_insample < nb_samples; idx_insample++) {
const int bin_id_400 = ebur128->i400.cache_pos;
@@ -639,7 +638,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
/* set pts and push frame */
pic->pts = pts;
- ret = ff_filter_frame(outlink, avfilter_ref_buffer(pic, ~AV_PERM_WRITE));
+ ret = ff_filter_frame(outlink, av_frame_clone(pic));
if (ret < 0)
return ret;
}
@@ -738,7 +737,7 @@ static av_cold void uninit(AVFilterContext *ctx)
}
for (i = 0; i < ctx->nb_outputs; i++)
av_freep(&ctx->output_pads[i].name);
- avfilter_unref_bufferp(&ebur128->outpicref);
+ av_frame_free(&ebur128->outpicref);
}
static const AVFilterPad ebur128_inputs[] = {