annotate Plugins/Input/aac/libmp4v2/atom_stsd.cpp @ 184:740c072f8e23 trunk

[svn] List sndfile extensions in the plugin configuration table.
author chainsaw
date Sun, 13 Nov 2005 14:27:07 -0800
parents fa848bd484d8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
2 * The contents of this file are subject to the Mozilla Public
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
3 * License Version 1.1 (the "License"); you may not use this file
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
4 * except in compliance with the License. You may obtain a copy of
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
5 * the License at http://www.mozilla.org/MPL/
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
6 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
7 * Software distributed under the License is distributed on an "AS
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
9 * implied. See the License for the specific language governing
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
10 * rights and limitations under the License.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
11 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
12 * The Original Code is MPEG4IP.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
13 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
14 * The Initial Developer of the Original Code is Cisco Systems Inc.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
15 * Portions created by Cisco Systems Inc. are
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
16 * Copyright (C) Cisco Systems Inc. 2001 - 2004. All Rights Reserved.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
17 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
18 * 3GPP features implementation is based on 3GPP's TS26.234-v5.60,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
19 * and was contributed by Ximpo Group Ltd.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
20 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
21 * Portions created by Ximpo Group Ltd. are
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
22 * Copyright (C) Ximpo Group Ltd. 2003, 2004. All Rights Reserved.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
23 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
24 * Contributor(s):
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
25 * Dave Mackie dmackie@cisco.com
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
26 * Alix Marchandise-Franquet alix@cisco.com
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
27 * Ximpo Group Ltd. mp4v2@ximpo.com
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
28 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
29
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
30 #include "mp4common.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
31
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
32 MP4StsdAtom::MP4StsdAtom()
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
33 : MP4Atom("stsd")
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
34 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
35 AddVersionAndFlags();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
36
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
37 MP4Integer32Property* pCount =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
38 new MP4Integer32Property("entryCount");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
39 pCount->SetReadOnly();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
40 AddProperty(pCount);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
41
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
42 ExpectChildAtom("mp4a", Optional, Many);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
43 ExpectChildAtom("enca", Optional, Many);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
44 ExpectChildAtom("mp4s", Optional, Many);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
45 ExpectChildAtom("mp4v", Optional, Many);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
46 ExpectChildAtom("encv", Optional, Many);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
47 ExpectChildAtom("rtp ", Optional, Many);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
48 ExpectChildAtom("samr", Optional, Many); // For AMR-NB
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
49 ExpectChildAtom("sawb", Optional, Many); // For AMR-WB
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
50 ExpectChildAtom("s263", Optional, Many); // For H.263
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
51 ExpectChildAtom("avc1", Optional, Many);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
52 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
53
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
54 void MP4StsdAtom::Read()
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
55 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
56 /* do the usual read */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
57 MP4Atom::Read();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
58
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
59 // check that number of children == entryCount
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
60 MP4Integer32Property* pCount =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
61 (MP4Integer32Property*)m_pProperties[2];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
62
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
63 if (m_pChildAtoms.Size() != pCount->GetValue()) {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
64 VERBOSE_READ(GetVerbosity(),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
65 printf("Warning: stsd inconsistency with number of entries"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
66
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
67 /* fix it */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
68 pCount->SetReadOnly(false);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
69 pCount->SetValue(m_pChildAtoms.Size());
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
70 pCount->SetReadOnly(true);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
71 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
72 }