FFmpeg
Loading...
Searching...
No Matches
audio_frame_queue.h
Go to the documentation of this file.
1/*
2 * Audio Frame Queue
3 * Copyright (c) 2012 Justin Ruggles
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 AVCODEC_AUDIO_FRAME_QUEUE_H
23#define AVCODEC_AUDIO_FRAME_QUEUE_H
24
25#include "avcodec.h"
26
27typedef struct AudioFrame {
31
41
42/**
43 * Initialize AudioFrameQueue.
44 *
45 * @param avctx context to use for time_base and av_log
46 * @param afq queue context
47 */
49
50/**
51 * Close AudioFrameQueue.
52 *
53 * Frees memory if needed.
54 *
55 * @param afq queue context
56 */
58
59/**
60 * Add a frame to the queue.
61 *
62 * @param afq queue context
63 * @param f frame to add to the queue
64 */
66
67/**
68 * Remove frame(s) from the queue.
69 *
70 * Retrieves the pts of the next available frame, or a generated pts based on
71 * the last frame duration if there are no frames left in the queue. The number
72 * of requested samples should be the full number of samples represented by the
73 * packet that will be output by the encoder. If fewer samples are available
74 * in the queue, a smaller value will be used for the output duration.
75 *
76 * @param afq queue context
77 * @param nb_samples number of samples to remove from the queue
78 * @param[out] pkt output packet
79 * @return 0 on success, negative AVERROR code on failure
80 */
81int ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, AVPacket *pkt);
82
83#endif /* AVCODEC_AUDIO_FRAME_QUEUE_H */
int ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, AVPacket *pkt)
Remove frame(s) from the queue.
void ff_af_queue_close(AudioFrameQueue *afq)
Close AudioFrameQueue.
int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
Add a frame to the queue.
void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
Initialize AudioFrameQueue.
Libavcodec external API header.
#define f(width, name)
Definition cbs_vp8.c:236
long long int64_t
Definition coverity.c:34
static AVPacket * pkt
main external API structure.
Definition avcodec.h:443
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
This structure stores compressed data.
Definition packet.h:580
AudioFrame * frames
AVCodecContext * avctx