yading@10: /* yading@10: * Copyright (c) Stefano Sabatini | stefasab at gmail.com yading@10: * Copyright (c) S.N. Hemanth Meenakshisundaram | smeenaks at ucsd.edu yading@10: * yading@10: * This file is part of FFmpeg. yading@10: * yading@10: * FFmpeg is free software; you can redistribute it and/or yading@10: * modify it under the terms of the GNU Lesser General Public yading@10: * License as published by the Free Software Foundation; either yading@10: * version 2.1 of the License, or (at your option) any later version. yading@10: * yading@10: * FFmpeg is distributed in the hope that it will be useful, yading@10: * but WITHOUT ANY WARRANTY; without even the implied warranty of yading@10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yading@10: * Lesser General Public License for more details. yading@10: * yading@10: * You should have received a copy of the GNU Lesser General Public yading@10: * License along with FFmpeg; if not, write to the Free Software yading@10: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA yading@10: */ yading@10: yading@10: #ifndef AVFILTER_AUDIO_H yading@10: #define AVFILTER_AUDIO_H yading@10: yading@10: #include "avfilter.h" yading@10: #include "internal.h" yading@10: yading@10: static const enum AVSampleFormat ff_packed_sample_fmts_array[] = { yading@10: AV_SAMPLE_FMT_U8, yading@10: AV_SAMPLE_FMT_S16, yading@10: AV_SAMPLE_FMT_S32, yading@10: AV_SAMPLE_FMT_FLT, yading@10: AV_SAMPLE_FMT_DBL, yading@10: AV_SAMPLE_FMT_NONE yading@10: }; yading@10: yading@10: static const enum AVSampleFormat ff_planar_sample_fmts_array[] = { yading@10: AV_SAMPLE_FMT_U8P, yading@10: AV_SAMPLE_FMT_S16P, yading@10: AV_SAMPLE_FMT_S32P, yading@10: AV_SAMPLE_FMT_FLTP, yading@10: AV_SAMPLE_FMT_DBLP, yading@10: AV_SAMPLE_FMT_NONE yading@10: }; yading@10: yading@10: /** default handler for get_audio_buffer() for audio inputs */ yading@10: AVFrame *ff_default_get_audio_buffer(AVFilterLink *link, int nb_samples); yading@10: yading@10: /** get_audio_buffer() handler for filters which simply pass audio along */ yading@10: AVFrame *ff_null_get_audio_buffer(AVFilterLink *link, int nb_samples); yading@10: yading@10: /** yading@10: * Request an audio samples buffer with a specific set of permissions. yading@10: * yading@10: * @param link the output link to the filter from which the buffer will yading@10: * be requested yading@10: * @param nb_samples the number of samples per channel yading@10: * @return A reference to the samples. This must be unreferenced with yading@10: * avfilter_unref_buffer when you are finished with it. yading@10: */ yading@10: AVFrame *ff_get_audio_buffer(AVFilterLink *link, int nb_samples); yading@10: yading@10: /** yading@10: * Send a buffer of audio samples to the next filter. yading@10: * yading@10: * @param link the output link over which the audio samples are being sent yading@10: * @param samplesref a reference to the buffer of audio samples being sent. The yading@10: * receiving filter will free this reference when it no longer yading@10: * needs it or pass it on to the next filter. yading@10: * yading@10: * @return >= 0 on success, a negative AVERROR on error. The receiving filter yading@10: * is responsible for unreferencing samplesref in case of error. yading@10: */ yading@10: int ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref); yading@10: yading@10: /** yading@10: * Send a buffer of audio samples to the next link, without checking yading@10: * min_samples. yading@10: */ yading@10: int ff_filter_samples_framed(AVFilterLink *link, yading@10: AVFilterBufferRef *samplesref); yading@10: yading@10: #endif /* AVFILTER_AUDIO_H */