• 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_MovieHeaderAtom Class defines the overall media-independent information
20     relevant to the MPEG-4 presentation as a whole.
21 */
22 
23 
24 #ifndef __MovieHeaderAtom_H__
25 #define __MovieHeaderAtom_H__
26 
27 #include "fullatom.h"
28 #include "pv_mp4ffcomposer_config.h"
29 
30 class PVA_FF_MovieHeaderAtom : public PVA_FF_FullAtom
31 {
32 
33     public:
34         PVA_FF_MovieHeaderAtom(uint8 version, uint32 flags, uint32 fileAuthoringFlags); // Constructor
35         virtual ~PVA_FF_MovieHeaderAtom();
36 
37         // Creation Time gets and sets - may not need to have the set method public!
setCreationTime(uint32 ct)38         void setCreationTime(uint32 ct)
39         {
40             _creationTime = ct;
41         }
getCreationTime()42         uint32 getCreationTime() const
43         {
44             return _creationTime;
45         }
46 
47         // Modification Time gets and sets - may not need to have the set method public!
setModificationTime(uint32 mt)48         void setModificationTime(uint32 mt)
49         {
50             _modificationTime = mt;
51         }
getModificationTime()52         uint32 getModificationTime() const
53         {
54             return _modificationTime;
55         }
56 
57         // Time Scale gets and sets
setTimeScale(uint32 ts)58         void setTimeScale(uint32 ts)
59         {
60             _timeScale = ts;
61         }
getTimeScale()62         uint32 getTimeScale() const
63         {
64             return _timeScale;
65         }
66 
67         // Duration gets and sets
setDuration(uint32 d)68         void setDuration(uint32 d)
69         {
70             if (d > _duration)
71             {
72                 _duration = d;
73             }
74         }
75 
getDuration()76         uint32 getDuration() const
77         {
78             return _duration;
79         }
getLastTS()80         uint32 getLastTS()  const
81         {
82             return _prevTS;
83         }
84 
85         void addSample(uint32 ts); // Informs that another sample was added at time ts
86 
87         // TrackID
88         uint32 getNextTrackID() const;
89         uint32 findNextTrackID();
90 
91         virtual void recomputeSize();
92 
93         // Sets the time value to the current time in seconds since 1970 - Need to FIX to 1904
94         void setTime(uint32 &val);
95 
96         // Rendering the PVA_FF_Atom in proper format (bitlengths, etc.) to an ostream.
97         virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp);
98 
99     private:
100 
101         uint32 _creationTime; // 4/8 (32/64bits) -- Will templatize later - using 32bits (version 0) for now
102         uint32 _modificationTime; // 4/8 (32/64bits) -- Will templatize later - using 32bits for now
103         uint32 _timeScale; // 4 (32bits)
104         uint32 _duration; // 4/8 (32/64bits) -- Will templatize later - using 32bits for now
105 
106         uint32 _nextTrackID; // 4 (32 bits)
107 
108         uint32 _prevTS;
109         uint32 _deltaTS;
110 
111 };
112 
113 
114 
115 #endif
116 
117