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 //
9 // Information about DVB Subtitle streams
10 //
11 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12 
13 //---------------------------------------------------------------------------
14 #ifndef MediaInfo_File_DvbSubtitleH
15 #define MediaInfo_File_DvbSubtitleH
16 //---------------------------------------------------------------------------
17 
18 //---------------------------------------------------------------------------
19 #include "MediaInfo/File__Analyze.h"
20 //---------------------------------------------------------------------------
21 
22 namespace MediaInfoLib
23 {
24 
25 //***************************************************************************
26 // Class File_DvbSubtitle
27 //***************************************************************************
28 
29 class File_DvbSubtitle : public File__Analyze
30 {
31 public :
32     //In
33     int64u Frame_Count_Valid;
34 
35     //Constructor/Destructor
36     File_DvbSubtitle();
37     ~File_DvbSubtitle();
38 
39 private :
40     //Streams management
41     void Streams_Fill();
42     void Streams_Finish();
43 
44     //Buffer - Synchro
45     bool Synchronize();
46     bool Synched_Test();
47     void Read_Buffer_Unsynched();
48 
49     //Buffer - Demux
50     #if MEDIAINFO_DEMUX
51     bool Demux_UnpacketizeContainer_Test();
52     #endif //MEDIAINFO_DEMUX
53 
54     //Buffer - Per element
55     void Header_Parse();
56     void Data_Parse();
57 
58     //Elements
59     void page_composition_segment();
60     void region_composition_segment();
61     void CLUT_definition_segment();
62     void object_data_segment();
63     void display_definition_segment();
64     void reserved_for_future_use();
65     void end_of_display_set_segment();
66     void private_data();
67     void end_of_PES_data_field_marker();
68 
69     //Temp
70     bool    MustFindDvbHeader;
71     int16u  page_id;
72     int8u   subtitle_stream_id;
73     struct region_data
74     {
75         int16u region_horizontal_address;
76         int16u region_vertical_address;
77 
78         int16u region_width;
79         int16u region_height;
80         int16u region_depth;
81 
82         bool   page_composition_segment;
83         bool   region_composition_segment;
84 
region_dataregion_data85         region_data()
86         {
87             page_composition_segment=false;
88             region_composition_segment=false;
89         }
90     };
91     struct page_data
92     {
93         std::map<int8u, region_data> regions; //Key is region_id
94     };
95     struct subtitle_stream_data
96     {
97         std::map<int16u, page_data>  pages; //Key is page_id
98     };
99     std::map<int8u, subtitle_stream_data> subtitle_streams; //Key is subtitle_stream_id
100 };
101 
102 } //NameSpace
103 
104 #endif
105 
106