00001 /* 00002 * Audio Frame Queue 00003 * Copyright (c) 2012 Justin Ruggles 00004 * 00005 * This file is part of Libav. 00006 * 00007 * Libav is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * Libav is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with Libav; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00022 #ifndef AVCODEC_AUDIO_FRAME_QUEUE_H 00023 #define AVCODEC_AUDIO_FRAME_QUEUE_H 00024 00025 #include "avcodec.h" 00026 00027 typedef struct AudioFrame { 00028 int64_t pts; 00029 int duration; 00030 } AudioFrame; 00031 00032 typedef struct AudioFrameQueue { 00033 AVCodecContext *avctx; 00034 int remaining_delay; 00035 int remaining_samples; 00036 AudioFrame *frames; 00037 unsigned frame_count; 00038 unsigned frame_alloc; 00039 } AudioFrameQueue; 00040 00047 void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq); 00048 00056 void ff_af_queue_close(AudioFrameQueue *afq); 00057 00064 int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f); 00065 00080 void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, 00081 int *duration); 00082 00088 void ff_af_queue_log_state(AudioFrameQueue *afq); 00089 00090 #endif /* AVCODEC_AUDIO_FRAME_QUEUE_H */