ccconverter: Fill remainder of the cc_data in CDP packets with empty packets

Instead of filling it completely with zeroes. Filling with zeroes is
considered invalid by various CC implementations.
This commit is contained in:
Sebastian Dröge 2020-01-23 18:08:53 +02:00 committed by Sebastian Dröge
parent 20d85c95d0
commit 0478e2dc1a
2 changed files with 14 additions and 11 deletions

View File

@ -533,8 +533,11 @@ convert_cea708_cc_data_cea708_cdp_internal (GstCCConverter * self,
gst_byte_writer_put_uint8_unchecked (&bw, 0x72); gst_byte_writer_put_uint8_unchecked (&bw, 0x72);
gst_byte_writer_put_uint8_unchecked (&bw, 0xe0 | cc_count); gst_byte_writer_put_uint8_unchecked (&bw, 0xe0 | cc_count);
gst_byte_writer_put_data_unchecked (&bw, cc_data, cc_data_len); gst_byte_writer_put_data_unchecked (&bw, cc_data, cc_data_len);
if (cc_count > cc_data_len / 3) { while (cc_count > cc_data_len / 3) {
gst_byte_writer_fill (&bw, 0, 3 * cc_count - cc_data_len); gst_byte_writer_put_uint8_unchecked (&bw, 0xf8);
gst_byte_writer_put_uint8_unchecked (&bw, 0x00);
gst_byte_writer_put_uint8_unchecked (&bw, 0x00);
cc_data_len += 3;
} }
gst_byte_writer_put_uint8_unchecked (&bw, 0x74); gst_byte_writer_put_uint8_unchecked (&bw, 0x74);

View File

@ -195,9 +195,9 @@ GST_START_TEST (convert_cea608_raw_cea708_cdp)
const guint8 in[] = { 0x80, 0x80 }; const guint8 in[] = { 0x80, 0x80 };
const guint8 out[] = const guint8 out[] =
{ 0x96, 0x69, 0x2b, 0x8f, 0x43, 0x00, 0x00, 0x72, 0xea, 0xfc, 0x80, 0x80, { 0x96, 0x69, 0x2b, 0x8f, 0x43, 0x00, 0x00, 0x72, 0xea, 0xfc, 0x80, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00,
0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x38 0xf8, 0x00, 0x00, 0x74, 0x00, 0x00, 0x80
}; };
check_conversion (in, sizeof (in), out, sizeof (out), check_conversion (in, sizeof (in), out, sizeof (out),
"closedcaption/x-cea-608,format=(string)raw,framerate=(fraction)60/1", "closedcaption/x-cea-608,format=(string)raw,framerate=(fraction)60/1",
@ -247,9 +247,9 @@ GST_START_TEST (convert_cea608_s334_1a_cea708_cdp)
const guint8 in[] = { 0x80, 0x80, 0x80, 0x00, 0x80, 0x80 }; const guint8 in[] = { 0x80, 0x80, 0x80, 0x00, 0x80, 0x80 };
const guint8 out[] = const guint8 out[] =
{ 0x96, 0x69, 0x2b, 0x8f, 0x43, 0x00, 0x00, 0x72, 0xea, 0xfc, 0x80, 0x80, { 0x96, 0x69, 0x2b, 0x8f, 0x43, 0x00, 0x00, 0x72, 0xea, 0xfc, 0x80, 0x80,
0xfd, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x80, 0x80, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00,
0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x3b 0xf8, 0x00, 0x00, 0x74, 0x00, 0x00, 0x7b
}; };
check_conversion (in, sizeof (in), out, sizeof (out), check_conversion (in, sizeof (in), out, sizeof (out),
"closedcaption/x-cea-608,format=(string)s334-1a,framerate=(fraction)60/1", "closedcaption/x-cea-608,format=(string)s334-1a,framerate=(fraction)60/1",
@ -285,9 +285,9 @@ GST_START_TEST (convert_cea708_cc_data_cea708_cdp)
const guint8 in[] = { 0xfc, 0x80, 0x80, 0xfe, 0x80, 0x80 }; const guint8 in[] = { 0xfc, 0x80, 0x80, 0xfe, 0x80, 0x80 };
const guint8 out[] = const guint8 out[] =
{ 0x96, 0x69, 0x2b, 0x8f, 0x43, 0x00, 0x00, 0x72, 0xea, 0xfc, 0x80, 0x80, { 0x96, 0x69, 0x2b, 0x8f, 0x43, 0x00, 0x00, 0x72, 0xea, 0xfc, 0x80, 0x80,
0xfe, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, 0x80, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0x00, 0x00,
0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x3a 0xf8, 0x00, 0x00, 0x74, 0x00, 0x00, 0x7a
}; };
check_conversion (in, sizeof (in), out, sizeof (out), check_conversion (in, sizeof (in), out, sizeof (out),
"closedcaption/x-cea-708,format=(string)cc_data,framerate=(fraction)60/1", "closedcaption/x-cea-708,format=(string)cc_data,framerate=(fraction)60/1",