mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2024-12-24 20:01:42 +00:00
Merge branch 'pr/n522_DanilaFe'
This commit is contained in:
commit
4e4a7aa19e
@ -38,14 +38,14 @@ void fdprintf(int fd, const char *fmt, ...)
|
||||
free(p);
|
||||
return;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
p = np;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Converts the given milli to separate hours,minutes,seconds and ms variables */
|
||||
void mstotime(LLONG milli, unsigned *hours, unsigned *minutes,
|
||||
void millis_to_time(LLONG milli, unsigned *hours, unsigned *minutes,
|
||||
unsigned *seconds, unsigned *ms)
|
||||
{
|
||||
// LLONG milli = (LLONG) ((ccblock*1000)/29.97);
|
||||
|
@ -40,10 +40,10 @@
|
||||
|
||||
// Declarations
|
||||
void fdprintf(int fd, const char *fmt, ...);
|
||||
void mstotime(LLONG milli, unsigned *hours, unsigned *minutes,unsigned *seconds, unsigned *ms);
|
||||
void millis_to_time(LLONG milli, unsigned *hours, unsigned *minutes,unsigned *seconds, unsigned *ms);
|
||||
void freep(void *arg);
|
||||
void dbg_print(LLONG mask, const char *fmt, ...);
|
||||
unsigned char *debug_608toASC(unsigned char *ccdata, int channel);
|
||||
unsigned char *debug_608_to_ASC(unsigned char *ccdata, int channel);
|
||||
int add_cc_sub_text(struct cc_subtitle *sub, char *str, LLONG start_time,
|
||||
LLONG end_time, char *info, char *mode, enum ccx_encoding_type);
|
||||
|
||||
|
@ -1237,7 +1237,7 @@ int process608(const unsigned char *data, int length, void *private_data, struct
|
||||
|
||||
/* Return a pointer to a string that holds the printable characters
|
||||
* of the caption data block. FOR DEBUG PURPOSES ONLY! */
|
||||
unsigned char *debug_608toASC (unsigned char *cc_data, int channel)
|
||||
unsigned char *debug_608_to_ASC (unsigned char *cc_data, int channel)
|
||||
{
|
||||
static unsigned char output[3];
|
||||
|
||||
|
@ -118,7 +118,7 @@ int do_cb (struct lib_cc_decode *ctx, unsigned char *cc_block, struct cc_subtitl
|
||||
switch (cc_type)
|
||||
{
|
||||
case 0:
|
||||
dbg_print(CCX_DMT_CBRAW, " %s .. ..\n", debug_608toASC( cc_block, 0));
|
||||
dbg_print(CCX_DMT_CBRAW, " %s .. ..\n", debug_608_to_ASC( cc_block, 0));
|
||||
|
||||
ctx->current_field = 1;
|
||||
ctx->saw_caption_block = 1;
|
||||
@ -142,7 +142,7 @@ int do_cb (struct lib_cc_decode *ctx, unsigned char *cc_block, struct cc_subtitl
|
||||
cb_field1++;
|
||||
break;
|
||||
case 1:
|
||||
dbg_print(CCX_DMT_CBRAW, " .. %s ..\n", debug_608toASC( cc_block, 1));
|
||||
dbg_print(CCX_DMT_CBRAW, " .. %s ..\n", debug_608_to_ASC( cc_block, 1));
|
||||
|
||||
ctx->current_field = 2;
|
||||
ctx->saw_caption_block = 1;
|
||||
@ -350,7 +350,7 @@ struct lib_cc_decode* init_cc_decode (struct ccx_decoders_common_settings_t *set
|
||||
ctx->pulldownfields = 0;
|
||||
//es parser related variable ends here
|
||||
|
||||
memset(ctx->cc_stats, 0, 4 * sizeof(int));
|
||||
memset(ctx->cc_stats, 0, 4 * sizeof(int));
|
||||
|
||||
ctx->anchor_seq_number = -1;
|
||||
// Init XDS buffers
|
||||
|
@ -385,7 +385,7 @@ static int write_bom(struct encoder_ctx *ctx, struct ccx_s_write *out)
|
||||
mprint("WARNING: Unable tp write UTF BOM\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (ctx->encoding == CCX_ENC_UNICODE){ // Write BOM
|
||||
ret = write(out->fh, LITTLE_ENDIAN_BOM, sizeof(LITTLE_ENDIAN_BOM));
|
||||
@ -946,7 +946,7 @@ struct encoder_ctx *init_encoder(struct encoder_cfg *opt)
|
||||
|
||||
ctx->transcript_settings = &opt->transcript_settings;
|
||||
ctx->no_bom = opt->no_bom;
|
||||
ctx->sentence_cap = opt->sentence_cap;
|
||||
ctx->sentence_cap = opt->sentence_cap;
|
||||
ctx->trim_subs = opt->trim_subs;
|
||||
ctx->autodash = opt->autodash;
|
||||
ctx->no_font_color = opt->no_font_color;
|
||||
@ -1286,8 +1286,8 @@ void write_cc_buffer_to_gui(struct eia608_screen *data, struct encoder_ctx *cont
|
||||
if (!time_reported)
|
||||
{
|
||||
LLONG ms_end = data->end_time;
|
||||
mstotime(ms_start, &h1, &m1, &s1, &ms1);
|
||||
mstotime(ms_end - 1, &h2, &m2, &s2, &ms2); // -1 To prevent overlapping with next line.
|
||||
millis_to_time(ms_start, &h1, &m1, &s1, &ms1);
|
||||
millis_to_time(ms_end - 1, &h2, &m2, &s2, &ms2); // -1 To prevent overlapping with next line.
|
||||
// Note, only MM:SS here as we need to save space in the preview window
|
||||
fprintf(stderr, "%02u:%02u#%02u:%02u#",
|
||||
h1 * 60 + m1, s1, h2 * 60 + m2, s2);
|
||||
|
@ -56,8 +56,8 @@ int write_cc_bitmap_as_libcurl(struct cc_subtitle *sub, struct encoder_ctx *cont
|
||||
{
|
||||
if (context->prev_start != -1 || !(sub->flags & SUB_EOD_MARKER))
|
||||
{
|
||||
mstotime(ms_start, &h1, &m1, &s1, &ms1);
|
||||
mstotime(ms_end - 1, &h2, &m2, &s2, &ms2); // -1 To prevent overlapping with next line.
|
||||
millis_to_time(ms_start, &h1, &m1, &s1, &ms1);
|
||||
millis_to_time(ms_end - 1, &h2, &m2, &s2, &ms2); // -1 To prevent overlapping with next line.
|
||||
context->srt_counter++;
|
||||
sprintf(timeline, "group_id=ccextractordev&start_time=%" PRIu64 "&end_time=%" PRIu64 "&lang=en", ms_start, ms_end);
|
||||
char *curlline = NULL;
|
||||
|
@ -76,8 +76,8 @@ int write_cc_buffer_as_g608(struct eia608_screen *data, struct encoder_ctx *cont
|
||||
|
||||
ms_end = data->end_time;
|
||||
|
||||
mstotime (ms_start,&h1,&m1,&s1,&ms1);
|
||||
mstotime (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
millis_to_time (ms_start,&h1,&m1,&s1,&ms1);
|
||||
millis_to_time (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
char timeline[128];
|
||||
context->srt_counter++;
|
||||
sprintf(timeline, "%u%s", context->srt_counter, context->encoded_crlf);
|
||||
|
@ -46,8 +46,8 @@ void write_stringz_as_smptett(char *string, struct encoder_ctx *context, LLONG m
|
||||
if (el == NULL || unescaped == NULL)
|
||||
fatal (EXIT_NOT_ENOUGH_MEMORY, "In write_stringz_as_sami() - not enough memory.\n");
|
||||
|
||||
mstotime (ms_start, &h1, &m1, &s1, &ms1);
|
||||
mstotime (ms_end-1, &h2, &m2, &s2, &ms2);
|
||||
millis_to_time (ms_start, &h1, &m1, &s1, &ms1);
|
||||
millis_to_time (ms_end-1, &h2, &m2, &s2, &ms2);
|
||||
|
||||
sprintf ((char *) str, "<p begin=\"%02u:%02u:%02u.%03u\" end=\"%02u:%02u:%02u.%03u\">\r\n", h1, m1, s1, ms1, h2, m2, s2, ms2);
|
||||
if (context->encoding!=CCX_ENC_UNICODE)
|
||||
@ -149,8 +149,8 @@ int write_cc_bitmap_as_smptett(struct cc_subtitle *sub, struct encoder_ctx *cont
|
||||
char *buf = (char *) context->buffer;
|
||||
unsigned h1, m1, s1, ms1;
|
||||
unsigned h2, m2, s2, ms2;
|
||||
mstotime (ms_start,&h1,&m1,&s1,&ms1);
|
||||
mstotime (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
millis_to_time (ms_start,&h1,&m1,&s1,&ms1);
|
||||
millis_to_time (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
sprintf ((char *) context->buffer,"<p begin=\"%02u:%02u:%02u.%03u\" end=\"%02u:%02u:%02u.%03u\">\n",h1,m1,s1,ms1, h2,m2,s2,ms2);
|
||||
write (context->out->fh, buf,strlen(buf) );
|
||||
len = strlen(rect[0].ocr_text);
|
||||
@ -212,8 +212,8 @@ int write_cc_buffer_as_smptett(struct eia608_screen *data, struct encoder_ctx *c
|
||||
|
||||
endms = data->end_time;
|
||||
endms--; // To prevent overlapping with next line.
|
||||
mstotime (startms,&h1,&m1,&s1,&ms1);
|
||||
mstotime (endms-1,&h2,&m2,&s2,&ms2);
|
||||
millis_to_time (startms,&h1,&m1,&s1,&ms1);
|
||||
millis_to_time (endms-1,&h2,&m2,&s2,&ms2);
|
||||
|
||||
sprintf ((char *) str,"<p begin=\"%02u:%02u:%02u.%03u\" end=\"%02u:%02u:%02u.%03u\">\n",h1,m1,s1,ms1, h2,m2,s2,ms2);
|
||||
|
||||
|
@ -17,8 +17,8 @@ int write_stringz_as_srt(char *string, struct encoder_ctx *context, LLONG ms_sta
|
||||
if(!string || !string[0])
|
||||
return 0;
|
||||
|
||||
mstotime (ms_start,&h1,&m1,&s1,&ms1);
|
||||
mstotime (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
millis_to_time (ms_start,&h1,&m1,&s1,&ms1);
|
||||
millis_to_time (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
context->srt_counter++;
|
||||
sprintf(timeline, "%u%s", context->srt_counter, context->encoded_crlf);
|
||||
used = encode_line(context, context->buffer,(unsigned char *) timeline);
|
||||
@ -118,8 +118,8 @@ int write_cc_bitmap_as_srt(struct cc_subtitle *sub, struct encoder_ctx *context)
|
||||
{
|
||||
if (context->prev_start != -1 || !(sub->flags & SUB_EOD_MARKER))
|
||||
{
|
||||
mstotime (ms_start,&h1,&m1,&s1,&ms1);
|
||||
mstotime (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
millis_to_time (ms_start,&h1,&m1,&s1,&ms1);
|
||||
millis_to_time (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
context->srt_counter++;
|
||||
sprintf(timeline, "%u\r\n", context->srt_counter);
|
||||
used = encode_line(context, context->buffer,(unsigned char *) timeline);
|
||||
@ -202,8 +202,8 @@ int write_cc_buffer_as_srt(struct eia608_screen *data, struct encoder_ctx *conte
|
||||
|
||||
ms_end = data->end_time;
|
||||
|
||||
mstotime (ms_start,&h1,&m1,&s1,&ms1);
|
||||
mstotime (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
millis_to_time (ms_start,&h1,&m1,&s1,&ms1);
|
||||
millis_to_time (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
char timeline[128];
|
||||
context->srt_counter++;
|
||||
sprintf(timeline, "%u%s", context->srt_counter, context->encoded_crlf);
|
||||
|
@ -15,8 +15,8 @@ int write_stringz_as_ssa(char *string, struct encoder_ctx *context, LLONG ms_sta
|
||||
if(!string || !string[0])
|
||||
return 0;
|
||||
|
||||
mstotime (ms_start,&h1,&m1,&s1,&ms1);
|
||||
mstotime (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
millis_to_time (ms_start,&h1,&m1,&s1,&ms1);
|
||||
millis_to_time (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
|
||||
sprintf (timeline, "Dialogue: 0,%02u:%02u:%02u.%01u,%02u:%02u:%02u.%02u,Default,,0000,0000,0000,,",
|
||||
h1, m1, s1, ms1 / 10, h2, m2, s2, ms2 / 10);
|
||||
@ -113,8 +113,8 @@ int write_cc_bitmap_as_ssa(struct cc_subtitle *sub, struct encoder_ctx *context)
|
||||
{
|
||||
if (context->prev_start != -1 || !(sub->flags & SUB_EOD_MARKER))
|
||||
{
|
||||
mstotime (ms_start,&h1,&m1,&s1,&ms1);
|
||||
mstotime (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
millis_to_time (ms_start,&h1,&m1,&s1,&ms1);
|
||||
millis_to_time (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
|
||||
sprintf (timeline, "Dialogue: 0,%02u:%02u:%02u.%01u,%02u:%02u:%02u.%02u,Default,,0000,0000,0000,,",
|
||||
h1,m1,s1,ms1/10, h2,m2,s2,ms2/10);
|
||||
@ -193,8 +193,8 @@ int write_cc_buffer_as_ssa(struct eia608_screen *data, struct encoder_ctx *conte
|
||||
|
||||
ms_end = data->end_time;
|
||||
|
||||
mstotime (ms_start,&h1,&m1,&s1,&ms1);
|
||||
mstotime (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
millis_to_time (ms_start,&h1,&m1,&s1,&ms1);
|
||||
millis_to_time (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
char timeline[128];
|
||||
sprintf (timeline, "Dialogue: 0,%02u:%02u:%02u.%01u,%02u:%02u:%02u.%02u,Default,,0000,0000,0000,,",
|
||||
h1, m1, s1, ms1 / 10, h2, m2, s2, ms2 / 10);
|
||||
@ -291,4 +291,3 @@ int write_cc_buffer_as_ssa(struct eia608_screen *data, struct encoder_ctx *conte
|
||||
write (context->out->fh, context->encoded_crlf, context->encoded_crlf_length);
|
||||
return wrote_something;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ int write_cc_bitmap_as_transcript(struct cc_subtitle *sub, struct encoder_ctx *c
|
||||
}
|
||||
else
|
||||
{
|
||||
mstotime(start_time + context->subs_delay, &h1, &m1, &s1, &ms1);
|
||||
millis_to_time(start_time + context->subs_delay, &h1, &m1, &s1, &ms1);
|
||||
time_t start_time_int = (start_time + context->subs_delay) / 1000;
|
||||
int start_time_dec = (start_time + context->subs_delay) % 1000;
|
||||
struct tm *start_time_struct = gmtime(&start_time_int);
|
||||
@ -375,4 +375,3 @@ int write_cc_buffer_as_transcript2(struct eia608_screen *data, struct encoder_ct
|
||||
dbg_print(CCX_DMT_DECODER_608, "- - - - - - - - - - - -\r\n");
|
||||
return wrote_something;
|
||||
}
|
||||
|
||||
|
@ -16,8 +16,8 @@ int write_stringz_as_webvtt(char *string, struct encoder_ctx *context, LLONG ms_
|
||||
int written;
|
||||
char timeline[128];
|
||||
|
||||
mstotime(ms_start, &h1, &m1, &s1, &ms1);
|
||||
mstotime(ms_end - 1, &h2, &m2, &s2, &ms2); // -1 To prevent overlapping with next line.
|
||||
millis_to_time(ms_start, &h1, &m1, &s1, &ms1);
|
||||
millis_to_time(ms_end - 1, &h2, &m2, &s2, &ms2); // -1 To prevent overlapping with next line.
|
||||
|
||||
sprintf(timeline, "%02u:%02u:%02u.%03u --> %02u:%02u:%02u.%03u%s",
|
||||
h1, m1, s1, ms1, h2, m2, s2, ms2, context->encoded_crlf);
|
||||
@ -98,9 +98,9 @@ int write_xtimestamp_header(struct encoder_ctx *context)
|
||||
char header_string[200];
|
||||
int used;
|
||||
unsigned h1, m1, s1, ms1;
|
||||
mstotime(context->timing->sync_pts2fts_fts, &h1, &m1, &s1, &ms1);
|
||||
millis_to_time(context->timing->sync_pts2fts_fts, &h1, &m1, &s1, &ms1);
|
||||
sprintf(header_string, "X-TIMESTAMP-MAP=MPEGTS:%ld, LOCAL %02u:%02u:%02u.%03u\r\n",
|
||||
context->timing->sync_pts2fts_pts,
|
||||
context->timing->sync_pts2fts_pts,
|
||||
h1, m1, s1, ms1);
|
||||
used = encode_line(context, context->buffer, (unsigned char *)header_string);
|
||||
write(context->out->fh, context->buffer, used);
|
||||
@ -155,8 +155,8 @@ int write_cc_bitmap_as_webvtt(struct cc_subtitle *sub, struct encoder_ctx *conte
|
||||
{
|
||||
if (context->prev_start != -1 || !(sub->flags & SUB_EOD_MARKER))
|
||||
{
|
||||
mstotime(ms_start, &h1, &m1, &s1, &ms1);
|
||||
mstotime(ms_end - 1, &h2, &m2, &s2, &ms2); // -1 To prevent overlapping with next line.
|
||||
millis_to_time(ms_start, &h1, &m1, &s1, &ms1);
|
||||
millis_to_time(ms_end - 1, &h2, &m2, &s2, &ms2); // -1 To prevent overlapping with next line.
|
||||
context->srt_counter++; // Not needed for WebVTT but let's keep it around for now
|
||||
sprintf(timeline, "%02u:%02u:%02u.%03u --> %02u:%02u:%02u.%03u%s",
|
||||
h1, m1, s1, ms1, h2, m2, s2, ms2, context->encoded_crlf);
|
||||
@ -239,8 +239,8 @@ int write_cc_buffer_as_webvtt(struct eia608_screen *data, struct encoder_ctx *co
|
||||
|
||||
ms_end = data->end_time;
|
||||
|
||||
mstotime(ms_start, &h1, &m1, &s1, &ms1);
|
||||
mstotime(ms_end - 1, &h2, &m2, &s2, &ms2); // -1 To prevent overlapping with next line.
|
||||
millis_to_time(ms_start, &h1, &m1, &s1, &ms1);
|
||||
millis_to_time(ms_end - 1, &h2, &m2, &s2, &ms2); // -1 To prevent overlapping with next line.
|
||||
|
||||
sprintf(timeline, "%02u:%02u:%02u.%03u --> %02u:%02u:%02u.%03u%s",
|
||||
h1, m1, s1, ms1, h2, m2, s2, ms2, context->encoded_crlf);
|
||||
@ -332,7 +332,7 @@ int write_cc_buffer_as_webvtt(struct eia608_screen *data, struct encoder_ctx *co
|
||||
written = write(context->out->fh, context->subline, length);
|
||||
if (written != length)
|
||||
return -1;
|
||||
written = write(context->out->fh,
|
||||
written = write(context->out->fh,
|
||||
context->encoded_crlf, context->encoded_crlf_length);
|
||||
if (written != context->encoded_crlf_length)
|
||||
return -1;
|
||||
|
@ -35,7 +35,7 @@ void xds_write_transcript_line_prefix (struct encoder_ctx *context, struct ccx_s
|
||||
{
|
||||
if (utc_refvalue == UINT64_MAX)
|
||||
{
|
||||
mstotime(start_time + context->subs_delay, &h1, &m1, &s1, &ms1);
|
||||
millis_to_time(start_time + context->subs_delay, &h1, &m1, &s1, &ms1);
|
||||
fdprintf(wb->fh, "%02u:%02u:%02u%c%03u|", h1, m1, s1, context->millis_separator, ms1);
|
||||
}
|
||||
else
|
||||
@ -46,7 +46,7 @@ void xds_write_transcript_line_prefix (struct encoder_ctx *context, struct ccx_s
|
||||
}
|
||||
else
|
||||
{
|
||||
mstotime(start_time + context->subs_delay, &h1, &m1, &s1, &ms1);
|
||||
millis_to_time(start_time + context->subs_delay, &h1, &m1, &s1, &ms1);
|
||||
time_t start_time_int = (start_time + context->subs_delay) / 1000;
|
||||
int start_time_dec = (start_time + context->subs_delay) % 1000;
|
||||
struct tm *start_time_struct = gmtime(&start_time_int);
|
||||
@ -62,7 +62,7 @@ void xds_write_transcript_line_prefix (struct encoder_ctx *context, struct ccx_s
|
||||
{
|
||||
if (utc_refvalue == UINT64_MAX)
|
||||
{
|
||||
mstotime(end_time, &h2, &m2, &s2, &ms2);
|
||||
millis_to_time(end_time, &h2, &m2, &s2, &ms2);
|
||||
fdprintf(wb->fh, "%02u:%02u:%02u%c%03u|", h2, m2, s2, context->millis_separator, ms2);
|
||||
}
|
||||
else
|
||||
@ -72,7 +72,7 @@ void xds_write_transcript_line_prefix (struct encoder_ctx *context, struct ccx_s
|
||||
}
|
||||
else
|
||||
{
|
||||
mstotime(end_time, &h2, &m2, &s2, &ms2);
|
||||
millis_to_time(end_time, &h2, &m2, &s2, &ms2);
|
||||
time_t end_time_int = end_time / 1000;
|
||||
int end_time_dec = end_time % 1000;
|
||||
struct tm *end_time_struct = gmtime(&end_time_int);
|
||||
@ -92,4 +92,3 @@ void xds_write_transcript_line_prefix (struct encoder_ctx *context, struct ccx_s
|
||||
fdprintf(wb->fh, "%s|", XDSclasses_short[cur_xds_packet_class]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
|
||||
unsigned field_number;
|
||||
unsigned cc_data1;
|
||||
unsigned cc_data2;
|
||||
|
||||
|
||||
for (unsigned j=0;j<cc_count;j++)
|
||||
{
|
||||
skip_bits(ustream,2); // priority - unused
|
||||
@ -327,7 +327,7 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
|
||||
dishdata[1]=dcd[1];
|
||||
dishdata[2]=dcd[2];
|
||||
|
||||
dbg_print(CCX_DMT_PARSE, "%s", debug_608toASC( dishdata, 0) );
|
||||
dbg_print(CCX_DMT_PARSE, "%s", debug_608_to_ASC( dishdata, 0) );
|
||||
|
||||
type=dcd[3]; // repeater (0x02 or 0x04)
|
||||
hi = dishdata[1] & 0x7f; // Get only the 7 low bits
|
||||
@ -338,7 +338,7 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
|
||||
dishdata[4]=dishdata[1];
|
||||
dishdata[5]=dishdata[2];
|
||||
|
||||
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608toASC( dishdata+3, 0) );
|
||||
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608_to_ASC( dishdata+3, 0) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -369,8 +369,8 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
|
||||
dishdata[5]=dcd[4];
|
||||
dishdata[6] = 0xFF; // Set end marker
|
||||
|
||||
dbg_print(CCX_DMT_PARSE, "%s", debug_608toASC( dishdata, 0) );
|
||||
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608toASC( dishdata+3, 0) );
|
||||
dbg_print(CCX_DMT_PARSE, "%s", debug_608_to_ASC( dishdata, 0) );
|
||||
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608_to_ASC( dishdata+3, 0) );
|
||||
|
||||
store_hdcc(ctx, dishdata, cc_count, ctx->timing->current_tref, ctx->timing->fts_now, sub);
|
||||
|
||||
@ -406,7 +406,7 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
|
||||
type=dcd[0]; // repeater (0x02 or 0x04)
|
||||
dcd++; // Skip the repeater byte.
|
||||
|
||||
dbg_print(CCX_DMT_PARSE, " - R:%02X :%s", type, debug_608toASC( dishdata, 0) );
|
||||
dbg_print(CCX_DMT_PARSE, " - R:%02X :%s", type, debug_608_to_ASC( dishdata, 0) );
|
||||
|
||||
hi = dishdata[1] & 0x7f; // Get only the 7 low bits
|
||||
if (type==0x04 && hi<32)
|
||||
@ -415,7 +415,7 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
|
||||
dishdata[3]=0x04; // Field 1
|
||||
dishdata[4]=dishdata[1];
|
||||
dishdata[5]=dishdata[2];
|
||||
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608toASC( dishdata+3, 0) );
|
||||
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608_to_ASC( dishdata+3, 0) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -433,8 +433,8 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
|
||||
dishdata[5]=dcd[1];
|
||||
dishdata[6] = 0xFF; // Set end marker
|
||||
|
||||
dbg_print(CCX_DMT_PARSE, ":%s", debug_608toASC( dishdata, 0) );
|
||||
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608toASC( dishdata+3, 0) );
|
||||
dbg_print(CCX_DMT_PARSE, ":%s", debug_608_to_ASC( dishdata, 0) );
|
||||
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608_to_ASC( dishdata+3, 0) );
|
||||
}
|
||||
|
||||
store_hdcc(ctx, dishdata, cc_count, ctx->timing->current_tref, ctx->timing->fts_now, sub);
|
||||
@ -474,7 +474,7 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
|
||||
uint8_t line_type;
|
||||
uint8_t field = 1;
|
||||
read_bytes(ustream, 4); //skip header code
|
||||
read_bytes(ustream, 2); //skip data length
|
||||
read_bytes(ustream, 2); //skip data length
|
||||
line_nb = read_bits(ustream, 16);
|
||||
line_type = read_u8(ustream);
|
||||
field = (line_type & 0x03);
|
||||
@ -488,7 +488,7 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
|
||||
if (udatalen < 720)
|
||||
mprint("MPEG:VBI: Minimum 720 bytes in luma line required\n");
|
||||
|
||||
decode_vbi(ctx, field, ustream->pos, 720, sub);
|
||||
decode_vbi(ctx, field, ustream->pos, 720, sub);
|
||||
dbg_print(CCX_DMT_VERBOSE, "GXF (vbi line %d) user data:\n", line_nb);
|
||||
}
|
||||
else
|
||||
|
@ -68,7 +68,7 @@ void store_hdcc(struct lib_cc_decode *ctx, unsigned char *cc_data, int cc_count,
|
||||
printf("\nCC blocks, channel 0:\n");
|
||||
for ( int i=0; i < cc_count*3; i+=3)
|
||||
{
|
||||
printf("%s", debug_608toASC( cc_data+i, 0) );
|
||||
printf("%s", debug_608_to_ASC( cc_data+i, 0) );
|
||||
}
|
||||
printf("\n");
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user