annotate Input/aac/libmp4v2/mp4file.h @ 53:710d8b266d7e trunk

[svn] Cleaning autogenerated files
author msameer
date Thu, 27 Oct 2005 12:54:05 -0700
parents 6a86fdd4dea4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
1 /*
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
2 * The contents of this file are subject to the Mozilla Public
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
3 * License Version 1.1 (the "License"); you may not use this file
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
4 * except in compliance with the License. You may obtain a copy of
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
5 * the License at http://www.mozilla.org/MPL/
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
6 *
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
7 * Software distributed under the License is distributed on an "AS
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
9 * implied. See the License for the specific language governing
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
10 * rights and limitations under the License.
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
11 *
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
12 * The Original Code is MPEG4IP.
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
13 *
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
14 * The Initial Developer of the Original Code is Cisco Systems Inc.
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
15 * Portions created by Cisco Systems Inc. are
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
16 * Copyright (C) Cisco Systems Inc. 2001 - 2005. All Rights Reserved.
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
17 *
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
18 * 3GPP features implementation is based on 3GPP's TS26.234-v5.60,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
19 * and was contributed by Ximpo Group Ltd.
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
20 *
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
21 * Portions created by Ximpo Group Ltd. are
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
22 * Copyright (C) Ximpo Group Ltd. 2003, 2004. All Rights Reserved.
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
23 *
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
24 * Contributor(s):
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
25 * Dave Mackie dmackie@cisco.com
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
26 * Alix Marchandise-Franquet alix@cisco.com
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
27 * Ximpo Group Ltd. mp4v2@ximpo.com
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
28 */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
29
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
30 #ifndef __MP4_FILE_INCLUDED__
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
31 #define __MP4_FILE_INCLUDED__
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
32
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
33 // forward declarations
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
34 class MP4Atom;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
35 class MP4Property;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
36 class MP4Float32Property;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
37 class MP4StringProperty;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
38 class MP4BytesProperty;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
39 class MP4Descriptor;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
40 class MP4DescriptorProperty;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
41
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
42 class MP4File {
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
43 public: /* equivalent to MP4 library API */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
44 MP4File(u_int32_t verbosity = 0);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
45 ~MP4File();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
46
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
47 /* file operations */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
48 void Read(const char* fileName);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
49 void Create(const char* fileName, u_int32_t flags,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
50 int add_ftyp = 1, int add_iods = 1,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
51 char* majorBrand = NULL,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
52 u_int32_t minorVersion = 0, char** supportedBrands = NULL,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
53 u_int32_t supportedBrandsCount = 0);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
54 void Modify(const char* fileName);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
55 void Optimize(const char* orgFileName,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
56 const char* newFileName = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
57 void Dump(FILE* pDumpFile = NULL, bool dumpImplicits = false);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
58 void Close();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
59
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
60 /* library property per file */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
61
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
62 u_int32_t GetVerbosity() {
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
63 return m_verbosity;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
64 }
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
65 void SetVerbosity(u_int32_t verbosity) {
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
66 m_verbosity = verbosity;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
67 }
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
68
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
69 bool Use64Bits(const char *atomName);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
70
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
71 /* file properties */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
72
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
73 u_int64_t GetIntegerProperty(const char* name);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
74 float GetFloatProperty(const char* name);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
75 const char* GetStringProperty(const char* name);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
76 void GetBytesProperty(const char* name,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
77 u_int8_t** ppValue, u_int32_t* pValueSize);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
78
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
79 void SetIntegerProperty(const char* name, u_int64_t value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
80 void SetFloatProperty(const char* name, float value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
81 void SetStringProperty(const char* name, const char* value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
82 void SetBytesProperty(const char* name,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
83 const u_int8_t* pValue, u_int32_t valueSize);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
84
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
85 // file level convenience functions
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
86
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
87 MP4Duration GetDuration();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
88 void SetDuration(MP4Duration value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
89
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
90 u_int32_t GetTimeScale();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
91 void SetTimeScale(u_int32_t value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
92
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
93 u_int8_t GetODProfileLevel();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
94 void SetODProfileLevel(u_int8_t value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
95
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
96 u_int8_t GetSceneProfileLevel();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
97 void SetSceneProfileLevel(u_int8_t value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
98
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
99 u_int8_t GetVideoProfileLevel();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
100 void SetVideoProfileLevel(u_int8_t value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
101
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
102 u_int8_t GetAudioProfileLevel();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
103 void SetAudioProfileLevel(u_int8_t value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
104
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
105 u_int8_t GetGraphicsProfileLevel();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
106 void SetGraphicsProfileLevel(u_int8_t value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
107
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
108 const char* GetSessionSdp();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
109 void SetSessionSdp(const char* sdpString);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
110 void AppendSessionSdp(const char* sdpString);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
111
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
112 /* track operations */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
113
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
114 MP4TrackId AddTrack(const char* type, u_int32_t timeScale = 1000);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
115 void DeleteTrack(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
116
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
117 u_int32_t GetNumberOfTracks(const char* type = NULL, u_int8_t subType = 0);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
118
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
119 MP4TrackId AllocTrackId();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
120 MP4TrackId FindTrackId(u_int16_t trackIndex,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
121 const char* type = NULL, u_int8_t subType = 0);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
122 u_int16_t FindTrackIndex(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
123 u_int16_t FindTrakAtomIndex(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
124
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
125 /* track properties */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
126
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
127 u_int64_t GetTrackIntegerProperty(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
128 MP4TrackId trackId, const char* name);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
129 float GetTrackFloatProperty(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
130 MP4TrackId trackId, const char* name);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
131 const char* GetTrackStringProperty(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
132 MP4TrackId trackId, const char* name);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
133 void GetTrackBytesProperty(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
134 MP4TrackId trackId, const char* name,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
135 u_int8_t** ppValue, u_int32_t* pValueSize);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
136
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
137 void SetTrackIntegerProperty(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
138 MP4TrackId trackId, const char* name, int64_t value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
139 void SetTrackFloatProperty(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
140 MP4TrackId trackId, const char* name, float value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
141 void SetTrackStringProperty(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
142 MP4TrackId trackId, const char* name, const char* value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
143 void SetTrackBytesProperty(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
144 MP4TrackId trackId, const char* name,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
145 const u_int8_t* pValue, u_int32_t valueSize);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
146
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
147 /* sample operations */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
148
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
149 u_int32_t GetSampleSize(MP4TrackId trackId, MP4SampleId sampleId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
150
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
151 u_int32_t GetTrackMaxSampleSize(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
152
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
153 MP4SampleId GetSampleIdFromTime(MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
154 MP4Timestamp when, bool wantSyncSample = false);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
155
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
156 MP4Timestamp GetSampleTime(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
157 MP4TrackId trackId, MP4SampleId sampleId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
158
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
159 MP4Duration GetSampleDuration(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
160 MP4TrackId trackId, MP4SampleId sampleId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
161
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
162 MP4Duration GetSampleRenderingOffset(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
163 MP4TrackId trackId, MP4SampleId sampleId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
164
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
165 bool GetSampleSync(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
166 MP4TrackId trackId, MP4SampleId sampleId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
167
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
168 void ReadSample(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
169 // input parameters
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
170 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
171 MP4SampleId sampleId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
172 // output parameters
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
173 u_int8_t** ppBytes,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
174 u_int32_t* pNumBytes,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
175 MP4Timestamp* pStartTime = NULL,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
176 MP4Duration* pDuration = NULL,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
177 MP4Duration* pRenderingOffset = NULL,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
178 bool* pIsSyncSample = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
179
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
180 void WriteSample(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
181 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
182 const u_int8_t* pBytes,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
183 u_int32_t numBytes,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
184 MP4Duration duration = 0,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
185 MP4Duration renderingOffset = 0,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
186 bool isSyncSample = true);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
187
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
188 void SetSampleRenderingOffset(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
189 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
190 MP4SampleId sampleId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
191 MP4Duration renderingOffset);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
192
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
193 /* track level convenience functions */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
194
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
195 MP4TrackId AddSystemsTrack(const char* type);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
196
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
197 MP4TrackId AddODTrack();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
198
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
199 MP4TrackId AddSceneTrack();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
200
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
201 MP4TrackId AddAudioTrack(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
202 u_int32_t timeScale,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
203 MP4Duration sampleDuration,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
204 u_int8_t audioType);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
205
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
206 MP4TrackId AddEncAudioTrack( // ismacryp
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
207 u_int32_t timeScale,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
208 MP4Duration sampleDuration,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
209 u_int8_t audioType,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
210 u_int32_t scheme_type,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
211 u_int16_t scheme_version,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
212 u_int8_t key_ind_len,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
213 u_int8_t iv_len,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
214 bool selective_enc,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
215 char *kms_uri);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
216
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
217 void SetAmrVendor(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
218 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
219 u_int32_t vendor);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
220
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
221 void SetAmrDecoderVersion(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
222 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
223 u_int8_t decoderVersion);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
224
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
225 void SetAmrModeSet(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
226 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
227 u_int16_t modeSet);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
228 uint16_t GetAmrModeSet(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
229
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
230 MP4TrackId AddAmrAudioTrack(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
231 u_int32_t timeScale,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
232 u_int16_t modeSet,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
233 u_int8_t modeChangePeriod,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
234 u_int8_t framesPerSample,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
235 bool isAmrWB);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
236
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
237 MP4TrackId AddHrefTrack(uint32_t timeScale,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
238 MP4Duration sampleDuration);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
239
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
240 MP4TrackId AddMP4VideoTrack(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
241 u_int32_t timeScale,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
242 MP4Duration sampleDuration,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
243 u_int16_t width,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
244 u_int16_t height,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
245 u_int8_t videoType);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
246
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
247 MP4TrackId AddEncVideoTrack( // ismacryp
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
248 u_int32_t timeScale,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
249 MP4Duration sampleDuration,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
250 u_int16_t width,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
251 u_int16_t height,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
252 u_int8_t videoType,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
253 u_int32_t scheme_type,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
254 u_int16_t scheme_version,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
255 u_int8_t key_ind_len,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
256 u_int8_t iv_len,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
257 bool selective_enc,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
258 char *kms_uri);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
259
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
260
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
261 void SetH263Vendor(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
262 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
263 u_int32_t vendor);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
264
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
265 void SetH263DecoderVersion(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
266 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
267 u_int8_t decoderVersion);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
268
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
269 void SetH263Bitrates(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
270 MP4TrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
271 u_int32_t avgBitrate,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
272 u_int32_t maxBitrate);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
273
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
274 MP4TrackId AddH263VideoTrack(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
275 u_int32_t timeScale,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
276 MP4Duration sampleDuration,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
277 u_int16_t width,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
278 u_int16_t height,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
279 u_int8_t h263Level,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
280 u_int8_t h263Profile,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
281 u_int32_t avgBitrate,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
282 u_int32_t maxBitrate);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
283 MP4TrackId AddH264VideoTrack(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
284 u_int32_t timeScale,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
285 MP4Duration sampleDuration,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
286 u_int16_t width,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
287 u_int16_t height,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
288 uint8_t AVCProfileIndication,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
289 uint8_t profile_compat,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
290 uint8_t AVCLevelIndication,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
291 uint8_t sampleLenFieldSizeMinusOne);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
292 bool AddH264SequenceParameterSet(MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
293 const uint8_t *pSequence,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
294 uint16_t sequenceLen);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
295 bool AddH264PictureParameterSet(MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
296 const uint8_t *pPicture,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
297 uint16_t pictureLen);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
298 MP4TrackId AddHintTrack(MP4TrackId refTrackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
299
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
300 MP4SampleId GetTrackNumberOfSamples(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
301
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
302 const char* GetTrackType(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
303
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
304 const char *GetTrackMediaDataName(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
305 MP4Duration GetTrackDuration(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
306
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
307 u_int32_t GetTrackTimeScale(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
308 void SetTrackTimeScale(MP4TrackId trackId, u_int32_t value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
309
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
310 // replacement to GetTrackAudioType and GetTrackVideoType
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
311 u_int8_t GetTrackEsdsObjectTypeId(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
312
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
313 u_int8_t GetTrackAudioMpeg4Type(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
314
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
315 MP4Duration GetTrackFixedSampleDuration(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
316
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
317 double GetTrackVideoFrameRate(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
318
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
319 int GetTrackAudioChannels(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
320 void GetTrackESConfiguration(MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
321 u_int8_t** ppConfig, u_int32_t* pConfigSize);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
322 void SetTrackESConfiguration(MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
323 const u_int8_t* pConfig, u_int32_t configSize);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
324
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
325 void GetTrackVideoMetadata(MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
326 u_int8_t** ppConfig, u_int32_t* pConfigSize);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
327 void GetTrackH264ProfileLevel(MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
328 uint8_t *pProfile,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
329 uint8_t *pLevel);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
330 bool GetTrackH264SeqPictHeaders(MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
331 uint8_t ***pSeqHeader,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
332 uint32_t **pSeqHeaderSize,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
333 uint8_t ***pPictHeader,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
334 uint32_t **pPictHeaderSize);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
335 void GetTrackH264LengthSize(MP4TrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
336 uint32_t *pLength);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
337 const char* GetHintTrackSdp(MP4TrackId hintTrackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
338 void SetHintTrackSdp(MP4TrackId hintTrackId, const char* sdpString);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
339 void AppendHintTrackSdp(MP4TrackId hintTrackId, const char* sdpString);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
340
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
341 // 3GPP specific functions
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
342 void MakeFtypAtom(char* majorBrand,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
343 u_int32_t minorVersion,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
344 char** supportedBrands,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
345 u_int32_t supportedBrandsCount);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
346 void Make3GPCompliant(const char* fileName,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
347 char* majorBrand,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
348 u_int32_t minorVersion,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
349 char** supportedBrands,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
350 u_int32_t supportedBrandsCount,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
351 bool deleteIodsAtom);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
352
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
353 // ISMA specific functions
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
354
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
355 // true if media track encrypted according to ismacryp
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
356 bool IsIsmaCrypMediaTrack(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
357
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
358 void MakeIsmaCompliant(bool addIsmaComplianceSdp = true);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
359
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
360 void CreateIsmaIodFromParams(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
361 u_int8_t videoProfile,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
362 u_int32_t videoBitrate,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
363 u_int8_t* videoConfig,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
364 u_int32_t videoConfigLength,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
365 u_int8_t audioProfile,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
366 u_int32_t audioBitrate,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
367 u_int8_t* audioConfig,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
368 u_int32_t audioConfigLength,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
369 u_int8_t** ppBytes,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
370 u_int64_t* pNumBytes);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
371
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
372 // time convenience functions
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
373
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
374 u_int64_t ConvertFromMovieDuration(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
375 MP4Duration duration,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
376 u_int32_t timeScale);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
377
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
378 u_int64_t ConvertFromTrackTimestamp(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
379 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
380 MP4Timestamp timeStamp,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
381 u_int32_t timeScale);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
382
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
383 MP4Timestamp ConvertToTrackTimestamp(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
384 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
385 u_int64_t timeStamp,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
386 u_int32_t timeScale);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
387
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
388 u_int64_t ConvertFromTrackDuration(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
389 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
390 MP4Duration duration,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
391 u_int32_t timeScale);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
392
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
393 MP4Duration ConvertToTrackDuration(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
394 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
395 u_int64_t duration,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
396 u_int32_t timeScale);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
397
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
398 // specialized operations
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
399
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
400 void GetHintTrackRtpPayload(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
401 MP4TrackId hintTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
402 char** ppPayloadName = NULL,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
403 u_int8_t* pPayloadNumber = NULL,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
404 u_int16_t* pMaxPayloadSize = NULL,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
405 char **ppEncodingParams = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
406
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
407 void SetHintTrackRtpPayload(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
408 MP4TrackId hintTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
409 const char* payloadName,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
410 u_int8_t* pPayloadNumber,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
411 u_int16_t maxPayloadSize,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
412 const char *encoding_params,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
413 bool include_rtp_map,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
414 bool include_mpeg4_esid);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
415
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
416 MP4TrackId GetHintTrackReferenceTrackId(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
417 MP4TrackId hintTrackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
418
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
419 void ReadRtpHint(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
420 MP4TrackId hintTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
421 MP4SampleId hintSampleId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
422 u_int16_t* pNumPackets = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
423
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
424 u_int16_t GetRtpHintNumberOfPackets(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
425 MP4TrackId hintTrackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
426
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
427 int8_t GetRtpPacketBFrame(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
428 MP4TrackId hintTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
429 u_int16_t packetIndex);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
430
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
431 int32_t GetRtpPacketTransmitOffset(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
432 MP4TrackId hintTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
433 u_int16_t packetIndex);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
434
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
435 void ReadRtpPacket(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
436 MP4TrackId hintTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
437 u_int16_t packetIndex,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
438 u_int8_t** ppBytes,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
439 u_int32_t* pNumBytes,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
440 u_int32_t ssrc = 0,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
441 bool includeHeader = true,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
442 bool includePayload = true);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
443
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
444 MP4Timestamp GetRtpTimestampStart(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
445 MP4TrackId hintTrackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
446
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
447 void SetRtpTimestampStart(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
448 MP4TrackId hintTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
449 MP4Timestamp rtpStart);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
450
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
451 void AddRtpHint(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
452 MP4TrackId hintTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
453 bool isBframe,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
454 u_int32_t timestampOffset);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
455
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
456 void AddRtpPacket(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
457 MP4TrackId hintTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
458 bool setMbit,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
459 int32_t transmitOffset);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
460
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
461 void AddRtpImmediateData(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
462 MP4TrackId hintTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
463 const u_int8_t* pBytes,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
464 u_int32_t numBytes);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
465
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
466 void AddRtpSampleData(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
467 MP4TrackId hintTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
468 MP4SampleId sampleId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
469 u_int32_t dataOffset,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
470 u_int32_t dataLength);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
471
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
472 void AddRtpESConfigurationPacket(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
473 MP4TrackId hintTrackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
474
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
475 void WriteRtpHint(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
476 MP4TrackId hintTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
477 MP4Duration duration,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
478 bool isSyncSample);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
479
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
480 u_int8_t AllocRtpPayloadNumber();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
481
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
482 // edit list related
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
483
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
484 char* MakeTrackEditName(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
485 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
486 MP4EditId editId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
487 const char* name);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
488
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
489 MP4EditId AddTrackEdit(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
490 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
491 MP4EditId editId = MP4_INVALID_EDIT_ID);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
492
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
493 void DeleteTrackEdit(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
494 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
495 MP4EditId editId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
496
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
497 u_int32_t GetTrackNumberOfEdits(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
498 MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
499
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
500 MP4Timestamp GetTrackEditStart(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
501 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
502 MP4EditId editId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
503
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
504 MP4Duration GetTrackEditTotalDuration(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
505 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
506 MP4EditId editId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
507
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
508 MP4Timestamp GetTrackEditMediaStart(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
509 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
510 MP4EditId editId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
511
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
512 void SetTrackEditMediaStart(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
513 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
514 MP4EditId editId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
515 MP4Timestamp startTime);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
516
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
517 MP4Duration GetTrackEditDuration(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
518 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
519 MP4EditId editId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
520
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
521 void SetTrackEditDuration(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
522 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
523 MP4EditId editId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
524 MP4Duration duration);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
525
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
526 bool GetTrackEditDwell(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
527 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
528 MP4EditId editId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
529
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
530 void SetTrackEditDwell(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
531 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
532 MP4EditId editId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
533 bool dwell);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
534
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
535 MP4SampleId GetSampleIdFromEditTime(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
536 MP4TrackId trackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
537 MP4Timestamp when,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
538 MP4Timestamp* pStartTime = NULL,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
539 MP4Duration* pDuration = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
540
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
541 /* iTunes metadata handling */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
542 protected:
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
543 bool CreateMetadataAtom(const char* name);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
544 bool DeleteMetadataAtom(const char* name);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
545 bool GetMetadataString(const char *atom, char **value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
546 bool SetMetadataString(const char *atom, const char *value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
547 public:
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
548 bool MetadataDelete(void);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
549
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
550 /* set metadata */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
551 bool SetMetadataName(const char* value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
552 bool SetMetadataWriter(const char* value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
553 bool SetMetadataAlbum(const char* value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
554 bool SetMetadataArtist(const char* value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
555 bool SetMetadataTool(const char* value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
556 bool SetMetadataComment(const char* value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
557 bool SetMetadataYear(const char* value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
558 bool SetMetadataTrack(u_int16_t track, u_int16_t totalTracks);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
559 bool SetMetadataDisk(u_int16_t disk, u_int16_t totalDisks);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
560 bool SetMetadataGenre(const char *value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
561 bool SetMetadataGrouping(const char *value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
562 bool SetMetadataTempo(u_int16_t tempo);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
563 bool SetMetadataCompilation(u_int8_t compilation);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
564 bool SetMetadataCoverArt(u_int8_t *coverArt, u_int32_t size);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
565 bool SetMetadataFreeForm(char *name,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
566 u_int8_t* pValue,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
567 u_int32_t valueSize);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
568
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
569 /* get metadata */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
570 bool GetMetadataByIndex(u_int32_t index,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
571 const char** ppName,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
572 u_int8_t** ppValue,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
573 u_int32_t* pValueSize);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
574 bool GetMetadataName(char** value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
575 bool GetMetadataWriter(char** value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
576 bool GetMetadataAlbum(char** value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
577 bool GetMetadataArtist(char** value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
578 bool GetMetadataTool(char** value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
579 bool GetMetadataComment(char** value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
580 bool GetMetadataYear(char** value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
581 bool GetMetadataTrack(u_int16_t* track, u_int16_t* totalTracks);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
582 bool GetMetadataDisk(u_int16_t* disk, u_int16_t* totalDisks);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
583 bool GetMetadataGenre(char **value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
584 bool GetMetadataGrouping(char **value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
585 bool GetMetadataTempo(u_int16_t* tempo);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
586 bool GetMetadataCompilation(u_int8_t* compilation);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
587 bool GetMetadataCoverArt(u_int8_t **coverArt, u_int32_t* size);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
588 bool GetMetadataFreeForm(char *name,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
589 u_int8_t** pValue,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
590 u_int32_t* valueSize);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
591
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
592 /* delete metadata */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
593 bool DeleteMetadataName();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
594 bool DeleteMetadataWriter();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
595 bool DeleteMetadataAlbum();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
596 bool DeleteMetadataArtist();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
597 bool DeleteMetadataTool();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
598 bool DeleteMetadataComment();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
599 bool DeleteMetadataYear();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
600 bool DeleteMetadataTrack();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
601 bool DeleteMetadataDisk();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
602 bool DeleteMetadataGenre();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
603 bool DeleteMetadataGrouping();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
604 bool DeleteMetadataTempo();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
605 bool DeleteMetadataCompilation();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
606 bool DeleteMetadataCoverArt();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
607 bool DeleteMetadataFreeForm(char *name);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
608
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
609 /* end of MP4 API */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
610
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
611 /* "protected" interface to be used only by friends in library */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
612
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
613 u_int64_t GetPosition(FILE* pFile = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
614 void SetPosition(u_int64_t pos, FILE* pFile = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
615
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
616 u_int64_t GetSize();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
617
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
618 u_int32_t ReadBytes(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
619 u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
620 u_int64_t ReadUInt(u_int8_t size);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
621 u_int8_t ReadUInt8();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
622 u_int16_t ReadUInt16();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
623 u_int32_t ReadUInt24();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
624 u_int32_t ReadUInt32();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
625 u_int64_t ReadUInt64();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
626 float ReadFixed16();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
627 float ReadFixed32();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
628 float ReadFloat();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
629 char* ReadString();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
630 char* ReadCountedString(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
631 u_int8_t charSize = 1, bool allowExpandedCount = false);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
632 u_int64_t ReadBits(u_int8_t numBits);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
633 void FlushReadBits();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
634 u_int32_t ReadMpegLength();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
635
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
636 u_int32_t PeekBytes(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
637 u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
638
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
639 void WriteBytes(u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
640 void WriteUInt(u_int64_t value, u_int8_t size);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
641 void WriteUInt8(u_int8_t value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
642 void WriteUInt16(u_int16_t value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
643 void WriteUInt24(u_int32_t value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
644 void WriteUInt32(u_int32_t value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
645 void WriteUInt64(u_int64_t value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
646 void WriteFixed16(float value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
647 void WriteFixed32(float value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
648 void WriteFloat(float value);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
649 void WriteString(char* string);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
650 void WriteCountedString(char* string,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
651 u_int8_t charSize = 1, bool allowExpandedCount = false);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
652 void WriteBits(u_int64_t bits, u_int8_t numBits);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
653 void PadWriteBits(u_int8_t pad = 0);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
654 void FlushWriteBits();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
655 void WriteMpegLength(u_int32_t value, bool compact = false);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
656
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
657 void EnableMemoryBuffer(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
658 u_int8_t* pBytes = NULL, u_int64_t numBytes = 0);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
659 void DisableMemoryBuffer(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
660 u_int8_t** ppBytes = NULL, u_int64_t* pNumBytes = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
661
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
662 char GetMode() {
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
663 return m_mode;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
664 }
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
665
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
666 MP4Track* GetTrack(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
667
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
668 MP4Duration UpdateDuration(MP4Duration duration);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
669
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
670 MP4Atom* FindAtom(const char* name);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
671
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
672 MP4Atom* AddChildAtom(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
673 const char* parentName,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
674 const char* childName);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
675
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
676 MP4Atom* AddChildAtom(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
677 MP4Atom* pParentAtom,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
678 const char* childName);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
679
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
680 MP4Atom* InsertChildAtom(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
681 const char* parentName,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
682 const char* childName,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
683 u_int32_t index);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
684
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
685 MP4Atom* InsertChildAtom(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
686 MP4Atom* pParentAtom,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
687 const char* childName,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
688 u_int32_t index);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
689
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
690 MP4Atom* AddDescendantAtoms(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
691 const char* ancestorName,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
692 const char* childName);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
693
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
694 MP4Atom* AddDescendantAtoms(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
695 MP4Atom* pAncestorAtom,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
696 const char* childName);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
697
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
698 protected:
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
699 void Open(const char* fmode);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
700 void ReadFromFile();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
701 void GenerateTracks();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
702 void BeginWrite();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
703 void FinishWrite();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
704 void CacheProperties();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
705 void RewriteMdat(FILE* pReadFile, FILE* pWriteFile);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
706 bool ShallHaveIods();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
707
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
708 const char* TempFileName();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
709 void Rename(const char* existingFileName, const char* newFileName);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
710
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
711 void ProtectWriteOperation(char* where);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
712
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
713 void FindIntegerProperty(const char* name,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
714 MP4Property** ppProperty, u_int32_t* pIndex = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
715 void FindFloatProperty(const char* name,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
716 MP4Property** ppProperty, u_int32_t* pIndex = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
717 void FindStringProperty(const char* name,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
718 MP4Property** ppProperty, u_int32_t* pIndex = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
719 void FindBytesProperty(const char* name,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
720 MP4Property** ppProperty, u_int32_t* pIndex = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
721
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
722 bool FindProperty(const char* name,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
723 MP4Property** ppProperty, u_int32_t* pIndex = NULL);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
724
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
725 MP4TrackId AddVideoTrackDefault(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
726 u_int32_t timeScale,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
727 MP4Duration sampleDuration,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
728 u_int16_t width,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
729 u_int16_t height,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
730 const char *videoType);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
731 MP4TrackId AddCntlTrackDefault(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
732 u_int32_t timeScale,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
733 MP4Duration sampleDuration,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
734 const char *videoType);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
735 void AddTrackToIod(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
736
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
737 void RemoveTrackFromIod(MP4TrackId trackId, bool shallHaveIods = true);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
738
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
739 void AddTrackToOd(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
740
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
741 void RemoveTrackFromOd(MP4TrackId trackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
742
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
743 void GetTrackReferenceProperties(const char* trefName,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
744 MP4Property** ppCountProperty, MP4Property** ppTrackIdProperty);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
745
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
746 void AddTrackReference(const char* trefName, MP4TrackId refTrackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
747
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
748 u_int32_t FindTrackReference(const char* trefName, MP4TrackId refTrackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
749
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
750 void RemoveTrackReference(const char* trefName, MP4TrackId refTrackId);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
751
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
752 void AddDataReference(MP4TrackId trackId, const char* url);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
753
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
754 char* MakeTrackName(MP4TrackId trackId, const char* name);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
755
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
756 u_int8_t ConvertTrackTypeToStreamType(const char* trackType);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
757
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
758 void CreateIsmaIodFromFile(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
759 MP4TrackId odTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
760 MP4TrackId sceneTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
761 MP4TrackId audioTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
762 MP4TrackId videoTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
763 u_int8_t** ppBytes,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
764 u_int64_t* pNumBytes);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
765
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
766 MP4Descriptor* CreateESD(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
767 MP4DescriptorProperty* pEsProperty,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
768 u_int32_t esid,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
769 u_int8_t objectType,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
770 u_int8_t streamType,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
771 u_int32_t bufferSize,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
772 u_int32_t bitrate,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
773 const u_int8_t* pConfig,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
774 u_int32_t configLength,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
775 char* url);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
776
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
777 void CreateIsmaODUpdateCommandFromFileForFile(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
778 MP4TrackId odTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
779 MP4TrackId audioTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
780 MP4TrackId videoTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
781 u_int8_t** ppBytes,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
782 u_int64_t* pNumBytes);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
783
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
784 void CreateIsmaODUpdateCommandFromFileForStream(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
785 MP4TrackId audioTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
786 MP4TrackId videoTrackId,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
787 u_int8_t** ppBytes,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
788 u_int64_t* pNumBytes);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
789
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
790 void CreateIsmaODUpdateCommandForStream(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
791 MP4DescriptorProperty* pAudioEsdProperty,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
792 MP4DescriptorProperty* pVideoEsdProperty,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
793 u_int8_t** ppBytes,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
794 u_int64_t* pNumBytes);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
795
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
796 void CreateIsmaSceneCommand(
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
797 bool hasAudio,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
798 bool hasVideo,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
799 u_int8_t** ppBytes,
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
800 u_int64_t* pNumBytes);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
801
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
802 protected:
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
803 char* m_fileName;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
804 FILE* m_pFile;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
805 u_int64_t m_orgFileSize;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
806 u_int64_t m_fileSize;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
807 MP4Atom* m_pRootAtom;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
808 MP4Integer32Array m_trakIds;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
809 MP4TrackArray m_pTracks;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
810 MP4TrackId m_odTrackId;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
811 u_int32_t m_verbosity;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
812 char m_mode;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
813 u_int32_t m_createFlags;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
814 bool m_useIsma;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
815
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
816 // cached properties
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
817 MP4IntegerProperty* m_pModificationProperty;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
818 MP4Integer32Property* m_pTimeScaleProperty;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
819 MP4IntegerProperty* m_pDurationProperty;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
820
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
821 // read/write in memory
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
822 u_int8_t* m_memoryBuffer;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
823 u_int64_t m_memoryBufferPosition;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
824 u_int64_t m_memoryBufferSize;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
825
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
826 // bit read/write buffering
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
827 u_int8_t m_numReadBits;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
828 u_int8_t m_bufReadBits;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
829 u_int8_t m_numWriteBits;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
830 u_int8_t m_bufWriteBits;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
831
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
832 #ifndef _WIN32
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
833 char m_tempFileName[64];
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
834 #else
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
835 char m_tempFileName[MAX_PATH + 3];
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
836 #endif
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
837 char m_trakName[1024];
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
838 char *m_editName;
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
839 };
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
840
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
841 #endif /* __MP4_FILE_INCLUDED__ */