Unified · Split
| @@ -33,7 +33,6 @@ · 32 unmodified lines | ||
| 33 | 33 | #include <libavcodec/avcodec.h> |
| 34 | 34 | #include <libavformat/avformat.h> |
| 35 | 35 | #include <libavfilter/avfiltergraph.h> |
| 36 | −#include <libavfilter/avcodec.h> | |
| 37 | 36 | #include <libavfilter/buffersink.h> |
| 38 | 37 | #include <libavfilter/buffersrc.h> |
| 39 | 38 | #include <libavutil/opt.h> |
| @@ -33,7 +33,6 @@ · 32 unmodified lines | ||
| 33 | 33 | #include <libavcodec/avcodec.h> |
| 34 | 34 | #include <libavformat/avformat.h> |
| 35 | 35 | #include <libavfilter/avfiltergraph.h> |
| 36 | −#include <libavfilter/avcodec.h> | |
| 37 | 36 | #include <libavfilter/buffersink.h> |
| 38 | 37 | #include <libavfilter/buffersrc.h> |
| 39 | 38 | #include <libavutil/opt.h> |
| @@ -31,7 +31,6 @@ · 30 unmodified lines | ||
| 31 | 31 | #include <libavcodec/avcodec.h> |
| 32 | 32 | #include <libavformat/avformat.h> |
| 33 | 33 | #include <libavfilter/avfiltergraph.h> |
| 34 | −#include <libavfilter/avcodec.h> | |
| 35 | 34 | #include <libavfilter/buffersink.h> |
| 36 | 35 | #include <libavfilter/buffersrc.h> |
| 37 | 36 | #include <libavutil/opt.h> |
| @@ -64,7 +64,6 @@ · 63 unmodified lines | ||
| 64 | 64 | #include "libavcodec/mathops.h" |
| 65 | 65 | #include "libavformat/os_support.h" |
| 66 | 66 | |
| 67 | −# include "libavfilter/avcodec.h" | |
| 68 | 67 | # include "libavfilter/avfilter.h" |
| 69 | 68 | # include "libavfilter/buffersrc.h" |
| 70 | 69 | # include "libavfilter/buffersink.h" |
| @@ -48,7 +48,6 @@ · 47 unmodified lines | ||
| 48 | 48 | #include "libswresample/swresample.h" |
| 49 | 49 | |
| 50 | 50 | #if CONFIG_AVFILTER |
| 51 | −# include "libavfilter/avcodec.h" | |
| 52 | 51 | # include "libavfilter/avfilter.h" |
| 53 | 52 | # include "libavfilter/buffersink.h" |
| 54 | 53 | # include "libavfilter/buffersrc.h" |
| @@ -2,9 +2,7 @@ include $(SUBDIR)../config.mak · 1 unmodified line | ||
| 2 | 2 | |
| 3 | 3 | NAME = avfilter |
| 4 | 4 | |
| 5 | −HEADERS = asrc_abuffer.h \ | |
| 6 | − avcodec.h \ | |
| 7 | − avfilter.h \ | |
| 5 | +HEADERS = avfilter.h \ | |
| 8 | 6 | avfiltergraph.h \ |
| 9 | 7 | buffersink.h \ |
| 10 | 8 | buffersrc.h \ |
| @@ -25,9 +23,6 @@ OBJS = allfilters.o \ · 14 unmodified lines | ||
| 25 | 23 | transform.o \ |
| 26 | 24 | video.o \ |
| 27 | 25 | |
| 28 | − | |
| 29 | −OBJS-$(CONFIG_AVCODEC) += avcodec.o | |
| 30 | − | |
| 31 | 26 | OBJS-$(CONFIG_ACROSSFADE_FILTER) += af_afade.o |
| 32 | 27 | OBJS-$(CONFIG_ADELAY_FILTER) += af_adelay.o |
| 33 | 28 | OBJS-$(CONFIG_AECHO_FILTER) += af_aecho.o |
| @@ -289,11 +289,6 @@ void avfilter_register_all(void) · 288 unmodified lines | ||
| 289 | 289 | REGISTER_FILTER(AMOVIE, amovie, avsrc); |
| 290 | 290 | REGISTER_FILTER(MOVIE, movie, avsrc); |
| 291 | 291 | |
| 292 | −#if FF_API_AVFILTERBUFFER | |
| 293 | − REGISTER_FILTER_UNCONDITIONAL(vsink_ffbuffersink); | |
| 294 | − REGISTER_FILTER_UNCONDITIONAL(asink_ffabuffersink); | |
| 295 | −#endif | |
| 296 | − | |
| 297 | 292 | /* those filters are part of public or internal API => registered |
| 298 | 293 | * unconditionally */ |
| 299 | 294 | REGISTER_FILTER_UNCONDITIONAL(asrc_abuffer); |
| @@ -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 */ | |
| @@ -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 | |
| @@ -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 */ | |
| @@ -428,10 +428,6 @@ struct AVFilterLink { · 427 unmodified lines | ||
| 428 | 428 | AVLINK_INIT ///< complete |
| 429 | 429 | } init_state; |
| 430 | 430 | |
| 431 | −#if FF_API_AVFILTERBUFFER | |
| 432 | − struct AVFilterPool *pool; | |
| 433 | −#endif | |
| 434 | − | |
| 435 | 431 | /** |
| 436 | 432 | * Graph the filter belongs to. |
| 437 | 433 | */ |
| @@ -486,17 +482,6 @@ struct AVFilterLink { · 48 unmodified lines | ||
| 486 | 482 | */ |
| 487 | 483 | int max_samples; |
| 488 | 484 | |
| 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 | − | |
| 500 | 485 | /** |
| 501 | 486 | * True if the link is closed. |
| 502 | 487 | * If set, all attempts of start_frame, filter_frame or request_frame |
| @@ -39,7 +39,6 @@ · 38 unmodified lines | ||
| 39 | 39 | #include "formats.h" |
| 40 | 40 | #include "internal.h" |
| 41 | 41 | #include "video.h" |
| 42 | −#include "avcodec.h" | |
| 43 | 42 | |
| 44 | 43 | typedef struct BufferSourceContext { |
| 45 | 44 | const AVClass *class; |
| @@ -33,16 +33,6 @@ · 32 unmodified lines | ||
| 33 | 33 | #include "video.h" |
| 34 | 34 | #include "libavcodec/avcodec.h" |
| 35 | 35 | |
| 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 | − | |
| 46 | 36 | typedef struct AVFilterCommand { |
| 47 | 37 | double time; ///< time expressed in seconds |
| 48 | 38 | char *command; ///< command |
| @@ -39,7 +39,6 @@ · 38 unmodified lines | ||
| 39 | 39 | #include "libavutil/timestamp.h" |
| 40 | 40 | #include "libavformat/avformat.h" |
| 41 | 41 | #include "audio.h" |
| 42 | −#include "avcodec.h" | |
| 43 | 42 | #include "avfilter.h" |
| 44 | 43 | #include "formats.h" |
| 45 | 44 | #include "internal.h" |