1 /*  Copyright (c) MediaArea.net SARL. All Rights Reserved.
2  *
3  *  Use of this source code is governed by a BSD-style license that can
4  *  be found in the License.html file in the root of the source tree.
5  */
6 
7 //---------------------------------------------------------------------------
8 #ifndef MediaInfo_File_MpegaH
9 #define MediaInfo_File_MpegaH
10 //---------------------------------------------------------------------------
11 
12 //---------------------------------------------------------------------------
13 #include "MediaInfo/Tag/File__Tags.h"
14 //---------------------------------------------------------------------------
15 
16 namespace MediaInfoLib
17 {
18 
19 //***************************************************************************
20 // Class File_Mpega
21 //***************************************************************************
22 
23 class File_Mpega : public File__Analyze, public File__Tags_Helper
24 {
25 public :
26     //In
27     int64u Frame_Count_Valid;
28     bool   FrameIsAlwaysComplete;
29     bool   CalculateDelay;
30 
31     //Constructor/Destructor
32     File_Mpega();
33 
34 private :
35     //Streams management
36     void Streams_Fill();
37     void Streams_Finish();
38 
39     //Buffer - File header
40     bool FileHeader_Begin();
41 
42     //Buffer - Synchro
43     bool Synchronize();
44     bool Synched_Test();
45 
46     //Buffer - Demux
47     bool Demux_UnpacketizeContainer_Test();
48 
49     //Buffer - Per element
50     void Header_Parse();
51     void Data_Parse();
52     void Data_Parse_Fill();
53     void audio_data_Layer3();
54 
55     //Element
56     bool Header_Xing();
57     bool Header_VBRI();
58     bool Header_Encoders();
59     void Header_Encoders_Lame();
60     void Encoded_Library_Guess();
61 
62     //Temp
63     Ztring BitRate_Mode;
64     Ztring BitRate_Nominal;
65     Ztring BitRate_Minimum;
66     string Encoded_Library;
67     Ztring Encoded_Library_Settings;
68     std::map<int16u, size_t> BitRate_Count;
69     std::map<int8u, size_t> sampling_frequency_Count;
70     std::map<int8u, size_t> mode_Count;
71     size_t Surround_Frames;
72     size_t Block_Count[3]; //long, short, mixed
73     size_t Channels_Count[4]; //Stereo, Join Stereo, Dual mono, mono
74     size_t Extension_Count[4]; //No, IS, MS, IS+MS
75     size_t Emphasis_Count[4]; //No, 50/15ms, Reserved, CCITT
76     size_t Scfsi; //Total
77     size_t Scalefac; //Total
78     size_t Reservoir; //Total
79     int64u LastSync_Offset;
80     int64u VBR_FileSize;
81     int32u VBR_Frames;
82     int32u Reservoir_Max;
83     int32u Xing_Scale;
84     int32u BitRate; //Average
85     int8u  ID;
86     int8u  layer;
87     int8u  bitrate_index;
88     int8u  sampling_frequency;
89     int8u  mode;
90     int8u  mode_extension;
91     int8u  emphasis;
92     bool   protection_bit;
93     bool   padding_bit;
94     bool   copyright;
95     bool   original_home;
96     bool   VBR_Frames_IsCbr;
97     size_t MpegPsPattern_Count;
98 
99     //Helpers
100     bool Element_Name_IsOK();
101 
102     #if MEDIAINFO_DEMUX
103         #if MEDIAINFO_ADVANCED
104             int8u sampling_frequency_Frame0;
105             int8u mode_Frame0;
106             bool  File_Demux_Unpacketize_StreamLayoutChange_Skip;
107         #endif //MEDIAINFO_ADVANCED
108     #endif //MEDIAINFO_DEMUX
109 };
110 
111 } //NameSpace
112 
113 #endif
114