summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2020-07-03 00:47:09 +1000
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-07-03 06:54:46 +0000
commitebd1b2c9296ee9bd625af03cde4de1f7f36b39e6 (patch)
tree798b41a87da3c5f8a73d7e1c19946c9b35ef1657 /tests
parent327a79e98209ba3b56632b09b606a7708ca28100 (diff)
downloadgstreamer-plugins-bad-ebd1b2c9296ee9bd625af03cde4de1f7f36b39e6.tar.gz
ccconverter: write the cdp timecode data correctly
We were mixing up the tens part with the unit parts all over the place. e.g. 12 seconds would be encoded as 0x21 instead of the correct 0x12 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1400>
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/ccconverter.c50
1 files changed, 28 insertions, 22 deletions
diff --git a/tests/check/elements/ccconverter.c b/tests/check/elements/ccconverter.c
index 868113e6c..556e26d9d 100644
--- a/tests/check/elements/ccconverter.c
+++ b/tests/check/elements/ccconverter.c
@@ -526,17 +526,17 @@ GST_START_TEST (convert_cea708_cdp_cea708_cdp_double_framerate)
GstVideoTimeCode in_tc1;
const GstVideoTimeCode *in_tc[] = { &in_tc1 };
- const guint8 out1[] = { 0x96, 0x69, 0x30, 0x8f, 0xc3, 0x00, 0x00, 0x71, 0xd0,
- 0xa0, 0x30, 0x00, 0x72, 0xea, 0xfc, 0x01, 0x02, 0xfe, 0x05, 0x06, 0xfe,
+ const guint8 out1[] = { 0x96, 0x69, 0x30, 0x8f, 0xc3, 0x00, 0x00, 0x71, 0xc1,
+ 0x82, 0x03, 0x08, 0x72, 0xea, 0xfc, 0x01, 0x02, 0xfe, 0x05, 0x06, 0xfe,
0x07, 0x08, 0xfe, 0x09, 0x0a, 0xfe, 0x0b, 0x0c, 0xfe, 0x0d, 0x0e, 0xfe,
0x0f, 0x10, 0xfe, 0x11, 0x12, 0xfe, 0x13, 0x14, 0xfe, 0x15, 0x16, 0x74,
- 0x00, 0x00, 0xbe
+ 0x00, 0x00, 0x10
};
- const guint8 out2[] = { 0x96, 0x69, 0x30, 0x8f, 0xc3, 0x00, 0x01, 0x71, 0xd0,
- 0xa0, 0x30, 0x10, 0x72, 0xea, 0xfc, 0x03, 0x04, 0xfe, 0x17, 0x18, 0xfe,
+ const guint8 out2[] = { 0x96, 0x69, 0x30, 0x8f, 0xc3, 0x00, 0x01, 0x71, 0xc1,
+ 0x82, 0x03, 0x09, 0x72, 0xea, 0xfc, 0x03, 0x04, 0xfe, 0x17, 0x18, 0xfe,
0x19, 0x1a, 0xfe, 0x1b, 0x1c, 0xfe, 0x1d, 0x1e, 0xfe, 0x1f, 0x20, 0xfe,
0x21, 0x22, 0xfe, 0x23, 0x24, 0xfe, 0x25, 0x26, 0xfe, 0x27, 0x28, 0x74,
- 0x00, 0x01, 0x64
+ 0x00, 0x01, 0xc5
};
const guint8 *out[] = { out1, out2 };
guint out_len[] = { sizeof (out1), sizeof (out2) };
@@ -587,13 +587,13 @@ GST_START_TEST (convert_cea708_cdp_cea708_cdp_half_framerate)
const GstVideoTimeCode *in_tc[] = { &in_tc1, &in_tc2 };
const guint8 out1[] =
- { 0x96, 0x69, 0x4e, 0x5f, 0xc3, 0x00, 0x00, 0x71, 0xd0, 0xa0, 0x30, 0x00,
+ { 0x96, 0x69, 0x4e, 0x5f, 0xc3, 0x00, 0x00, 0x71, 0xc1, 0x82, 0x03, 0x04,
0x72, 0xf4, 0xfc, 0x01, 0x02, 0xfc, 0x14, 0x15, 0xfe, 0x03, 0x04, 0xfe,
0x05, 0x06, 0xfe, 0x07, 0x08, 0xfe, 0x09, 0x0a, 0xfe, 0x0b, 0x0c, 0xfe,
0x0d, 0x0e, 0xfe, 0x0f, 0x10, 0xfe, 0x11, 0x12, 0xfe, 0x13, 0x14, 0xfe,
0x16, 0x17, 0xfe, 0x18, 0x19, 0xfe, 0x1a, 0x1b, 0xfe, 0x1c, 0x1d, 0xfe,
0x1e, 0x1f, 0xfe, 0x20, 0x21, 0xfe, 0x22, 0x23, 0xfe, 0x24, 0x25, 0xfe,
- 0x26, 0x27, 0x74, 0x00, 0x00, 0xb2
+ 0x26, 0x27, 0x74, 0x00, 0x00, 0x08
};
const guint8 *out[] = { out1 };
guint out_len[] = { sizeof (out1) };
@@ -776,42 +776,48 @@ GST_START_TEST (convert_cea708_cdp_cea708_cdp_from_drop_frame_scaling)
const GstVideoTimeCode *in_tc[] = { &in_tc1, &in_tc2 };
const guint8 out1[] =
- { 0x96, 0x69, 0x30, 0x8f, 0xc3, 0x00, 0x00, 0x71, 0xc0, 0x90, 0x12, 0x12,
- 0x72, 0xea, 0xfc, 0x80, 0x80, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa,
+ { 0x96, 0x69, 0x4e, 0x5f, 0xc3, 0x00, 0x00, 0x71, 0xc0, 0x81, 0x59, 0x29,
+ 0x72, 0xf4, 0xfc, 0x80, 0x80, 0xf8, 0x80, 0x80, 0xfa, 0x00, 0x00, 0xfa,
0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa,
- 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x74, 0x00, 0x00, 0x04
+ 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa,
+ 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa,
+ 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa,
+ 0x00, 0x00, 0x74, 0x00, 0x00, 0xfb
};
const guint8 out2[] =
- { 0x96, 0x69, 0x30, 0x8f, 0xc3, 0x00, 0x01, 0x71, 0xc0, 0xa0, 0x00, 0x00,
- 0x72, 0xea, 0xfc, 0x80, 0x80, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa,
+ { 0x96, 0x69, 0x4e, 0x5f, 0xc3, 0x00, 0x01, 0x71, 0xc0, 0x82, 0x00, 0x00,
+ 0x72, 0xf4, 0xfc, 0x80, 0x80, 0xf8, 0x80, 0x80, 0xfa, 0x00, 0x00, 0xfa,
+ 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa,
+ 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa,
+ 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa,
0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa,
- 0x00, 0x00, 0xfa, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x74, 0x00, 0x01, 0x16
+ 0x00, 0x00, 0x74, 0x00, 0x01, 0x7a
};
const guint8 *out[] = { out1, out2 };
guint out_len[] = { sizeof (out1), sizeof (out2) };
GstVideoTimeCode out_tc1, out_tc2;
const GstVideoTimeCode *out_tc[] = { &out_tc1, &out_tc2 };
- gst_video_time_code_init (&in_tc1, 60000, 1001, NULL,
- GST_VIDEO_TIME_CODE_FLAGS_DROP_FRAME, 0, 1, 59, 59, 0);
+ gst_video_time_code_init (&in_tc1, 30000, 1001, NULL,
+ GST_VIDEO_TIME_CODE_FLAGS_DROP_FRAME, 0, 1, 59, 29, 0);
fail_unless (gst_video_time_code_is_valid (&in_tc1));
- gst_video_time_code_init (&in_tc2, 60000, 1001, NULL,
+ gst_video_time_code_init (&in_tc2, 30000, 1001, NULL,
GST_VIDEO_TIME_CODE_FLAGS_DROP_FRAME, 0, 2, 0, 4, 0);
fail_unless (gst_video_time_code_is_valid (&in_tc2));
- gst_video_time_code_init (&out_tc1, 60, 1, NULL,
- GST_VIDEO_TIME_CODE_FLAGS_NONE, 0, 1, 59, 59, 0);
+ gst_video_time_code_init (&out_tc1, 30, 1, NULL,
+ GST_VIDEO_TIME_CODE_FLAGS_NONE, 0, 1, 59, 29, 0);
fail_unless (gst_video_time_code_is_valid (&out_tc1));
- gst_video_time_code_init (&out_tc2, 60, 1, NULL,
+ gst_video_time_code_init (&out_tc2, 30, 1, NULL,
GST_VIDEO_TIME_CODE_FLAGS_NONE, 0, 2, 0, 0, 0);
fail_unless (gst_video_time_code_is_valid (&out_tc2));
check_conversion_multiple (G_N_ELEMENTS (in_len), in, in_len,
G_N_ELEMENTS (out_len), out, out_len,
- "closedcaption/x-cea-708,format=(string)cdp,framerate=(fraction)60000/1001",
- "closedcaption/x-cea-708,format=(string)cdp,framerate=(fraction)60/1",
+ "closedcaption/x-cea-708,format=(string)cdp,framerate=(fraction)30000/1001",
+ "closedcaption/x-cea-708,format=(string)cdp,framerate=(fraction)30/1",
in_tc, out_tc, FLAG_SEND_EOS);
gst_video_time_code_clear (&in_tc1);