1 diff -Naur mpeg4ip/bootstrap mpeg4ip-patched/bootstrap
2 --- mpeg4ip/bootstrap 2005-10-13 16:09:41.000000000 -0400
3 +++ mpeg4ip-patched/bootstrap 2008-01-17 12:05:42.000000000 -0500
6 if test $target_system = "Linux"; then
8 - if which faac >/dev/null 2>/dev/null; then
11 +# if which faac >/dev/null 2>/dev/null; then
15 if test $have_faac = "yes"; then
16 # we have lame and faac - see if faac is built with mp4 support
17 diff -Naur mpeg4ip/lib/mp4v2/Makefile.am mpeg4ip-patched/lib/mp4v2/Makefile.am
18 --- mpeg4ip/lib/mp4v2/Makefile.am 2005-03-10 13:31:34.000000000 -0500
19 +++ mpeg4ip-patched/lib/mp4v2/Makefile.am 2008-01-17 12:09:56.000000000 -0500
44 diff -Naur mpeg4ip/lib/mp4v2/Makefile.in mpeg4ip-patched/lib/mp4v2/Makefile.in
45 --- mpeg4ip/lib/mp4v2/Makefile.in 2005-05-18 18:03:05.000000000 -0400
46 +++ mpeg4ip-patched/lib/mp4v2/Makefile.in 2008-01-17 12:04:09.000000000 -0500
48 am_libmp4v2_la_OBJECTS = 3gp.lo atom_amr.lo atom_avc1.lo atom_avcC.lo \
49 atom_d263.lo atom_damr.lo atom_dref.lo atom_elst.lo \
50 atom_enca.lo atom_encv.lo atom_free.lo atom_ftyp.lo \
51 + atom_gmin.lo atom_text.lo \
52 atom_hdlr.lo atom_hinf.lo atom_hnti.lo atom_href.lo \
53 atom_mdat.lo atom_mdhd.lo atom_meta.lo atom_mp4a.lo \
54 atom_mp4s.lo atom_mp4v.lo atom_mvhd.lo atom_root.lo \
56 @AMDEP_TRUE@ ./$(DEPDIR)/atom_encv.Plo \
57 @AMDEP_TRUE@ ./$(DEPDIR)/atom_free.Plo \
58 @AMDEP_TRUE@ ./$(DEPDIR)/atom_ftyp.Plo \
59 +@AMDEP_TRUE@ ./$(DEPDIR)/atom_gmin.Plo \
60 @AMDEP_TRUE@ ./$(DEPDIR)/atom_hdlr.Plo \
61 @AMDEP_TRUE@ ./$(DEPDIR)/atom_hinf.Plo \
62 @AMDEP_TRUE@ ./$(DEPDIR)/atom_hnti.Plo \
64 @AMDEP_TRUE@ ./$(DEPDIR)/atom_stsc.Plo \
65 @AMDEP_TRUE@ ./$(DEPDIR)/atom_stsd.Plo \
66 @AMDEP_TRUE@ ./$(DEPDIR)/atom_stsz.Plo \
67 +@AMDEP_TRUE@ ./$(DEPDIR)/atom_text.Plo \
68 @AMDEP_TRUE@ ./$(DEPDIR)/atom_tfhd.Plo \
69 @AMDEP_TRUE@ ./$(DEPDIR)/atom_tkhd.Plo \
70 @AMDEP_TRUE@ ./$(DEPDIR)/atom_treftype.Plo \
88 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_encv.Plo@am__quote@
89 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_free.Plo@am__quote@
90 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_ftyp.Plo@am__quote@
91 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_gmin.Plo@am__quote@
92 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_hdlr.Plo@am__quote@
93 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_hinf.Plo@am__quote@
94 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_hnti.Plo@am__quote@
96 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stsc.Plo@am__quote@
97 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stsd.Plo@am__quote@
98 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stsz.Plo@am__quote@
99 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_text.Plo@am__quote@
100 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tfhd.Plo@am__quote@
101 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tkhd.Plo@am__quote@
102 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_treftype.Plo@am__quote@
103 diff -Naur mpeg4ip/lib/mp4v2/atom_avc1.cpp mpeg4ip-patched/lib/mp4v2/atom_avc1.cpp
104 --- mpeg4ip/lib/mp4v2/atom_avc1.cpp 2004-07-13 17:07:50.000000000 -0400
105 +++ mpeg4ip-patched/lib/mp4v2/atom_avc1.cpp 2008-01-17 12:07:00.000000000 -0500
107 MP4StringProperty* pProp =
108 new MP4StringProperty("compressorName");
109 pProp->SetFixedLength(32);
110 - pProp->SetValue("AVC Coding");
111 + pProp->SetValue("");
112 AddProperty(pProp); /* 6 */
114 AddReserved("reserved4", 4); /* 7 */
115 diff -Naur mpeg4ip/lib/mp4v2/atom_gmin.cpp mpeg4ip-patched/lib/mp4v2/atom_gmin.cpp
116 --- mpeg4ip/lib/mp4v2/atom_gmin.cpp 1969-12-31 19:00:00.000000000 -0500
117 +++ mpeg4ip-patched/lib/mp4v2/atom_gmin.cpp 2008-01-17 12:04:09.000000000 -0500
120 + * The contents of this file are subject to the Mozilla Public
121 + * License Version 1.1 (the "License"); you may not use this file
122 + * except in compliance with the License. You may obtain a copy of
123 + * the License at http://www.mozilla.org/MPL/
125 + * Software distributed under the License is distributed on an "AS
126 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
127 + * implied. See the License for the specific language governing
128 + * rights and limitations under the License.
130 + * The Original Code is MPEG4IP.
132 + * The Initial Developer of the Original Code is Cisco Systems Inc.
133 + * Portions created by Cisco Systems Inc. are
134 + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved.
137 + * Dave Mackie dmackie@cisco.com
140 +#include "mp4common.h"
142 +MP4GminAtom::MP4GminAtom()
146 + AddVersionAndFlags(); /* 0, 1 */
148 + AddProperty(new MP4Integer16Property("graphicsMode")); /* 2 */
149 + AddProperty(new MP4Integer16Property("opColorRed")); /* 3 */
150 + AddProperty(new MP4Integer16Property("opColorGreen")); /* 4 */
151 + AddProperty(new MP4Integer16Property("opColorBlue")); /* 5 */
152 + AddProperty(new MP4Integer16Property("balance")); /* 6 */
153 + AddReserved("reserved", 2); /* 7 */
157 +void MP4GminAtom::Generate()
160 + MP4Atom::Generate();
162 + ((MP4Integer16Property*)m_pProperties[2])->SetValue(0x0040);
163 + ((MP4Integer16Property*)m_pProperties[3])->SetValue(0x8000);
164 + ((MP4Integer16Property*)m_pProperties[4])->SetValue(0x8000);
165 + ((MP4Integer16Property*)m_pProperties[5])->SetValue(0x8000);
166 + ((MP4Integer16Property*)m_pProperties[6])->SetValue(0x0000);
170 diff -Naur mpeg4ip/lib/mp4v2/atom_mp4a.cpp mpeg4ip-patched/lib/mp4v2/atom_mp4a.cpp
171 --- mpeg4ip/lib/mp4v2/atom_mp4a.cpp 2001-10-02 17:15:39.000000000 -0400
172 +++ mpeg4ip-patched/lib/mp4v2/atom_mp4a.cpp 2008-01-17 12:04:09.000000000 -0500
175 new MP4Integer16Property("dataReferenceIndex"));
177 - AddReserved("reserved2", 16); /* 2 */
178 + /* patched by saintdev to allow us to set correct audio information */
179 +// AddReserved("reserved2", 16); /* 2 */
180 + AddProperty( /* 2 */
181 + new MP4BytesProperty("reserved2", 16));
184 new MP4Integer16Property("timeScale"));
186 m_pProperties[2]->SetReadOnly(false);
187 ((MP4BytesProperty*)m_pProperties[2])->
188 SetValue(reserved2, sizeof(reserved2));
189 - m_pProperties[2]->SetReadOnly(true);
190 + /* patched by saintdev to allow us to set correct audio information */
191 +// m_pProperties[2]->SetReadOnly(true);
193 diff -Naur mpeg4ip/lib/mp4v2/atom_standard.cpp mpeg4ip-patched/lib/mp4v2/atom_standard.cpp
194 --- mpeg4ip/lib/mp4v2/atom_standard.cpp 2004-12-14 16:35:35.000000000 -0500
195 +++ mpeg4ip-patched/lib/mp4v2/atom_standard.cpp 2008-01-17 12:04:09.000000000 -0500
200 + } else if (ATOMID(type) == ATOMID("gmhd")) {
201 + ExpectChildAtom("gmin", Required, OnlyOne);
202 + ExpectChildAtom("tmcd", Optional, OnlyOne);
203 + ExpectChildAtom("text", Optional, OnlyOne);
205 } else if (ATOMID(type) == ATOMID("gnre")) { // Apple iTunes
206 ExpectChildAtom("data", Optional, OnlyOne);
209 ExpectChildAtom("smhd", Optional, OnlyOne);
210 ExpectChildAtom("hmhd", Optional, OnlyOne);
211 ExpectChildAtom("nmhd", Optional, OnlyOne);
212 + ExpectChildAtom("gmhd", Optional, OnlyOne);
213 ExpectChildAtom("dinf", Required, OnlyOne);
214 ExpectChildAtom("stbl", Required, OnlyOne);
217 ExpectChildAtom("ipir", Optional, OnlyOne);
218 ExpectChildAtom("mpod", Optional, OnlyOne);
219 ExpectChildAtom("sync", Optional, OnlyOne);
220 + ExpectChildAtom("chap", Optional, OnlyOne);
222 } else if (ATOMID(type) == ATOMID("trex")) {
223 AddVersionAndFlags(); /* 0, 1 */
224 diff -Naur mpeg4ip/lib/mp4v2/atom_stsd.cpp mpeg4ip-patched/lib/mp4v2/atom_stsd.cpp
225 --- mpeg4ip/lib/mp4v2/atom_stsd.cpp 2004-07-13 17:07:50.000000000 -0400
226 +++ mpeg4ip-patched/lib/mp4v2/atom_stsd.cpp 2008-01-17 12:07:00.000000000 -0500
228 ExpectChildAtom("sawb", Optional, Many); // For AMR-WB
229 ExpectChildAtom("s263", Optional, Many); // For H.263
230 ExpectChildAtom("avc1", Optional, Many);
231 + ExpectChildAtom("text", Optional, Many);
232 + ExpectChildAtom("pasp", Optional, Many);
235 void MP4StsdAtom::Read()
236 diff -Naur mpeg4ip/lib/mp4v2/atom_text.cpp mpeg4ip-patched/lib/mp4v2/atom_text.cpp
237 --- mpeg4ip/lib/mp4v2/atom_text.cpp 1969-12-31 19:00:00.000000000 -0500
238 +++ mpeg4ip-patched/lib/mp4v2/atom_text.cpp 2008-01-17 12:04:09.000000000 -0500
241 + * The contents of this file are subject to the Mozilla Public
242 + * License Version 1.1 (the "License"); you may not use this file
243 + * except in compliance with the License. You may obtain a copy of
244 + * the License at http://www.mozilla.org/MPL/
246 + * Software distributed under the License is distributed on an "AS
247 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
248 + * implied. See the License for the specific language governing
249 + * rights and limitations under the License.
251 + * The Original Code is MPEG4IP.
253 + * The Initial Developer of the Original Code is Cisco Systems Inc.
254 + * Portions created by Cisco Systems Inc. are
255 + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved.
258 + * Dave Mackie dmackie@cisco.com
261 +#include "mp4common.h"
263 +MP4TextAtom::MP4TextAtom()
266 + // The atom type "text" is used in two complete unrelated ways
267 + // i.e. it's real two atoms with the same name
268 + // To handle that we need to postpone property creation until
269 + // we know who our parent atom is (stsd or gmhd) which gives us
270 + // the context info we need to know who we are
273 +void MP4TextAtom::AddPropertiesStsdType()
276 + AddReserved("reserved1", 6); /* 0 */
278 + AddProperty(new MP4Integer16Property("dataReferenceIndex"));/* 1 */
280 + AddProperty(new MP4Integer32Property("displayFlags")); /* 2 */
281 + AddProperty(new MP4Integer32Property("textJustification")); /* 3 */
283 + AddProperty(new MP4Integer16Property("bgColorRed")); /* 4 */
284 + AddProperty(new MP4Integer16Property("bgColorGreen")); /* 5 */
285 + AddProperty(new MP4Integer16Property("bgColorBlue")); /* 6 */
287 + AddProperty(new MP4Integer16Property("defTextBoxTop")); /* 7 */
288 + AddProperty(new MP4Integer16Property("defTextBoxLeft")); /* 8 */
289 + AddProperty(new MP4Integer16Property("defTextBoxBottom")); /* 9 */
290 + AddProperty(new MP4Integer16Property("defTextBoxRight")); /* 10 */
292 + AddReserved("reserved2", 8); /* 11 */
294 + AddProperty(new MP4Integer16Property("fontNumber")); /* 12 */
295 + AddProperty(new MP4Integer16Property("fontFace")); /* 13 */
297 + AddReserved("reserved3", 1); /* 14 */
298 + AddReserved("reserved4", 2); /* 15 */
300 + AddProperty(new MP4Integer16Property("foreColorRed")); /* 16 */
301 + AddProperty(new MP4Integer16Property("foreColorGreen")); /* 17 */
302 + AddProperty(new MP4Integer16Property("foreColorBlue")); /* 18 */
306 +void MP4TextAtom::AddPropertiesGmhdType()
309 + AddProperty(new MP4BytesProperty("textData", 36)); /* 0 */
314 +void MP4TextAtom::Generate()
317 + if (!strcmp(m_pParentAtom->GetType(), "stsd")) {
318 + AddPropertiesStsdType();
319 + GenerateStsdType();
320 + } else if (!strcmp(m_pParentAtom->GetType(), "gmhd")) {
321 + AddPropertiesGmhdType();
322 + GenerateGmhdType();
324 + VERBOSE_WARNING(m_pFile->GetVerbosity(),
325 + printf("Warning: text atom in unexpected context, can not generate"));
330 +void MP4TextAtom::GenerateStsdType()
332 + // generate children
333 + MP4Atom::Generate();
335 + ((MP4Integer16Property*)m_pProperties[1])->SetValue(1);
337 + ((MP4Integer32Property*)m_pProperties[2])->SetValue(1);
338 + ((MP4Integer32Property*)m_pProperties[3])->SetValue(1);
342 +void MP4TextAtom::GenerateGmhdType()
344 + MP4Atom::Generate();
346 + // property 0 has non-zero fixed values
347 + static u_int8_t textData[36] = {
367 + ((MP4BytesProperty*)m_pProperties[0])->SetValue(textData, sizeof(textData));
372 diff -Naur mpeg4ip/lib/mp4v2/atom_tkhd.cpp mpeg4ip-patched/lib/mp4v2/atom_tkhd.cpp
373 --- mpeg4ip/lib/mp4v2/atom_tkhd.cpp 2003-11-20 00:46:11.000000000 +0100
374 +++ mpeg4ip/lib/mp4v2/atom_tkhd.cpp 2008-01-19 12:41:13.000000000 +0100
376 new MP4Integer32Property("duration"));
379 - AddReserved("reserved2", 12); /* 7 */
381 + AddReserved("reserved2", 8); /* 7 */
383 + AddProperty( /* 8 */
384 + new MP4Integer16Property("layer"));
385 + AddProperty( /* 9 */
386 + new MP4Integer16Property("alternate_group"));
388 MP4Float32Property* pProp;
390 pProp = new MP4Float32Property("volume");
391 pProp->SetFixed16Format();
392 - AddProperty(pProp); /* 8 */
393 + AddProperty(pProp); /* 10 */
395 - AddReserved("reserved3", 38); /* 9 */
396 + /* patched by maurj to enable us to set the matrix for anamorphic display */
397 + AddProperty(new MP4BytesProperty("reserved3", 38)); /* 11 */
399 pProp = new MP4Float32Property("width");
400 pProp->SetFixed32Format();
401 - AddProperty(pProp); /* 10 */
402 + AddProperty(pProp); /* 12 */
404 pProp = new MP4Float32Property("height");
405 pProp->SetFixed32Format();
406 - AddProperty(pProp); /* 11 */
407 + AddProperty(pProp); /* 13 */
410 void MP4TkhdAtom::Generate()
411 @@ -103,10 +109,11 @@
412 0x00, 0x00, 0x00, 0x00,
413 0x40, 0x00, 0x00, 0x00,
415 - m_pProperties[9]->SetReadOnly(false);
416 - ((MP4BytesProperty*)m_pProperties[9])->
417 + m_pProperties[11]->SetReadOnly(false);
418 + ((MP4BytesProperty*)m_pProperties[11])->
419 SetValue(reserved3, sizeof(reserved3));
420 - m_pProperties[9]->SetReadOnly(true);
421 + /* patched by maurj to enable us to set the matrix for anamorphic display */
422 + /* m_pProperties[9]->SetReadOnly(true);*/
425 void MP4TkhdAtom::Read()
426 diff -Naur mpeg4ip/lib/mp4v2/atoms.h mpeg4ip-patched/lib/mp4v2/atoms.h
427 --- mpeg4ip/lib/mp4v2/atoms.h 2005-03-10 13:31:34.000000000 -0500
428 +++ mpeg4ip-patched/lib/mp4v2/atoms.h 2008-01-17 12:07:00.000000000 -0500
433 +class MP4GminAtom : public MP4Atom {
439 class MP4HdlrAtom : public MP4Atom {
446 +class MP4TextAtom : public MP4Atom {
452 + void AddPropertiesStsdType();
453 + void AddPropertiesGmhdType();
455 + void GenerateStsdType();
456 + void GenerateGmhdType();
459 class MP4TfhdAtom : public MP4Atom {
466 +class MP4PaspAtom : public MP4Atom {
472 #endif /* __MP4_ATOMS_INCLUDED__ */
473 diff -Naur mpeg4ip/lib/mp4v2/libmp4v260.dsp mpeg4ip-patched/lib/mp4v2/libmp4v260.dsp
474 --- mpeg4ip/lib/mp4v2/libmp4v260.dsp 2005-03-24 17:14:52.000000000 -0500
475 +++ mpeg4ip-patched/lib/mp4v2/libmp4v260.dsp 2008-01-17 12:07:00.000000000 -0500
480 +SOURCE=.\atom_gmin.cpp
484 SOURCE=.\atom_hdlr.cpp
491 +SOURCE=.\atom_pasp.cpp
495 SOURCE=.\atom_root.cpp
502 +SOURCE=.\atom_text.cpp
506 SOURCE=.\atom_udta.cpp
509 diff -Naur mpeg4ip/lib/mp4v2/libmp4v2_st60.dsp mpeg4ip-patched/lib/mp4v2/libmp4v2_st60.dsp
510 --- mpeg4ip/lib/mp4v2/libmp4v2_st60.dsp 2005-03-24 17:14:52.000000000 -0500
511 +++ mpeg4ip-patched/lib/mp4v2/libmp4v2_st60.dsp 2008-01-17 12:04:09.000000000 -0500
516 +SOURCE=.\atom_gmin.cpp
520 SOURCE=.\atom_hdlr.cpp
527 +SOURCE=.\atom_text.cpp
531 SOURCE=.\atom_udta.cpp
534 diff -Naur mpeg4ip/lib/mp4v2/mp4.cpp mpeg4ip-patched/lib/mp4v2/mp4.cpp
535 --- mpeg4ip/lib/mp4v2/mp4.cpp 2005-03-30 13:41:58.000000000 -0500
536 +++ mpeg4ip-patched/lib/mp4v2/mp4.cpp 2008-01-17 12:07:00.000000000 -0500
538 return MP4_INVALID_TRACK_ID;
541 +extern "C" MP4TrackId MP4AddTextTrack(
542 + MP4FileHandle hFile, MP4TrackId refTrackId)
544 + if (MP4_IS_VALID_FILE_HANDLE(hFile)) {
546 + return ((MP4File*)hFile)->AddTextTrack(refTrackId);
548 + catch (MP4Error* e) {
553 + return MP4_INVALID_TRACK_ID;
556 +extern "C" MP4TrackId MP4AddChapterTextTrack(
557 + MP4FileHandle hFile, MP4TrackId refTrackId)
559 + if (MP4_IS_VALID_FILE_HANDLE(hFile)) {
561 + return ((MP4File*)hFile)->AddChapterTextTrack(refTrackId);
563 + catch (MP4Error* e) {
568 + return MP4_INVALID_TRACK_ID;
571 +extern "C" MP4TrackId MP4AddPixelAspectRatio(
572 + MP4FileHandle hFile, MP4TrackId refTrackId, u_int32_t hSpacing, u_int32_t vSpacing)
574 + if (MP4_IS_VALID_FILE_HANDLE(hFile)) {
576 + return ((MP4File*)hFile)->AddPixelAspectRatio(refTrackId, hSpacing, vSpacing);
578 + catch (MP4Error* e) {
583 + return MP4_INVALID_TRACK_ID;
587 extern "C" MP4TrackId MP4CloneTrack(
588 MP4FileHandle srcFile,
589 MP4TrackId srcTrackId,
590 diff -Naur mpeg4ip/lib/mp4v2/mp4.h mpeg4ip-patched/lib/mp4v2/mp4.h
591 --- mpeg4ip/lib/mp4v2/mp4.h 2005-03-30 13:41:58.000000000 -0500
592 +++ mpeg4ip-patched/lib/mp4v2/mp4.h 2008-01-17 12:07:00.000000000 -0500
594 #define MP4_VIDEO_TRACK_TYPE "vide"
595 #define MP4_HINT_TRACK_TYPE "hint"
596 #define MP4_CNTL_TRACK_TYPE "cntl"
597 +#define MP4_TEXT_TRACK_TYPE "text"
599 * This second set of track types should be created
600 * via MP4AddSystemsTrack(type)
603 MP4TrackId refTrackId);
605 +MP4TrackId MP4AddTextTrack(
606 + MP4FileHandle hFile,
607 + MP4TrackId refTrackId);
609 +MP4TrackId MP4AddChapterTextTrack(
610 + MP4FileHandle hFile,
611 + MP4TrackId refTrackId);
613 +MP4TrackId MP4AddPixelAspectRatio(
614 + MP4FileHandle hFile,
615 + MP4TrackId refTrackId,
616 + u_int32_t hSpacing,
617 + u_int32_t vSpacing);
619 MP4TrackId MP4CloneTrack(
620 MP4FileHandle srcFile,
621 MP4TrackId srcTrackId,
622 diff -Naur mpeg4ip/lib/mp4v2/mp4atom.cpp mpeg4ip-patched/lib/mp4v2/mp4atom.cpp
623 --- mpeg4ip/lib/mp4v2/mp4atom.cpp 2005-03-10 13:31:34.000000000 -0500
624 +++ mpeg4ip-patched/lib/mp4v2/mp4atom.cpp 2008-01-17 12:11:40.000000000 -0500
626 pAtom = new MP4SoundAtom("alaw");
631 + if (ATOMID(type) == ATOMID("chap")) {
632 + pAtom = new MP4TrefTypeAtom(type);
637 if (ATOMID(type) == ATOMID("d263")) {
638 pAtom = new MP4D263Atom();
640 pAtom = new MP4FtypAtom();
644 + if (ATOMID(type) == ATOMID("gmin")) {
645 + pAtom = new MP4GminAtom();
649 if (ATOMID(type) == ATOMID("hdlr")) {
650 pAtom = new MP4HdlrAtom();
655 - if (ATOMID(type) == ATOMID("tkhd")) {
656 + if (ATOMID(type) == ATOMID("text")) {
657 + pAtom = new MP4TextAtom();
658 + } else if (ATOMID(type) == ATOMID("tkhd")) {
659 pAtom = new MP4TkhdAtom();
660 } else if (ATOMID(type) == ATOMID("tfhd")) {
661 pAtom = new MP4TfhdAtom();
663 pAtom = new MP4SmiAtom();
667 + if (ATOMID(type) == ATOMID("pasp")) {
668 + pAtom = new MP4PaspAtom();
675 diff -Naur mpeg4ip/lib/mp4v2/mp4file.cpp mpeg4ip-patched/lib/mp4v2/mp4file.cpp
676 --- mpeg4ip/lib/mp4v2/mp4file.cpp 2005-03-30 13:41:58.000000000 -0500
677 +++ mpeg4ip-patched/lib/mp4v2/mp4file.cpp 2008-01-17 12:07:00.000000000 -0500
678 @@ -1869,6 +1869,81 @@
682 +MP4TrackId MP4File::AddTextTrack(MP4TrackId refTrackId)
684 + // validate reference track id
685 + FindTrackIndex(refTrackId);
687 + MP4TrackId trackId =
688 + AddTrack(MP4_TEXT_TRACK_TYPE, GetTrackTimeScale(refTrackId));
690 + InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "gmhd", 0);
692 + AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "text");
694 + // stsd is a unique beast in that it has a count of the number
695 + // of child atoms that needs to be incremented after we add the text atom
696 + MP4Integer32Property* pStsdCountProperty;
697 + FindIntegerProperty(
698 + MakeTrackName(trackId, "mdia.minf.stbl.stsd.entryCount"),
699 + (MP4Property**)&pStsdCountProperty);
700 + pStsdCountProperty->IncrementValue();
705 +MP4TrackId MP4File::AddChapterTextTrack(MP4TrackId refTrackId)
707 + // validate reference track id
708 + FindTrackIndex(refTrackId);
710 + MP4TrackId trackId =
711 + AddTrack(MP4_TEXT_TRACK_TYPE, GetTrackTimeScale(refTrackId));
713 + InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "gmhd", 0);
715 + AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "text");
717 + // stsd is a unique beast in that it has a count of the number
718 + // of child atoms that needs to be incremented after we add the text atom
719 + MP4Integer32Property* pStsdCountProperty;
720 + FindIntegerProperty(
721 + MakeTrackName(trackId, "mdia.minf.stbl.stsd.entryCount"),
722 + (MP4Property**)&pStsdCountProperty);
723 + pStsdCountProperty->IncrementValue();
725 + /* add the magic "text" atom to the generic media header */
726 + AddChildAtom(MakeTrackName(trackId, "mdia.minf.gmhd"), "text");
728 + AddDescendantAtoms(MakeTrackName(refTrackId, NULL), "tref.chap");
730 + AddTrackReference(MakeTrackName(refTrackId, "tref.chap"), trackId);
735 +MP4TrackId MP4File::AddPixelAspectRatio(MP4TrackId trackId, u_int32_t hSpacing, u_int32_t vSpacing)
737 + // validate reference track id
738 + (void)FindTrackIndex(trackId);
739 + const char *format = GetTrackMediaDataName (trackId);
741 + if (!strcasecmp(format, "avc1"))
743 + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.avc1"), "pasp");
744 + SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.avc1.pasp.hSpacing", hSpacing);
745 + SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.avc1.pasp.vSpacing", vSpacing);
747 + else if (!strcasecmp(format, "mp4v"))
749 + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.mp4v"), "pasp");
750 + SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.mp4v.pasp.hSpacing", hSpacing);
751 + SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.mp4v.pasp.vSpacing", vSpacing);
757 void MP4File::DeleteTrack(MP4TrackId trackId)
759 ProtectWriteOperation("MP4DeleteTrack");
760 diff -Naur mpeg4ip/lib/mp4v2/mp4file.h mpeg4ip-patched/lib/mp4v2/mp4file.h
761 --- mpeg4ip/lib/mp4v2/mp4file.h 2005-03-30 13:41:58.000000000 -0500
762 +++ mpeg4ip-patched/lib/mp4v2/mp4file.h 2008-01-17 12:07:00.000000000 -0500
764 const uint8_t *pPicture,
765 uint16_t pictureLen);
766 MP4TrackId AddHintTrack(MP4TrackId refTrackId);
767 + MP4TrackId AddTextTrack(MP4TrackId refTrackId);
768 + MP4TrackId AddChapterTextTrack(MP4TrackId refTrackId);
770 + MP4TrackId AddPixelAspectRatio(MP4TrackId trackId, u_int32_t hSpacing, u_int32_t vSpacing);
772 MP4SampleId GetTrackNumberOfSamples(MP4TrackId trackId);
774 diff -Naur mpeg4ip/lib/mp4v2/atom_pasp.cpp mpeg4ip-patched/lib/mp4v2/atom_pasp.cpp
775 --- mpeg4ip/lib/mp4v2/atom_pasp.cpp 1969-12-31 19:00:00.000000000 -0500
776 +++ mpeg4ip-patched/lib/mp4v2/atom_pasp.cpp 2008-01-17 12:07:00.000000000 -0500
779 + * The contents of this file are subject to the Mozilla Public
780 + * License Version 1.1 (the "License"); you may not use this file
781 + * except in compliance with the License. You may obtain a copy of
782 + * the License at http://www.mozilla.org/MPL/
784 + * Software distributed under the License is distributed on an "AS
785 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
786 + * implied. See the License for the specific language governing
787 + * rights and limitations under the License.
789 + * The Original Code is MPEG4IP.
791 + * Contributer has declined to give copyright information, and gives
792 + * it freely to the world.
797 +#include "mp4common.h"
799 +MP4PaspAtom::MP4PaspAtom()
803 + AddProperty( /* 0 */
804 + new MP4Integer32Property("hSpacing"));
806 + AddProperty( /* 1 */
807 + new MP4Integer32Property("vSpacing"));
811 +void MP4PaspAtom::Generate()
814 + MP4Atom::Generate();
816 + ((MP4Integer32Property*)m_pProperties[0])->SetValue(1);
817 + ((MP4Integer32Property*)m_pProperties[1])->SetValue(1);
820 diff -Naur mpeg4ip-patched/lib/mp4v2/Makefile.in mpeg4ip/lib/mp4v2/Makefile.in
821 --- mpeg4ip-patched/lib/mp4v2/Makefile.in 2008-01-17 12:04:09.000000000 -0500
822 +++ mpeg4ip/lib/mp4v2/Makefile.in 2008-01-17 13:20:50.000000000 -0500
824 atom_gmin.lo atom_text.lo \
825 atom_hdlr.lo atom_hinf.lo atom_hnti.lo atom_href.lo \
826 atom_mdat.lo atom_mdhd.lo atom_meta.lo atom_mp4a.lo \
827 - atom_mp4s.lo atom_mp4v.lo atom_mvhd.lo atom_root.lo \
828 + atom_mp4s.lo atom_mp4v.lo atom_mvhd.lo atom_pasp.lo atom_root.lo \
829 atom_rtp.lo atom_s263.lo atom_sdp.lo atom_smi.lo atom_sound.lo \
830 atom_standard.lo atom_stbl.lo atom_stdp.lo atom_stsc.lo \
831 atom_stsd.lo atom_stsz.lo atom_tfhd.lo atom_tkhd.lo \
833 @AMDEP_TRUE@ ./$(DEPDIR)/atom_mp4v.Plo \
834 @AMDEP_TRUE@ ./$(DEPDIR)/atom_mvhd.Plo \
835 @AMDEP_TRUE@ ./$(DEPDIR)/atom_root.Plo ./$(DEPDIR)/atom_rtp.Plo \
836 +@AMDEP_TRUE@ ./$(DEPDIR)/atom_pasp.Plo \
837 @AMDEP_TRUE@ ./$(DEPDIR)/atom_s263.Plo ./$(DEPDIR)/atom_sdp.Plo \
838 @AMDEP_TRUE@ ./$(DEPDIR)/atom_smi.Plo \
839 @AMDEP_TRUE@ ./$(DEPDIR)/atom_sound.Plo \
849 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mp4s.Plo@am__quote@
850 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mp4v.Plo@am__quote@
851 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mvhd.Plo@am__quote@
852 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_pasp.Plo@am__quote@
853 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_root.Plo@am__quote@
854 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_rtp.Plo@am__quote@
855 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_s263.Plo@am__quote@