DVBCore
1.0
Open source DVB engine
|
00001 /******************************************************************************* 00002 * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org) 00003 * Copyright © 2004 Ocean Blue Software Ltd 00004 * 00005 * This file is part of a DTVKit Software Component 00006 * You are permitted to copy, modify or distribute this file subject to the terms 00007 * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org 00008 * 00009 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 00010 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES 00011 * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. 00012 * 00013 * If you or your organisation is not a member of DTVKit then you have access 00014 * to this source code outside of the terms of the licence agreement 00015 * and you are expected to delete this and any associated files immediately. 00016 * Further information on DTVKit, membership and terms can be found at www.dtvkit.org 00017 *******************************************************************************/ 00025 // pre-processor mechanism so multiple inclusions don't cause compilation error 00026 00027 #ifndef _STBDS_H 00028 #define _STBDS_H 00029 00030 //---Constant and macro definitions for public use----------------------------- 00031 00032 // Page states 00033 #define NORMAL_CASE 0x00 00034 #define ACQUISITION_POINT 0x01 00035 #define MODE_CHANGE 0x02 00036 #define RES_PAGE_STATE 0x03 00037 00038 // Memory allocation trace routines for subtitle debug only. 00039 //#define DS_HEAP_USAGE 00040 #ifdef DS_HEAP_USAGE 00041 #define MAX_ARRAY_INDEX 255 00042 #endif 00043 00044 //---Enumerations for public use----------------------------------------------- 00045 00046 //---Global type defs for public use------------------------------------------- 00047 00048 // bits for dvb segment info holding 00049 typedef struct object 00050 { 00051 struct object *next; 00052 00053 // ETS 300 743 7.2.4 00054 U16BIT object_id; 00055 U8BIT object_version_number; 00056 U8BIT object_coding_method; 00057 U8BIT non_modifying_colour_flag; 00058 00059 U8BIT *map_table_2_to_4_bit; 00060 U8BIT *map_table_2_to_8_bit; 00061 U8BIT *map_table_4_to_8_bit; 00062 00063 U8BIT *character_code; 00064 U16BIT num_chars; 00065 00066 // These are varibles for physical control/settings 00067 // Here they where obtained from top_pixel_data_sub_block & bottom_pixel_data_sub_block 00068 U8BIT *bitmap; 00069 U16BIT width; 00070 U16BIT height; 00071 } S_OBJECT; 00072 00073 typedef struct clut 00074 { 00075 struct clut *next; 00076 00077 // ETS 300 743 7.2.3 00078 U8BIT clut_id; 00079 U8BIT clut_version_number; 00080 00081 U32BIT *clut_2_bit; 00082 U32BIT *clut_4_bit; 00083 U32BIT *clut_8_bit; 00084 00085 // These are varibles for physical control/settings 00086 BOOLEAN default_2_bit; 00087 BOOLEAN default_4_bit; 00088 BOOLEAN default_8_bit; 00089 } S_CLUT; 00090 00091 typedef struct region_object 00092 { 00093 struct region_object *next; 00094 00095 // ETS 300 743 7.2.2 - RCS object list 00096 U16BIT object_id; 00097 U8BIT object_type; 00098 U8BIT object_provider_flag; 00099 U16BIT object_horizontal_position; 00100 U16BIT object_vertical_position; 00101 U8BIT object_foreground_pixel_code; 00102 U8BIT object_background_pixel_code; 00103 } S_REGION_OBJECT; 00104 00105 typedef struct epoch_region 00106 { 00107 struct epoch_region *next; 00108 00109 // ETS 300 743 7.2.2 - from the RCS 00110 U8BIT region_id; 00111 U8BIT region_version_number; 00112 U8BIT region_fill_flag; 00113 U16BIT region_width; 00114 U16BIT region_height; 00115 U8BIT region_level_of_compatibilty; 00116 U8BIT region_colour_depth; 00117 U8BIT region_clut_id; 00118 U8BIT region_8_bit_pixel_code; 00119 U8BIT region_4_bit_pixel_code; 00120 U8BIT region_2_bit_pixel_code; 00121 S_REGION_OBJECT *region_object_list; 00122 } S_EPOCH_REGION; 00123 00124 typedef struct region 00125 { 00126 struct region *next; 00127 // U8BIT region_version_number; 00128 00129 // ETS 300 743 7.2.1 - PCS region list 00130 U8BIT region_id; 00131 U16BIT region_horizontal_address; 00132 U16BIT region_vertical_address; 00133 } S_REGION; 00134 00135 typedef struct page_composition 00136 { 00137 // ETS 300 743 7.2.1 - from the PCS 00138 U8BIT page_time_out; 00139 U8BIT page_version_number; 00140 U8BIT page_state; 00141 S_REGION *region_list; 00142 00143 // These are varibles for physical control/settings 00144 U8BIT pts[5]; 00145 U32BIT presentation_time_ms; 00146 U32BIT timeout_start; 00147 BOOLEAN display_set_shown; 00148 BOOLEAN display_set_removed; 00149 00150 /* These variables are used for HD subtitles */ 00151 BOOLEAN dds_present; 00152 U8BIT dds_version; 00153 U16BIT display_width; 00154 U16BIT display_height; 00155 BOOLEAN display_window; 00156 U16BIT window_x; 00157 U16BIT window_y; 00158 U16BIT window_width; 00159 U16BIT window_height; 00160 } S_PAGE_COMPOSITION; 00161 00162 typedef struct display_set 00163 { 00164 S_PAGE_COMPOSITION *page_display_buffer; 00165 S_PAGE_COMPOSITION *page_composition_buffer; 00166 S_EPOCH_REGION *region_list; 00167 S_OBJECT *object_list; 00168 S_CLUT *clut_list; 00169 } S_DISPLAY_SET; 00170 00171 //---Global Function prototypes for public use--------------------------------- 00172 00173 // From the file stbdsfn.c 00174 BOOLEAN STB_DSInitialiseDVBSubtitlesProcessing(void); 00175 S_CLUT* STB_DSGetClut(S_CLUT *clut_list, U16BIT clut_id); 00176 BOOLEAN STB_DSSegmentDDS(U8BIT *data, U16BIT pes_len, U16BIT processed_bytes); 00177 BOOLEAN STB_DSSegmentPCS(U8BIT *data, U16BIT pes_len, U16BIT processed_bytes, BOOLEAN force_acquisition); 00178 BOOLEAN STB_DSSegmentRCS(U8BIT *data, U16BIT pes_len, U16BIT processed_bytes); 00179 BOOLEAN STB_DSSegmentCDS(U8BIT *data, U16BIT pes_len, U16BIT processed_bytes); 00180 BOOLEAN STB_DSSegmentODS(U8BIT *data, U16BIT pes_len, U16BIT processed_bytes); 00181 BOOLEAN STB_DSSegmentEDS(U8BIT *data, U16BIT pes_len, U16BIT processed_bytes); 00182 BOOLEAN STB_DSGetPesPts(U8BIT *data, U8BIT *pts); 00183 BOOLEAN STB_DSSetDisplaySetPts(U8BIT path, U8BIT *pts); 00184 S_DISPLAY_SET* STB_DSGetDetails(void); 00185 void STB_DSClearDisplaySetStruct(void); 00186 void STB_DSClearCompositionPageDetails(void); 00187 00188 00189 // From the file stbdsdis.c 00190 void STB_DSCheckDisplaySetTimeout(S_DISPLAY_SET *subtitle_display_set, BOOLEAN timeout_override); 00191 void STB_DSDisplay(U8BIT path, S_DISPLAY_SET *subtitle_display_set); 00192 void STB_DSRegisterCharRenderFunction(void (*DSCreateBitmap)(U8BIT *bitmap, U16BIT width, U16BIT height, U8BIT *char_array, 00193 U8BIT *tycrcb_palette, U8BIT fgnd_col, U8BIT bkgnd_col)); 00194 void STB_DSShow(void); 00195 void STB_DSHide(void); 00196 void STB_DSResetPhysicalDisplayRegions(void); 00197 void STB_DSResetPhysicalCompositionRegions(void); 00198 void STB_DSTerminateDisplayCycle(void); 00199 void STB_DSCreateCompositionRegion(S_EPOCH_REGION *region, BOOLEAN page_reset); 00200 void STB_DSRenderBitmapToRegion(S_EPOCH_REGION *region_list, S_OBJECT *object, U8BIT *scan_line, 00201 U16BIT y, U16BIT w, U16BIT h); 00202 void STB_DSFillRegion(U16BIT region_id, U8BIT fillcode); 00203 U32BIT STB_DSNumPixelOperations(S_DISPLAY_SET *subtitle_display_set); 00204 void STB_DSFillEmptyRegions(S_EPOCH_REGION *epoch_region_list, S_REGION *region_list); 00205 00206 // stbdsc.c 00207 void STB_SUBInitialise(void); 00208 void* STB_DSGetQueue(void); 00209 BOOLEAN STB_DSGetNextPesPts(U8BIT *next_pts); 00210 00211 #endif // _STBDS_H 00212 00213 //***************************************************************************** 00214 // End of file 00215 //***************************************************************************** 00216