#include "hb.h"#include "deccc608sub.h"#include <ctype.h>Classes | |
| struct | hb_work_private_s |
Defines | |
| #define | fatal(N,...) |
| #define | XMLRPC_APPEND(N,...) |
| #define | INITIAL_ENC_BUFFER_CAPACITY 2048 |
| #define | GUARANTEE(wb, length) |
| #define | ISSEPARATOR(c) |
Functions | |
| int | general_608_init (struct s_write *wb) |
| void | general_608_close (struct s_write *wb) |
| void | get_char_in_latin_1 (unsigned char *buffer, unsigned char c) |
| void | get_char_in_unicode (unsigned char *buffer, unsigned char c) |
| int | get_char_in_utf_8 (unsigned char *buffer, unsigned char c) |
| unsigned char | cctolower (unsigned char c) |
| unsigned char | cctoupper (unsigned char c) |
| unsigned | encode_line (unsigned char *buffer, unsigned char *text) |
| void | correct_case (int line_num, struct eia608_screen *data) |
| void | capitalize (int line_num, struct eia608_screen *data, int *new_sentence) |
| void | find_limit_characters (unsigned char *line, int *first_non_blank, int *last_non_blank) |
| unsigned | get_decoder_line_basic (unsigned char *buffer, int line_num, struct eia608_screen *data) |
| unsigned | get_decoder_line_encoded_for_gui (unsigned char *buffer, int line_num, struct eia608_screen *data) |
| unsigned | get_decoder_line_encoded (unsigned char *buffer, int line_num, struct eia608_screen *data) |
| void | delete_all_lines_but_current (struct eia608_screen *data, int row) |
| void | clear_eia608_cc_buffer (struct eia608_screen *data) |
| void | init_eia608 (struct eia608 *data) |
| struct eia608_screen * | get_writing_buffer (struct s_write *wb) |
| void | write_char (const unsigned char c, struct s_write *wb) |
| void | handle_text_attr (const unsigned char c1, const unsigned char c2, struct s_write *wb) |
| void | mstotime (int64_t milli, unsigned *hours, unsigned *minutes, unsigned *seconds, unsigned *ms) |
| void | write_subtitle_file_footer (struct s_write *wb) |
| void | fhb_log_encoded (FILE *fh, const char *string) |
| void | write_subtitle_file_header (struct s_write *wb) |
| void | write_cc_line_as_transcript (struct eia608_screen *data, struct s_write *wb, int line_number) |
| int | write_cc_buffer_as_transcript (struct eia608_screen *data, struct s_write *wb) |
| void | write_cc_buffer_to_gui (struct eia608_screen *data, struct s_write *wb) |
| int | write_cc_buffer_as_srt (struct eia608_screen *data, struct s_write *wb) |
| int | write_cc_buffer_as_sami (struct eia608_screen *data, struct s_write *wb) |
| struct eia608_screen * | get_current_visible_buffer (struct s_write *wb) |
| int | write_cc_buffer (struct s_write *wb) |
| void | roll_up (struct s_write *wb) |
| void | erase_memory (struct s_write *wb, int displayed) |
| int | is_current_row_empty (struct s_write *wb) |
| void | handle_command (unsigned char c1, const unsigned char c2, struct s_write *wb) |
| void | handle_end_of_data (struct s_write *wb) |
| void | handle_double (const unsigned char c1, const unsigned char c2, struct s_write *wb) |
| unsigned char | handle_extended (unsigned char hi, unsigned char lo, struct s_write *wb) |
| void | handle_pac (unsigned char c1, unsigned char c2, struct s_write *wb) |
| void | handle_single (const unsigned char c1, struct s_write *wb) |
| int | check_channel (unsigned char c1, struct s_write *wb) |
| int | disCommand (unsigned char hi, unsigned char lo, struct s_write *wb) |
| void | process608 (const unsigned char *data, int length, struct s_write *wb) |
| unsigned char * | debug_608toASC (unsigned char *cc_data, int channel) |
| int | decccInit (hb_work_object_t *w, hb_job_t *job) |
| int | decccWork (hb_work_object_t *w, hb_buffer_t **buf_in, hb_buffer_t **buf_out) |
| void | decccClose (hb_work_object_t *w) |
Variables | |
| int | rowdata [] = {11,-1,1,2,3,4,12,13,14,15,5,6,7,8,9,10} |
| unsigned char | str [2048] |
| const unsigned char | pac2_attribs [][3] |
| unsigned char | encoded_crlf [16] |
| unsigned int | encoded_crlf_length |
| unsigned char | encoded_br [16] |
| unsigned int | encoded_br_length |
| unsigned char | usercolor_rgb [8] = "" |
| enum color_code | default_color = COL_WHITE |
| const char * | sami_header |
| const char * | command_type [] |
| const char * | font_text [] |
| const char * | cc_modes_text [] |
| const char * | color_text [][2] |
| hb_work_object_t | hb_deccc608 |
| #define fatal | ( | N, | ||
| ... | ||||
| ) |
| #define GUARANTEE | ( | wb, | ||
| length | ||||
| ) |
if (length>wb->enc_buffer_capacity) \ {wb->enc_buffer_capacity*=2; wb->enc_buffer=(unsigned char*) realloc (wb->enc_buffer, wb->enc_buffer_capacity); \ if (wb->enc_buffer==NULL) { fatal (EXIT_NOT_ENOUGH_MEMORY, "Not enough memory, bailing out\n"); } \ }
| #define INITIAL_ENC_BUFFER_CAPACITY 2048 |
| #define ISSEPARATOR | ( | c | ) |
(c==' ' || c==0x89 || ispunct(c) \
|| c==0x99)
| #define XMLRPC_APPEND | ( | N, | ||
| ... | ||||
| ) |
| void capitalize | ( | int | line_num, | |
| struct eia608_screen * | data, | |||
| int * | new_sentence | |||
| ) |
| unsigned char cctolower | ( | unsigned char | c | ) |
| unsigned char cctoupper | ( | unsigned char | c | ) |
| int check_channel | ( | unsigned char | c1, | |
| struct s_write * | wb | |||
| ) |
| void clear_eia608_cc_buffer | ( | struct eia608_screen * | data | ) |
| void correct_case | ( | int | line_num, | |
| struct eia608_screen * | data | |||
| ) |
| unsigned char* debug_608toASC | ( | unsigned char * | cc_data, | |
| int | channel | |||
| ) |
| void decccClose | ( | hb_work_object_t * | w | ) |
| int decccInit | ( | hb_work_object_t * | w, | |
| hb_job_t * | job | |||
| ) |
| int decccWork | ( | hb_work_object_t * | w, | |
| hb_buffer_t ** | buf_in, | |||
| hb_buffer_t ** | buf_out | |||
| ) |
| void delete_all_lines_but_current | ( | struct eia608_screen * | data, | |
| int | row | |||
| ) |
| int disCommand | ( | unsigned char | hi, | |
| unsigned char | lo, | |||
| struct s_write * | wb | |||
| ) |
| unsigned encode_line | ( | unsigned char * | buffer, | |
| unsigned char * | text | |||
| ) |
| void erase_memory | ( | struct s_write * | wb, | |
| int | displayed | |||
| ) |
| void fhb_log_encoded | ( | FILE * | fh, | |
| const char * | string | |||
| ) |
| void find_limit_characters | ( | unsigned char * | line, | |
| int * | first_non_blank, | |||
| int * | last_non_blank | |||
| ) |
| void general_608_close | ( | struct s_write * | wb | ) |
| int general_608_init | ( | struct s_write * | wb | ) |
| void get_char_in_latin_1 | ( | unsigned char * | buffer, | |
| unsigned char | c | |||
| ) |
| void get_char_in_unicode | ( | unsigned char * | buffer, | |
| unsigned char | c | |||
| ) |
| int get_char_in_utf_8 | ( | unsigned char * | buffer, | |
| unsigned char | c | |||
| ) |
| struct eia608_screen* get_current_visible_buffer | ( | struct s_write * | wb | ) | [read] |
| unsigned get_decoder_line_basic | ( | unsigned char * | buffer, | |
| int | line_num, | |||
| struct eia608_screen * | data | |||
| ) |
| unsigned get_decoder_line_encoded | ( | unsigned char * | buffer, | |
| int | line_num, | |||
| struct eia608_screen * | data | |||
| ) |
| unsigned get_decoder_line_encoded_for_gui | ( | unsigned char * | buffer, | |
| int | line_num, | |||
| struct eia608_screen * | data | |||
| ) |
| struct eia608_screen* get_writing_buffer | ( | struct s_write * | wb | ) | [read] |
| void handle_command | ( | unsigned char | c1, | |
| const unsigned char | c2, | |||
| struct s_write * | wb | |||
| ) |
| void handle_double | ( | const unsigned char | c1, | |
| const unsigned char | c2, | |||
| struct s_write * | wb | |||
| ) |
| void handle_end_of_data | ( | struct s_write * | wb | ) |
| unsigned char handle_extended | ( | unsigned char | hi, | |
| unsigned char | lo, | |||
| struct s_write * | wb | |||
| ) |
| void handle_pac | ( | unsigned char | c1, | |
| unsigned char | c2, | |||
| struct s_write * | wb | |||
| ) |
| void handle_single | ( | const unsigned char | c1, | |
| struct s_write * | wb | |||
| ) |
| void handle_text_attr | ( | const unsigned char | c1, | |
| const unsigned char | c2, | |||
| struct s_write * | wb | |||
| ) |
| void init_eia608 | ( | struct eia608 * | data | ) |
| int is_current_row_empty | ( | struct s_write * | wb | ) |
| void mstotime | ( | int64_t | milli, | |
| unsigned * | hours, | |||
| unsigned * | minutes, | |||
| unsigned * | seconds, | |||
| unsigned * | ms | |||
| ) |
| void process608 | ( | const unsigned char * | data, | |
| int | length, | |||
| struct s_write * | wb | |||
| ) |
| void roll_up | ( | struct s_write * | wb | ) |
| int write_cc_buffer | ( | struct s_write * | wb | ) |
| int write_cc_buffer_as_sami | ( | struct eia608_screen * | data, | |
| struct s_write * | wb | |||
| ) |
| int write_cc_buffer_as_srt | ( | struct eia608_screen * | data, | |
| struct s_write * | wb | |||
| ) |
| int write_cc_buffer_as_transcript | ( | struct eia608_screen * | data, | |
| struct s_write * | wb | |||
| ) |
| void write_cc_buffer_to_gui | ( | struct eia608_screen * | data, | |
| struct s_write * | wb | |||
| ) |
| void write_cc_line_as_transcript | ( | struct eia608_screen * | data, | |
| struct s_write * | wb, | |||
| int | line_number | |||
| ) |
| void write_char | ( | const unsigned char | c, | |
| struct s_write * | wb | |||
| ) |
| void write_subtitle_file_footer | ( | struct s_write * | wb | ) |
| void write_subtitle_file_header | ( | struct s_write * | wb | ) |
| const char* cc_modes_text[] |
{
"Pop-Up captions"
}
| const char* color_text[][2] |
{
{"white",""},
{"green","<font color=\"#00ff00\">"},
{"blue","<font color=\"#0000ff\">"},
{"cyan","<font color=\"#00ffff\">"},
{"red","<font color=\"#ff0000\">"},
{"yellow","<font color=\"#ffff00\">"},
{"magenta","<font color=\"#ff00ff\">"},
{"userdefined","<font color=\""}
}
| const char* command_type[] |
{
"Unknown",
"EDM - EraseDisplayedMemory",
"RCL - ResumeCaptionLoading",
"EOC - End Of Caption",
"TO1 - Tab Offset, 1 column",
"TO2 - Tab Offset, 2 column",
"TO3 - Tab Offset, 3 column",
"RU2 - Roll up 2 rows",
"RU3 - Roll up 3 rows",
"RU4 - Roll up 4 rows",
"CR - Carriage Return",
"ENM - Erase non-displayed memory",
"BS - Backspace",
"RTD - Resume Text Display"
}
| enum color_code default_color = COL_WHITE |
| unsigned char encoded_br[16] |
| unsigned int encoded_br_length |
| unsigned char encoded_crlf[16] |
| unsigned int encoded_crlf_length |
| const char* font_text[] |
{
"regular",
"italics",
"underlined",
"underlined italics"
}
{
WORK_DECCC608,
"Closed Caption (608) decoder",
decccInit,
decccWork,
decccClose
}
| const unsigned char pac2_attribs[][3] |
| int rowdata[] = {11,-1,1,2,3,4,12,13,14,15,5,6,7,8,9,10} |
| const char* sami_header |
"<SAMI>\n\ <HEAD>\n\ <STYLE TYPE=\"text/css\">\n\ <!--\n\ P {margin-left: 16pt; margin-right: 16pt; margin-bottom: 16pt; margin-top: 16pt;\n\ text-align: center; font-size: 18pt; font-family: arial; font-weight: bold; color: #f0f0f0;}\n\ .UNKNOWNCC {Name:Unknown; lang:en-US; SAMIType:CC;}\n\ -->\n\ </STYLE>\n\ </HEAD>\n\n\ <BODY>\n"
| unsigned char str[2048] |
| unsigned char usercolor_rgb[8] = "" |
1.7.1