FFmpeg
audio.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Stefano Sabatini | stefasab at gmail.com
3  * Copyright (c) S.N. Hemanth Meenakshisundaram | smeenaks at ucsd.edu
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef AVFILTER_AUDIO_H
23 #define AVFILTER_AUDIO_H
24 
25 #include "avfilter.h"
26 #include "filters.h"
27 
28 /**
29  * An AVFilterPad array whose only entry has name "default"
30  * and is of type AVMEDIA_TYPE_AUDIO.
31  */
33 
34 /** default handler for get_audio_buffer() for audio inputs */
36 
37 /** get_audio_buffer() handler for filters which simply pass audio along */
39 
40 /**
41  * Request an audio samples buffer with a specific set of permissions.
42  *
43  * @param link the output link to the filter from which the buffer will
44  * be requested
45  * @param nb_samples the number of samples per channel
46  * @return on success an AVFrame owned by the caller, NULL on error
47  */
48 AVFrame *ff_get_audio_buffer(AVFilterLink *link, int nb_samples);
49 
50 /**
51  * Parse a sample rate.
52  *
53  * @param ret unsigned integer pointer to where the value should be written
54  * @param arg string to parse
55  * @param log_ctx log context
56  * @return >= 0 in case of success, a negative AVERROR code on error
57  */
59 int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx);
60 
61 /**
62  * Parse a channel layout or a corresponding integer representation.
63  *
64  * @param ret 64bit integer pointer to where the value should be written.
65  * @param nret integer pointer to the number of channels;
66  * if not NULL, then unknown channel layouts are accepted
67  * @param arg string to parse
68  * @param log_ctx log context
69  * @return >= 0 in case of success, a negative AVERROR code on error
70  */
72 int ff_parse_channel_layout(AVChannelLayout *ret, int *nret, const char *arg,
73  void *log_ctx);
74 
75 #endif /* AVFILTER_AUDIO_H */
ff_default_get_audio_buffer
AVFrame * ff_default_get_audio_buffer(AVFilterLink *link, int nb_samples)
default handler for get_audio_buffer() for audio inputs
Definition: audio.c:46
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:389
ff_parse_sample_rate
av_warn_unused_result int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx)
Parse a sample rate.
Definition: audio.c:111
ff_audio_default_filterpad
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
Definition: audio.c:34
AVFilterPad
A filter pad used for either input or output.
Definition: filters.h:38
filters.h
link
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a link
Definition: filter_design.txt:23
arg
const char * arg
Definition: jacosubdec.c:67
ff_parse_channel_layout
av_warn_unused_result int ff_parse_channel_layout(AVChannelLayout *ret, int *nret, const char *arg, void *log_ctx)
Parse a channel layout or a corresponding integer representation.
Definition: audio.c:123
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:311
ff_null_get_audio_buffer
AVFrame * ff_null_get_audio_buffer(AVFilterLink *link, int nb_samples)
get_audio_buffer() handler for filters which simply pass audio along
Definition: audio.c:41
av_warn_unused_result
#define av_warn_unused_result
Definition: attributes.h:64
ret
ret
Definition: filter_design.txt:187
ff_get_audio_buffer
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
Definition: audio.c:98
avfilter.h