2 * audio interleaving prototypes and declarations
4 * Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>
6 * This file is part of FFmpeg.
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #ifndef AVFORMAT_RETIMEINTERLEAVE_H
24 #define AVFORMAT_RETIMEINTERLEAVE_H
28 typedef struct RetimeInterleaveContext {
29 uint64_t dts; ///< current dts
30 AVRational time_base; ///< time base of output packets
31 } RetimeInterleaveContext;
34 * Init the retime interleave context
36 void ff_retime_interleave_init(RetimeInterleaveContext *aic, AVRational time_base);
39 * Retime packets per RetimeInterleaveContext->time_base and interleave them
41 * The first element of AVStream->priv_data must be RetimeInterleaveContext
42 * when using this function.
44 * @param get_packet function will output a packet when streams are correctly interleaved.
45 * @param compare_ts function will compare AVPackets and decide interleaving order.
47 int ff_retime_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush,
48 int (*get_packet)(AVFormatContext *, AVPacket *, AVPacket *, int),
49 int (*compare_ts)(AVFormatContext *, const AVPacket *, const AVPacket *));
51 #endif /* AVFORMAT_AUDIOINTERLEAVE_H */