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 Mpeg4MediaHeaderAtom Class */
21 /* ------------------------------------------------------------------- */
22 /*********************************************************************************/
23 /*
24 This Mpeg4MediaHeaderAtom Class is for streams other than visual and audio.
25 */
26
27 #define IMPLEMENT_Mpeg4MediaHeaderAtom
28
29 #include "mpeg4mediaheaderatom.h"
30 #include "atomdefs.h"
31 #include "atomutils.h"
32
33 // Stream-in ctor
Mpeg4MediaHeaderAtom(MP4_FF_FILE * fp,uint32 mediaType,uint32 size,uint32 type)34 Mpeg4MediaHeaderAtom::Mpeg4MediaHeaderAtom(MP4_FF_FILE *fp,
35 uint32 mediaType,
36 uint32 size,
37 uint32 type)
38 : MediaInformationHeaderAtom(fp, size, type)
39 {
40 if (_success)
41 {
42 _mediaType = mediaType;
43 }
44 else
45 {
46 if (_mp4ErrorCode != ATOM_VERSION_NOT_SUPPORTED)
47 _mp4ErrorCode = READ_MPEG4_MEDIA_HEADER_ATOM_FAILED;
48 }
49 }
50
51 // Destructor
~Mpeg4MediaHeaderAtom()52 Mpeg4MediaHeaderAtom::~Mpeg4MediaHeaderAtom()
53 {
54 // Empty
55 }
56
57 uint32
getMediaInformationHeaderType() const58 Mpeg4MediaHeaderAtom::getMediaInformationHeaderType() const
59 {
60 return _mediaType;
61 }
62