• 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 /*     -------------------------------------------------------------------       */
20 /*                          MPEG-4 Util: AudioHintSample                         */
21 /*     -------------------------------------------------------------------       */
22 /*********************************************************************************/
23 /*
24     This DecoderSpecificInfo Class that holds the Mpeg4 VOL header for the
25     video stream
26 */
27 
28 #define __IMPLEMENT_AMRDecoderSpecificInfo__
29 
30 #include "amrdecoderspecificinfo.h"
31 
32 #include "atom.h"
33 #include "atomutils.h"
34 
35 // Default constructor
AMRDecoderSpecificInfo(MP4_FF_FILE * fp,bool o3GPPTrack)36 AMRDecoderSpecificInfo::AMRDecoderSpecificInfo(MP4_FF_FILE *fp, bool o3GPPTrack)
37         : DecoderSpecificInfo(fp, o3GPPTrack, false)
38 {
39     _VendorCode = 0;
40     _codec_version = 0;
41     _band_mode = 0;
42     _frame_type = 0xFF;
43     _mode_set = 0;
44     _mode_change_period = 0;
45     _frames_per_sample = 0;
46     _mode_change_neighbour = 0;
47 
48     if (o3GPPTrack)
49     {
50     }
51     else
52     {
53         AtomUtils::read32(fp, _VendorCode);
54 
55         AtomUtils::read8(fp, _codec_version);
56 
57         AtomUtils::read8(fp, _frame_type);
58 
59         AtomUtils::read16(fp, _mode_set);
60 
61         uint8 data = 0;
62 
63         AtomUtils::read8(fp, data);
64 
65         if (data & 0x01)
66         {
67             _mode_change_neighbour = true;
68         }
69 
70         _mode_change_period = (uint8)((data >> 1) & 0x7F);
71 
72         AtomUtils::read8(fp, data);
73         AtomUtils::read8(fp, data);
74         AtomUtils::read8(fp, data);
75     }
76 }
77 
78 
79