cvs20080628 - trunk
[gitenigma.git] / include / lib / dvb / subtitle.h
blob95b61146c87c637d79d177ad5e39948291ab01c4
1 #ifndef __subtitle_h
2 #define __subtitle_h
4 #include <lib/base/ebase.h>
6 typedef unsigned char __u8;
8 struct subtitle_clut_entry
10 __u8 Y, Cr, Cb, T;
13 struct subtitle_clut
15 int clut_id;
16 int size;
17 struct subtitle_clut_entry entries[16];
18 int CLUT_version_number;
20 struct subtitle_clut *next;
23 struct subtitle_page_region
25 int region_id;
26 int region_horizontal_address;
27 int region_vertical_address;
28 struct subtitle_page_region *next;
31 struct subtitle_region_object
33 int object_id;
34 int object_type;
35 int object_provider_flag;
37 int object_horizontal_position;
38 int object_vertical_position;
40 // not supported right now...
41 int foreground_pixel_value;
42 int background_pixel_value;
44 struct subtitle_region_object *next;
47 struct subtitle_region
49 int region_id;
50 int region_version_number;
51 int region_height, region_width;
52 __u8 *region_buffer;
54 int clut_id;
56 struct subtitle_region_object *region_objects;
58 struct subtitle_region *next;
61 struct subtitle_page
63 int page_id;
64 time_t page_time_out;
65 int page_version_number;
66 int pcs_size;
67 struct subtitle_page_region *page_regions;
69 struct subtitle_region *regions;
71 struct subtitle_clut *cluts;
73 struct subtitle_page *next;
76 struct subtitle_ctx
78 struct subtitle_page *pages;
80 int current_clut_id, current_clut_page_id;
82 __u8 *screen_buffer;
83 int screen_width, screen_height;
84 int screen_enabled;
85 eTimer *timeout_timer;
87 int bbox_left, bbox_top, bbox_right, bbox_bottom;
89 void (*set_palette)(struct subtitle_clut *pal);
92 struct bitstream
94 __u8 *data;
95 int size;
96 int avail;
97 int consumed;
100 void bitstream_init(struct bitstream *bit, void *buffer, int size);
101 int bitstream_get(struct bitstream *bit);
102 void subtitle_process_line(struct subtitle_ctx *sub, struct subtitle_page *page, int object_id, int line, __u8 *data, int len);
103 int subtitle_process_pixel_data(struct subtitle_ctx *sub, struct subtitle_page *page, int object_id, int *linenr, int *linep, __u8 *data);
104 int subtitle_process_segment(struct subtitle_ctx *sub, __u8 *segment);
105 void subtitle_process_pes(struct subtitle_ctx *sub, void *buffer, int len);
106 void subtitle_clear_screen(struct subtitle_ctx *sub);
107 void subtitle_reset(struct subtitle_ctx *sub);
108 void subtitle_redraw_all(struct subtitle_ctx *sub);
109 void subtitle_redraw(struct subtitle_ctx *sub, int pageid);
110 void subtitle_screen_enable(struct subtitle_ctx *sub, int enable);
112 #endif