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/*     -------------------------------------------------------------------       */
20/*                         MPEG-4 MovieHeaderAtom Class                          */
21/*     -------------------------------------------------------------------       */
22/*********************************************************************************/
23/*
24    This MovieHeaderAtom Class defines the overall media-independent information
25    relevant to the MPEG-4 presentation as a whole.
26*/
27
28
29#ifndef MOVIEHEADERATOM_H_INCLUDED
30#define MOVIEHEADERATOM_H_INCLUDED
31
32#ifndef OSCL_FILE_IO_H_INCLUDED
33#include "oscl_file_io.h"
34#endif
35
36#ifndef FULLATOM_H_INCLUDED
37#include "fullatom.h"
38#endif
39
40class MovieHeaderAtom : public FullAtom
41{
42
43    public:
44        MovieHeaderAtom(MP4_FF_FILE *fp, uint32 size, uint32 type);
45        virtual ~MovieHeaderAtom();
46
47        // Creation Time gets  - may not need to have the set method public!
48        uint64 getCreationTime() const
49        {
50            if (getVersion() == 1)
51                return _creationTime64;
52            else
53                return _creationTime;
54
55        }
56
57        // Modification Time gets - may not need to have the set method public!
58        uint64 getModificationTime() const
59        {
60            if (getVersion() == 1)
61                return _modificationTime64;
62            else
63                return _modificationTime;
64        }
65
66        // Time Scale gets
67        uint32 getTimeScale() const
68        {
69            return _timeScale;
70        }
71
72        // Duration gets
73        uint64 getDuration() const
74        {
75            if (getVersion() == 1)
76                return _duration64;
77            else
78                return _duration;
79        }
80
81        // NextTrackID gets
82        uint32 getNextTrackID() const
83        {
84            return _nextTrackID;
85        }
86
87        OSCL_wHeapString<OsclMemAllocator> getCreationDate()
88        {
89            return (convertTimeToDate(_creationTime));
90        }
91
92    private:
93
94        OSCL_wHeapString<OsclMemAllocator> convertTimeToDate(uint32 time);
95
96        uint32 _creationTime; // 4/8 (32/64bits) -- Will templatize later - using 32bits (version 0) for now
97        uint64 _creationTime64;
98
99        uint32 _modificationTime; // 4/8 (32/64bits) -- Will templatize later - using 32bits for now
100        uint64 _modificationTime64;
101
102        uint32 _timeScale; // 4 (32bits)
103
104        uint32 _duration; // 4/8 (32/64bits) -- Will templatize later - using 32bits for now
105        uint64 _duration64;
106
107        uint32 _nextTrackID; // 4 (32 bits)
108
109};
110
111#endif  // MOVIEHEADERATOM_H_INCLUDED
112
113
114