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 // Pre-compilation
9 #include "MediaInfo/PreComp.h"
10 #ifdef __BORLANDC__
11     #pragma hdrstop
12 #endif
13 //---------------------------------------------------------------------------
14 
15 //---------------------------------------------------------------------------
16 #include "MediaInfo/Setup.h"
17 //---------------------------------------------------------------------------
18 
19 //---------------------------------------------------------------------------
20 #if defined(MEDIAINFO_AIC_YES)
21 //---------------------------------------------------------------------------
22 
23 //---------------------------------------------------------------------------
24 #include "MediaInfo/Video/File_Aic.h"
25 //---------------------------------------------------------------------------
26 
27 namespace MediaInfoLib
28 {
29 
30 //***************************************************************************
31 // Streams management
32 //***************************************************************************
33 
34 //---------------------------------------------------------------------------
Streams_Fill()35 void File_Aic::Streams_Fill()
36 {
37     //Filling
38     Stream_Prepare(Stream_Video);
39     Fill(Stream_Video, 0, Video_Format, "AIC");
40     Fill(Stream_Video, 0, Video_Width, Width);
41     Fill(Stream_Video, 0, Video_Height, Height);
42     Fill(Stream_Video, 0, Video_BitDepth, 8);
43     //Fill(Stream_Video, 0, Video_ColorSpace, "YUV");
44     //Fill(Stream_Video, 0, Video_ChromaSubsampling, "4:2:0");
45     switch (FieldFrame)
46     {
47         case 0 : Fill(Stream_Video, 0, Video_ScanType, "Progressive"); break;
48         case 3 : Fill(Stream_Video, 0, Video_ScanType, "Interlaced"); break;
49         default: ;
50     }
51 }
52 
53 //***************************************************************************
54 // Buffer - Per element
55 //***************************************************************************
56 
57 //---------------------------------------------------------------------------
Header_Parse()58 void File_Aic::Header_Parse()
59 {
60     //Parsing
61     int32u Size;
62     int16u Sync;
63     Get_B2 (Sync,                                               "Sync");
64     Get_B4 (Size,                                               "Size");
65     if (Sync!=0x0116 || Size<24 || Size!=Buffer_Size)
66     {
67         Reject("AIC");
68         return;
69     }
70     Get_B2 (Width,                                              "Width");
71     Get_B2 (Height,                                             "Height");
72     Skip_B2(                                                    "Width again?");
73     Skip_B2(                                                    "Height again?");
74     Skip_B2(                                                    "Unknown");
75     BS_Begin();
76     Get_S1 (4, FieldFrame,                                      "field/Frame info?");
77     Skip_S1(4,                                                  "Unknown");
78     Skip_S1(4,                                                  "Unknown");
79     Skip_S1(4,                                                  "Unknown");
80     BS_End();
81     Skip_B3(                                                    "Unknown");
82     Skip_B3(                                                    "Unknown");
83 
84     Header_Fill_Code(0, "Frame");
85     Header_Fill_Size(Size);
86 }
87 
88 //---------------------------------------------------------------------------
Data_Parse()89 void File_Aic::Data_Parse()
90 {
91     //Parsing
92     Skip_XX(Element_Size,                                       "Data");
93 
94     FILLING_BEGIN();
95         Frame_Count++;
96         if (Frame_Count_NotParsedIncluded!=(int64u)-1)
97             Frame_Count_NotParsedIncluded++;
98         if (!Status[IsFilled])
99         {
100             Accept("AIC");
101             Finish("AIC");
102         }
103     FILLING_END();
104 }
105 
106 //***************************************************************************
107 // C++
108 //***************************************************************************
109 
110 } //NameSpace
111 
112 #endif //MEDIAINFO_AIC_*
113