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?
68 struct eia608_screen buffer1;
69 struct eia608_screen buffer2;
70 int cursor_row, cursor_column;
72 int srt_counter; // Number of subs currently written
73 int screenfuls_counter; // Number of meaningful screenfuls written
74 int64_t current_visible_start_ms; // At what time did the current visible buffer became so?
75 // unsigned current_visible_start_cc; // At what time did the current visible buffer became so?
77 unsigned char last_c1, last_c2;
78 int channel; // Currently selected channel
79 unsigned char color; // Color we are currently using to write
80 unsigned char font; // Font we are currently using to write
85 struct eia608 *data608;
87 unsigned char *subline;
91 hb_buffer_t *hb_buffer;
92 hb_buffer_t *hb_last_buffer;
94 unsigned char *enc_buffer; // Generic general purpose buffer
95 unsigned enc_buffer_used;
96 unsigned enc_buffer_capacity;
102 COM_ERASEDISPLAYEDMEMORY = 1,
103 COM_RESUMECAPTIONLOADING = 2,
104 COM_ENDOFCAPTION = 3,
111 COM_CARRIAGERETURN = 10,
112 COM_ERASENONDISPLAYEDMEMORY = 11,
114 COM_RESUMETEXTDISPLAY = 13