Mercurial > libavformat.hg
annotate audiointerleave.h @ 5754:65b77d0674d0 libavformat
Always call ff_network_init/ff_network_close when opening protocols
ff_network_init is a no-op on all platforms except windows, and on
windows the performance penalty is minimal (less than 1 ms in my tests).
author | mstorsjo |
---|---|
date | Fri, 05 Mar 2010 22:30:21 +0000 |
parents | d6eb19c43e99 |
children |
rev | line source |
---|---|
4400
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
1 /* |
4422
dd42a94023eb
cosmetics: typo/grammar fixes in doxygen and other comments
diego
parents:
4417
diff
changeset
|
2 * audio interleaving prototypes and declarations |
4400
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
3 * |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
4 * Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com> |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
5 * |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
6 * This file is part of FFmpeg. |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
7 * |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
8 * FFmpeg is free software; you can redistribute it and/or |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
10 * License as published by the Free Software Foundation; either |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
11 * version 2.1 of the License, or (at your option) any later version. |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
12 * |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
13 * FFmpeg is distributed in the hope that it will be useful, |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
16 * Lesser General Public License for more details. |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
17 * |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
19 * License along with FFmpeg; if not, write to the Free Software |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
21 */ |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
22 |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
23 #ifndef AVFORMAT_AUDIOINTERLEAVE_H |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
24 #define AVFORMAT_AUDIOINTERLEAVE_H |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
25 |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
26 #include "libavutil/fifo.h" |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
27 #include "avformat.h" |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
28 |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
29 typedef struct { |
4669
d6eb19c43e99
Allocate AVFifoBuffer through the fifo API to reduce future API/ABI issues.
michael
parents:
4426
diff
changeset
|
30 AVFifoBuffer *fifo; |
4422
dd42a94023eb
cosmetics: typo/grammar fixes in doxygen and other comments
diego
parents:
4417
diff
changeset
|
31 unsigned fifo_size; ///< size of currently allocated FIFO |
4400
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
32 uint64_t dts; ///< current dts |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
33 int sample_size; ///< size of one sample all channels included |
4422
dd42a94023eb
cosmetics: typo/grammar fixes in doxygen and other comments
diego
parents:
4417
diff
changeset
|
34 const int *samples_per_frame; ///< must be 0-terminated |
4400
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
35 const int *samples; ///< current samples per frame, pointer to samples_per_frame |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
36 AVRational time_base; ///< time base of output audio packets |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
37 } AudioInterleaveContext; |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
38 |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
39 int ff_audio_interleave_init(AVFormatContext *s, const int *samples_per_frame, AVRational time_base); |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
40 void ff_audio_interleave_close(AVFormatContext *s); |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
41 |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
42 int ff_interleave_compare_dts(AVFormatContext *s, AVPacket *next, AVPacket *pkt); |
4416 | 43 /** |
4422
dd42a94023eb
cosmetics: typo/grammar fixes in doxygen and other comments
diego
parents:
4417
diff
changeset
|
44 * Rechunk audio PCM packets per AudioInterleaveContext->samples_per_frame |
4416 | 45 * and interleave them correctly. |
4422
dd42a94023eb
cosmetics: typo/grammar fixes in doxygen and other comments
diego
parents:
4417
diff
changeset
|
46 * The first element of AVStream->priv_data must be AudioInterleaveContext |
4416 | 47 * when using this function. |
48 * | |
49 * @param get_packet function will output a packet when streams are correctly interleaved. | |
50 * @param compare_ts function will compare AVPackets and decide interleaving order. | |
51 */ | |
4426
7854590fb1fd
rename ff_audio_interleave to ff_audio_rechunk_interleave
bcoudurier
parents:
4422
diff
changeset
|
52 int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush, |
4400
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
53 int (*get_packet)(AVFormatContext *, AVPacket *, AVPacket *, int), |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
54 int (*compare_ts)(AVFormatContext *, AVPacket *, AVPacket *)); |
65adb9e5214f
extract audio interleaving code from mxf muxer, will be used by gxf and dv
bcoudurier
parents:
diff
changeset
|
55 |
4422
dd42a94023eb
cosmetics: typo/grammar fixes in doxygen and other comments
diego
parents:
4417
diff
changeset
|
56 #endif /* AVFORMAT_AUDIOINTERLEAVE_H */ |