History

Remove left-over FF_API_AVFILTERBUFFER cruft

Hendrik Leppkes committed 11 years ago

Commit 144fb061 parent 033764e14 files · +1 −342Browse files

Unified · Split

14 files
  1. doc/examples/filtering_audio.c +0 −1
  2. doc/examples/filtering_video.c +0 −1
  3. doc/examples/transcoding.c +0 −1
  4. ffmpeg.c +0 −1
  5. ffplay.c +0 −1
  6. libavfilter/Makefile +1 −6
  7. libavfilter/allfilters.c +0 −5
  8. libavfilter/asrc_abuffer.h +0 −91
  9. libavfilter/avcodec.c +0 −139
  10. libavfilter/avcodec.h +0 −69
  11. libavfilter/avfilter.h +0 −15
  12. libavfilter/buffersrc.c +0 −1
  13. libavfilter/internal.h +0 −10
  14. libavfilter/src_movie.c +0 −1
doc/examples/filtering_audio.c+0−1
@@ -33,7 +33,6 @@ · 32 unmodified lines
3333 #include <libavcodec/avcodec.h>
3434 #include <libavformat/avformat.h>
3535 #include <libavfilter/avfiltergraph.h>
36−#include <libavfilter/avcodec.h>
3736 #include <libavfilter/buffersink.h>
3837 #include <libavfilter/buffersrc.h>
3938 #include <libavutil/opt.h>
doc/examples/filtering_video.c+0−1
@@ -33,7 +33,6 @@ · 32 unmodified lines
3333 #include <libavcodec/avcodec.h>
3434 #include <libavformat/avformat.h>
3535 #include <libavfilter/avfiltergraph.h>
36−#include <libavfilter/avcodec.h>
3736 #include <libavfilter/buffersink.h>
3837 #include <libavfilter/buffersrc.h>
3938 #include <libavutil/opt.h>
doc/examples/transcoding.c+0−1
@@ -31,7 +31,6 @@ · 30 unmodified lines
3131 #include <libavcodec/avcodec.h>
3232 #include <libavformat/avformat.h>
3333 #include <libavfilter/avfiltergraph.h>
34−#include <libavfilter/avcodec.h>
3534 #include <libavfilter/buffersink.h>
3635 #include <libavfilter/buffersrc.h>
3736 #include <libavutil/opt.h>
ffmpeg.c+0−1
@@ -64,7 +64,6 @@ · 63 unmodified lines
6464 #include "libavcodec/mathops.h"
6565 #include "libavformat/os_support.h"
6666
67−# include "libavfilter/avcodec.h"
6867 # include "libavfilter/avfilter.h"
6968 # include "libavfilter/buffersrc.h"
7069 # include "libavfilter/buffersink.h"
ffplay.c+0−1
@@ -48,7 +48,6 @@ · 47 unmodified lines
4848 #include "libswresample/swresample.h"
4949
5050 #if CONFIG_AVFILTER
51−# include "libavfilter/avcodec.h"
5251 # include "libavfilter/avfilter.h"
5352 # include "libavfilter/buffersink.h"
5453 # include "libavfilter/buffersrc.h"
libavfilter/Makefile+1−6
@@ -2,9 +2,7 @@ include $(SUBDIR)../config.mak · 1 unmodified line
22
33 NAME = avfilter
44
5−HEADERS = asrc_abuffer.h \
6− avcodec.h \
7− avfilter.h \
5+HEADERS = avfilter.h \
86 avfiltergraph.h \
97 buffersink.h \
108 buffersrc.h \
@@ -25,9 +23,6 @@ OBJS = allfilters.o \ · 14 unmodified lines
2523 transform.o \
2624 video.o \
2725
28−
29−OBJS-$(CONFIG_AVCODEC) += avcodec.o
30−
3126 OBJS-$(CONFIG_ACROSSFADE_FILTER) += af_afade.o
3227 OBJS-$(CONFIG_ADELAY_FILTER) += af_adelay.o
3328 OBJS-$(CONFIG_AECHO_FILTER) += af_aecho.o
libavfilter/allfilters.c+0−5
@@ -289,11 +289,6 @@ void avfilter_register_all(void) · 288 unmodified lines
289289 REGISTER_FILTER(AMOVIE, amovie, avsrc);
290290 REGISTER_FILTER(MOVIE, movie, avsrc);
291291
292−#if FF_API_AVFILTERBUFFER
293− REGISTER_FILTER_UNCONDITIONAL(vsink_ffbuffersink);
294− REGISTER_FILTER_UNCONDITIONAL(asink_ffabuffersink);
295−#endif
296−
297292 /* those filters are part of public or internal API => registered
298293 * unconditionally */
299294 REGISTER_FILTER_UNCONDITIONAL(asrc_abuffer);
libavfilter/asrc_abuffer.h+0−91
@@ -1,91 +0,0 @@
1−/*
2− * This file is part of FFmpeg.
3− *
4− * FFmpeg is free software; you can redistribute it and/or
5− * modify it under the terms of the GNU Lesser General Public
6− * License as published by the Free Software Foundation; either
7− * version 2.1 of the License, or (at your option) any later version.
8− *
9− * FFmpeg is distributed in the hope that it will be useful,
10− * but WITHOUT ANY WARRANTY; without even the implied warranty of
11− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12− * Lesser General Public License for more details.
13− *
14− * You should have received a copy of the GNU Lesser General Public
15− * License along with FFmpeg; if not, write to the Free Software
16− * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17− */
18−
19−#ifndef AVFILTER_ASRC_ABUFFER_H
20−#define AVFILTER_ASRC_ABUFFER_H
21−
22−#include "avfilter.h"
23−
24−/**
25− * @file
26− * memory buffer source for audio
27− *
28− * @deprecated use buffersrc.h instead.
29− */
30−
31−/**
32− * Queue an audio buffer to the audio buffer source.
33− *
34− * @param abuffersrc audio source buffer context
35− * @param data pointers to the samples planes
36− * @param linesize linesizes of each audio buffer plane
37− * @param nb_samples number of samples per channel
38− * @param sample_fmt sample format of the audio data
39− * @param ch_layout channel layout of the audio data
40− * @param planar flag to indicate if audio data is planar or packed
41− * @param pts presentation timestamp of the audio buffer
42− * @param flags unused
43− *
44− * @deprecated use av_buffersrc_add_ref() instead.
45− */
46−attribute_deprecated
47−int av_asrc_buffer_add_samples(AVFilterContext *abuffersrc,
48− uint8_t *data[8], int linesize[8],
49− int nb_samples, int sample_rate,
50− int sample_fmt, int64_t ch_layout, int planar,
51− int64_t pts, int av_unused flags);
52−
53−/**
54− * Queue an audio buffer to the audio buffer source.
55− *
56− * This is similar to av_asrc_buffer_add_samples(), but the samples
57− * are stored in a buffer with known size.
58− *
59− * @param abuffersrc audio source buffer context
60− * @param buf pointer to the samples data, packed is assumed
61− * @param size the size in bytes of the buffer, it must contain an
62− * integer number of samples
63− * @param sample_fmt sample format of the audio data
64− * @param ch_layout channel layout of the audio data
65− * @param pts presentation timestamp of the audio buffer
66− * @param flags unused
67− *
68− * @deprecated use av_buffersrc_add_ref() instead.
69− */
70−attribute_deprecated
71−int av_asrc_buffer_add_buffer(AVFilterContext *abuffersrc,
72− uint8_t *buf, int buf_size,
73− int sample_rate,
74− int sample_fmt, int64_t ch_layout, int planar,
75− int64_t pts, int av_unused flags);
76−
77−/**
78− * Queue an audio buffer to the audio buffer source.
79− *
80− * @param abuffersrc audio source buffer context
81− * @param samplesref buffer ref to queue
82− * @param flags unused
83− *
84− * @deprecated use av_buffersrc_add_ref() instead.
85− */
86−attribute_deprecated
87−int av_asrc_buffer_add_audio_buffer_ref(AVFilterContext *abuffersrc,
88− AVFilterBufferRef *samplesref,
89− int av_unused flags);
90−
91−#endif /* AVFILTER_ASRC_ABUFFER_H */
libavfilter/avcodec.c+0−139
@@ -1,139 +0,0 @@
1−/*
2− * Copyright 2011 Stefano Sabatini | stefasab at gmail.com
3− *
4− * This file is part of FFmpeg.
5− *
6− * FFmpeg is free software; you can redistribute it and/or
7− * modify it under the terms of the GNU Lesser General Public
8− * License as published by the Free Software Foundation; either
9− * version 2.1 of the License, or (at your option) any later version.
10− *
11− * FFmpeg is distributed in the hope that it will be useful,
12− * but WITHOUT ANY WARRANTY; without even the implied warranty of
13− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14− * Lesser General Public License for more details.
15− *
16− * You should have received a copy of the GNU Lesser General Public
17− * License along with FFmpeg; if not, write to the Free Software
18− * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19− */
20−
21−/**
22− * @file
23− * libavcodec/libavfilter gluing utilities
24− */
25−
26−#include "avcodec.h"
27−#include "libavutil/avassert.h"
28−#include "libavutil/channel_layout.h"
29−#include "libavutil/opt.h"
30−
31−#if FF_API_AVFILTERBUFFER
32−FF_DISABLE_DEPRECATION_WARNINGS
33−AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame,
34− int perms)
35−{
36− AVFilterBufferRef *picref =
37− avfilter_get_video_buffer_ref_from_arrays(frame->data, frame->linesize, perms,
38− frame->width, frame->height,
39− frame->format);
40− if (!picref)
41− return NULL;
42− if (avfilter_copy_frame_props(picref, frame) < 0) {
43− picref->buf->data[0] = NULL;
44− avfilter_unref_bufferp(&picref);
45− }
46− return picref;
47−}
48−
49−AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
50− int perms)
51−{
52− AVFilterBufferRef *samplesref;
53− int channels = av_frame_get_channels(frame);
54− int64_t layout = av_frame_get_channel_layout(frame);
55−
56− if (layout && av_get_channel_layout_nb_channels(layout) != av_frame_get_channels(frame)) {
57− av_log(NULL, AV_LOG_ERROR, "Layout indicates a different number of channels than actually present\n");
58− return NULL;
59− }
60−
61− samplesref = avfilter_get_audio_buffer_ref_from_arrays_channels(
62− (uint8_t **)frame->extended_data, frame->linesize[0], perms,
63− frame->nb_samples, frame->format, channels, layout);
64− if (!samplesref)
65− return NULL;
66− if (avfilter_copy_frame_props(samplesref, frame) < 0) {
67− samplesref->buf->data[0] = NULL;
68− avfilter_unref_bufferp(&samplesref);
69− }
70− return samplesref;
71−}
72−
73−AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
74− const AVFrame *frame,
75− int perms)
76−{
77− switch (type) {
78− case AVMEDIA_TYPE_VIDEO:
79− return avfilter_get_video_buffer_ref_from_frame(frame, perms);
80− case AVMEDIA_TYPE_AUDIO:
81− return avfilter_get_audio_buffer_ref_from_frame(frame, perms);
82− default:
83− return NULL;
84− }
85−}
86−
87−int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src)
88−{
89− int planes, nb_channels;
90−
91− if (!dst)
92− return AVERROR(EINVAL);
93− /* abort in case the src is NULL and dst is not, avoid inconsistent state in dst */
94− av_assert0(src);
95−
96− memcpy(dst->data, src->data, sizeof(dst->data));
97− memcpy(dst->linesize, src->linesize, sizeof(dst->linesize));
98−
99− dst->pts = src->pts;
100− dst->format = src->format;
101− av_frame_set_pkt_pos(dst, src->pos);
102−
103− switch (src->type) {
104− case AVMEDIA_TYPE_VIDEO:
105− av_assert0(src->video);
106− dst->width = src->video->w;
107− dst->height = src->video->h;
108− dst->sample_aspect_ratio = src->video->sample_aspect_ratio;
109− dst->interlaced_frame = src->video->interlaced;
110− dst->top_field_first = src->video->top_field_first;
111− dst->key_frame = src->video->key_frame;
112− dst->pict_type = src->video->pict_type;
113− break;
114− case AVMEDIA_TYPE_AUDIO:
115− av_assert0(src->audio);
116− nb_channels = av_get_channel_layout_nb_channels(src->audio->channel_layout);
117− planes = av_sample_fmt_is_planar(src->format) ? nb_channels : 1;
118−
119− if (planes > FF_ARRAY_ELEMS(dst->data)) {
120− dst->extended_data = av_mallocz_array(planes, sizeof(*dst->extended_data));
121− if (!dst->extended_data)
122− return AVERROR(ENOMEM);
123− memcpy(dst->extended_data, src->extended_data,
124− planes * sizeof(*dst->extended_data));
125− } else
126− dst->extended_data = dst->data;
127− dst->nb_samples = src->audio->nb_samples;
128− av_frame_set_sample_rate (dst, src->audio->sample_rate);
129− av_frame_set_channel_layout(dst, src->audio->channel_layout);
130− av_frame_set_channels (dst, src->audio->channels);
131− break;
132− default:
133− return AVERROR(EINVAL);
134− }
135−
136− return 0;
137−}
138−FF_ENABLE_DEPRECATION_WARNINGS
139−#endif
libavfilter/avcodec.h+0−69
@@ -1,69 +0,0 @@
1−/*
2− * This file is part of FFmpeg.
3− *
4− * FFmpeg is free software; you can redistribute it and/or
5− * modify it under the terms of the GNU Lesser General Public
6− * License as published by the Free Software Foundation; either
7− * version 2.1 of the License, or (at your option) any later version.
8− *
9− * FFmpeg is distributed in the hope that it will be useful,
10− * but WITHOUT ANY WARRANTY; without even the implied warranty of
11− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12− * Lesser General Public License for more details.
13− *
14− * You should have received a copy of the GNU Lesser General Public
15− * License along with FFmpeg; if not, write to the Free Software
16− * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17− */
18−
19−#ifndef AVFILTER_AVCODEC_H
20−#define AVFILTER_AVCODEC_H
21−
22−/**
23− * @file
24− * libavcodec/libavfilter gluing utilities
25− *
26− * This should be included in an application ONLY if the installed
27− * libavfilter has been compiled with libavcodec support, otherwise
28− * symbols defined below will not be available.
29− */
30−
31−#include "avfilter.h"
32−
33−#if FF_API_AVFILTERBUFFER
34−/**
35− * Create and return a picref reference from the data and properties
36− * contained in frame.
37− *
38− * @param perms permissions to assign to the new buffer reference
39− * @deprecated avfilter APIs work natively with AVFrame instead.
40− */
41−attribute_deprecated
42−AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame, int perms);
43−
44−
45−/**
46− * Create and return a picref reference from the data and properties
47− * contained in frame.
48− *
49− * @param perms permissions to assign to the new buffer reference
50− * @deprecated avfilter APIs work natively with AVFrame instead.
51− */
52−attribute_deprecated
53−AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
54− int perms);
55−
56−/**
57− * Create and return a buffer reference from the data and properties
58− * contained in frame.
59− *
60− * @param perms permissions to assign to the new buffer reference
61− * @deprecated avfilter APIs work natively with AVFrame instead.
62− */
63−attribute_deprecated
64−AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
65− const AVFrame *frame,
66− int perms);
67−#endif
68−
69−#endif /* AVFILTER_AVCODEC_H */
libavfilter/avfilter.h+0−15
@@ -428,10 +428,6 @@ struct AVFilterLink { · 427 unmodified lines
428428 AVLINK_INIT ///< complete
429429 } init_state;
430430
431−#if FF_API_AVFILTERBUFFER
432− struct AVFilterPool *pool;
433−#endif
434−
435431 /**
436432 * Graph the filter belongs to.
437433 */
@@ -486,17 +482,6 @@ struct AVFilterLink { · 48 unmodified lines
486482 */
487483 int max_samples;
488484
489−#if FF_API_AVFILTERBUFFER
490− /**
491− * The buffer reference currently being received across the link by the
492− * destination filter. This is used internally by the filter system to
493− * allow automatic copying of buffers which do not have sufficient
494− * permissions for the destination. This should not be accessed directly
495− * by the filters.
496− */
497− AVFilterBufferRef *cur_buf_copy;
498−#endif
499−
500485 /**
501486 * True if the link is closed.
502487 * If set, all attempts of start_frame, filter_frame or request_frame
libavfilter/buffersrc.c+0−1
@@ -39,7 +39,6 @@ · 38 unmodified lines
3939 #include "formats.h"
4040 #include "internal.h"
4141 #include "video.h"
42−#include "avcodec.h"
4342
4443 typedef struct BufferSourceContext {
4544 const AVClass *class;
libavfilter/internal.h+0−10
@@ -33,16 +33,6 @@ · 32 unmodified lines
3333 #include "video.h"
3434 #include "libavcodec/avcodec.h"
3535
36−#if FF_API_AVFILTERBUFFER
37−#define POOL_SIZE 32
38−typedef struct AVFilterPool {
39− AVFilterBufferRef *pic[POOL_SIZE];
40− int count;
41− int refcount;
42− int draining;
43−} AVFilterPool;
44−#endif
45−
4636 typedef struct AVFilterCommand {
4737 double time; ///< time expressed in seconds
4838 char *command; ///< command
libavfilter/src_movie.c+0−1
@@ -39,7 +39,6 @@ · 38 unmodified lines
3939 #include "libavutil/timestamp.h"
4040 #include "libavformat/avformat.h"
4141 #include "audio.h"
42−#include "avcodec.h"
4342 #include "avfilter.h"
4443 #include "formats.h"
4544 #include "internal.h"

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