2 * From ccextractor, leave this file as intact and close to the original as possible so that
3 * it is easy to patch in fixes - even though this file contains code that we don't need.
5 * Note that the SRT sub generation from CC could be useful for mkv subs.
7 #ifndef __deccc608sub_H__
8 #define __deccc608sub_H__
14 void handle_end_of_data (struct s_write *wb);
15 void process608 (const unsigned char *data, int length, struct s_write *wb);
16 void get_char_in_latin_1 (unsigned char *buffer, unsigned char c);
17 void get_char_in_unicode (unsigned char *buffer, unsigned char c);
18 int get_char_in_utf_8 (unsigned char *buffer, unsigned char c);
19 unsigned char cctolower (unsigned char c);
20 unsigned char cctoupper (unsigned char c);
21 int general_608_init (struct s_write *wb);
22 void general_608_close (struct s_write *wb);
24 #define CC608_SCREEN_WIDTH 32
53 FONT_UNDERLINED_ITALICS = 3
57 struct eia608_screen // A CC buffer
59 unsigned char characters[15][33];
60 unsigned char colors[15][33];
61 unsigned char fonts[15][33]; // Extra char at the end for a 0
62 int row_used[15]; // Any data in row?
63 int empty; // Buffer completely empty?
66 #define LLONG long long
70 struct eia608_screen buffer1;
71 struct eia608_screen buffer2;
72 int cursor_row, cursor_column;
74 int srt_counter; // Number of subs currently written
75 int screenfuls_counter; // Number of meaningful screenfuls written
76 LLONG current_visible_start_ms; // At what time did the current visible buffer became so?
77 // unsigned current_visible_start_cc; // At what time did the current visible buffer became so?
79 unsigned char last_c1, last_c2;
80 int channel; // Currently selected channel
81 unsigned char color; // Color we are currently using to write
82 unsigned char font; // Font we are currently using to write
87 struct eia608 *data608;
89 unsigned char *subline;
93 hb_buffer_t *hb_buffer;
94 hb_buffer_t *hb_last_buffer;
96 unsigned char *enc_buffer; // Generic general purpose buffer
97 unsigned enc_buffer_used;
98 unsigned enc_buffer_capacity;
104 COM_ERASEDISPLAYEDMEMORY = 1,
105 COM_RESUMECAPTIONLOADING = 2,
106 COM_ENDOFCAPTION = 3,
113 COM_CARRIAGERETURN = 10,
114 COM_ERASENONDISPLAYEDMEMORY = 11,
116 COM_RESUMETEXTDISPLAY = 13