1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 /*
20 * APIs internal to the generic avformat layer.
21 *
22 * MUST NOT be included by individual muxers or demuxers.
23 */
24
25 #ifndef AVFORMAT_AVFORMAT_INTERNAL_H
26 #define AVFORMAT_AVFORMAT_INTERNAL_H
27
28 #include <stdint.h>
29
32
35
36 union {
37 // muxing only
38 struct {
39 /**
40 * Whether or not avformat_init_output has already been called
41 */
43
44 /**
45 * Whether or not avformat_init_output fully initialized streams
46 */
48
49
50 /**
51 * Number of streams relevant for interleaving.
52 * Muxing only.
53 */
55
56 /**
57 * The interleavement function in use. Always set.
58 */
60 int flush,
int has_packet);
61
62 #if FF_API_COMPUTE_PKT_FIELDS2
63 int missing_ts_warning;
64 #endif
65 };
66
67 // demuxing only
68 struct {
69 /**
70 * Raw packets from the demuxer, prior to parsing and decoding.
71 * This buffer is used for buffering packets until the codec can
72 * be identified, as parsing cannot be done without knowing the
73 * codec.
74 */
76
77 /**
78 * Sum of the size of packets in raw_packet_buffer, in bytes.
79 */
81
82 /**
83 * Packets split by the parser get queued here.
84 */
86
87 /**
88 * Contexts and child contexts do not contain a metadata option
89 */
91
92 /**
93 * Set if chapter ids are strictly monotonic.
94 */
96 };
97 };
99
101 {
103 }
104
105 #define RELATIVE_TS_BASE (INT64_MAX - (1LL << 48))
106
108 {
110 }
111
112 /**
113 * Wrap a given time stamp, if there is an indication for an overflow
114 *
115 * @param st stream
116 * @param timestamp the time stamp to wrap
117 * @return resulting time stamp
118 */
120
122 /**
123 * The public context.
124 */
126
129
131 {
133 }
134
136 {
138 }
139
141
144
145 /**
146 * Frees a stream without modifying the corresponding AVFormatContext.
147 * Must only be called if the latter doesn't matter or if the stream
148 * is not yet attached to an AVFormatContext.
149 */
151
152 /**
153 * Frees a stream group without modifying the corresponding AVFormatContext.
154 * Must only be called if the latter doesn't matter or if the stream
155 * is not yet attached to an AVFormatContext.
156 */
158
160
165
166 #endif // AVFORMAT_AVFORMAT_INTERNAL_H