• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 /*
19     This PVA_FF_Atom Class is the base class for all other Atoms in the MPEG-4 File
20     Format.
21 */
22 
23 
24 
25 #define IMPLEMENT_Atom
26 
27 #include "atom.h"
28 #include "atomutils.h"
29 
30 // Normal constructor
PVA_FF_Atom(uint32 type)31 PVA_FF_Atom::PVA_FF_Atom(uint32 type)
32 {
33     _type = type;
34     _pparent = NULL;
35 }
36 
37 // Destructor
~PVA_FF_Atom()38 PVA_FF_Atom::~PVA_FF_Atom()
39 {
40     // Empty
41 }
42 
43 bool
renderAtomBaseMembers(MP4_AUTHOR_FF_FILE_IO_WRAP * fp) const44 PVA_FF_Atom::renderAtomBaseMembers(MP4_AUTHOR_FF_FILE_IO_WRAP *fp) const
45 {
46     // Render PVA_FF_Atom size
47     if (!PVA_FF_AtomUtils::render32(fp, getSize()))
48     {
49         return false;
50     }
51 
52     // Render PVA_FF_Atom type (MOVIE_ATOM)
53     if (!PVA_FF_AtomUtils::render32(fp, getType()))
54     {
55         return false;
56     }
57     return true;
58 }
59 
60 
61 uint32
getDefaultSize() const62 PVA_FF_Atom::getDefaultSize() const
63 {
64     return DEFAULT_ATOM_SIZE;
65 }
66 
67 
68