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 /* PASP Box is used to contain the Horizontal and vertical spacing */
19
20 #define IMPLEMENT_AVCConfigurationBox
21 #include "avcsampleentry.h"
22 #include "atomutils.h"
23 #include "atomdefs.h"
24
25 #ifndef PASPBOX_H_INCLUDED
26 #include "paspatom.h"
27 #endif
28
29
PASPBox(MP4_FF_FILE * fp,uint32 size,uint32 type)30 PASPBox::PASPBox(MP4_FF_FILE *fp, uint32 size, uint32 type)
31 : Atom(fp, size, type)
32 {
33 _mp4ErrorCode = READ_PIXELASPECTRATIO_BOX_FAILED; //Error Code for pasp
34
35 if (_success)
36 {
37 _success = false;
38 _pparent = NULL;
39
40 if (!AtomUtils::read32(fp, _hSpacing))
41 {
42 return;
43 }
44 if (!AtomUtils::read32(fp, _vSpacing))
45 {
46 return;
47 }
48
49 _success = true;
50 _mp4ErrorCode = EVERYTHING_FINE;
51
52 }
53 }
54
55
56
57