annotate Input/aac/libmp4v2/atom_dref.cpp @ 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. All Rights Reserved.
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
17 *
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
18 * Contributor(s):
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
19 * Dave Mackie dmackie@cisco.com
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
20 */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
21
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
22 #include "mp4common.h"
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
23
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
24 MP4DrefAtom::MP4DrefAtom()
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
25 : MP4Atom("dref")
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
26 {
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
27 AddVersionAndFlags();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
28
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
29 MP4Integer32Property* pCount =
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
30 new MP4Integer32Property("entryCount");
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
31 pCount->SetReadOnly();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
32 AddProperty(pCount);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
33
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
34 ExpectChildAtom("url ", Optional, Many);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
35 ExpectChildAtom("urn ", Optional, Many);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
36 ExpectChildAtom("alis", Optional, Many);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
37 }
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
38
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
39 void MP4DrefAtom::Read()
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
40 {
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
41 /* do the usual read */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
42 MP4Atom::Read();
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
43
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
44 // check that number of children == entryCount
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
45 MP4Integer32Property* pCount =
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
46 (MP4Integer32Property*)m_pProperties[2];
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
47
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
48 if (m_pChildAtoms.Size() != pCount->GetValue()) {
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
49 VERBOSE_READ(GetVerbosity(),
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
50 MP4Printf("Warning: dref inconsistency with number of entries"));
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
51
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
52 /* fix it */
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
53 pCount->SetReadOnly(false);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
54 pCount->SetValue(m_pChildAtoms.Size());
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
55 pCount->SetReadOnly(true);
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
56 }
6a86fdd4dea4 [svn] Replacement libmp4v2.
nenolod
parents:
diff changeset
57 }