diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2018-12-05 18:46:52 +0200 |
---|---|---|
committer | Sebastian Dröge <slomo@coaxion.net> | 2018-12-06 16:06:05 +0000 |
commit | f0571a94fbc9536728340031f9b03d3305bf41de (patch) | |
tree | b43980dddc007fd36f7def1d1b4837e596a719c0 /tests | |
parent | e0adbee49a0571734303ce24d03238fc6a2d7c56 (diff) | |
download | gstreamer-plugins-bad-f0571a94fbc9536728340031f9b03d3305bf41de.tar.gz |
ccextractor: Include framerate in the closedcaption caps
It depends on the framerate how many cc_data byte pairs are allowed per
frame, and the framerate is also needed for converting into the CDP or
MCC format as the framerate is part of the header metadata.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/elements/ccextractor.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/tests/check/elements/ccextractor.c b/tests/check/elements/ccextractor.c index 4dd21a7c6..953e9b03e 100644 --- a/tests/check/elements/ccextractor.c +++ b/tests/check/elements/ccextractor.c @@ -28,11 +28,19 @@ #include <string.h> -static GstStaticCaps foo_bar_caps = GST_STATIC_CAPS ("foo/bar"); +#define VIDEO_CAPS_STR "video/x-raw, " \ + "format = (string) UYVY, " \ + "width = (int) 1920, " \ + "height = (int) 1080, " \ + "framerate = (fraction) 30/1" + +static GstStaticCaps video_caps = GST_STATIC_CAPS (VIDEO_CAPS_STR); static GstStaticCaps cea708_cc_data_caps = -GST_STATIC_CAPS ("closedcaption/x-cea-708,format=(string) cc_data"); + GST_STATIC_CAPS + ("closedcaption/x-cea-708,format=(string) cc_data, framerate = (fraction) 30/1"); static GstStaticCaps cea708_cdp_caps = -GST_STATIC_CAPS ("closedcaption/x-cea-708,format=(string) cdp"); + GST_STATIC_CAPS + ("closedcaption/x-cea-708,format=(string) cdp, framerate = (fraction) 30/1"); GST_START_TEST (no_captions) { @@ -42,7 +50,7 @@ GST_START_TEST (no_captions) h = gst_harness_new ("ccextractor"); - gst_harness_set_src_caps_str (h, "foo/bar"); + gst_harness_set_src_caps_str (h, VIDEO_CAPS_STR); buf = gst_buffer_new_and_alloc (128); outbuf = gst_harness_push_and_pull (h, gst_buffer_ref (buf)); @@ -54,7 +62,7 @@ GST_START_TEST (no_captions) caps = gst_pad_get_current_caps (h->sinkpad); fail_unless (caps != NULL); fail_unless (gst_caps_can_intersect (caps, - gst_static_caps_get (&foo_bar_caps))); + gst_static_caps_get (&video_caps))); gst_caps_unref (caps); gst_buffer_unref (buf); @@ -85,7 +93,7 @@ GST_START_TEST (captions) g_signal_connect (h->element, "pad-added", G_CALLBACK (on_caption_pad_added), h2); - gst_harness_set_src_caps_str (h, "foo/bar"); + gst_harness_set_src_caps_str (h, VIDEO_CAPS_STR); buf = gst_buffer_new_and_alloc (128); gst_buffer_add_video_caption_meta (buf, GST_VIDEO_CAPTION_TYPE_CEA708_RAW, @@ -108,7 +116,7 @@ GST_START_TEST (captions) caps = gst_pad_get_current_caps (h->sinkpad); fail_unless (caps != NULL); fail_unless (gst_caps_can_intersect (caps, - gst_static_caps_get (&foo_bar_caps))); + gst_static_caps_get (&video_caps))); gst_caps_unref (caps); caps = gst_pad_get_current_caps (h2->sinkpad); @@ -138,7 +146,7 @@ GST_START_TEST (captions) caps = gst_pad_get_current_caps (h->sinkpad); fail_unless (caps != NULL); fail_unless (gst_caps_can_intersect (caps, - gst_static_caps_get (&foo_bar_caps))); + gst_static_caps_get (&video_caps))); gst_caps_unref (caps); caps = gst_pad_get_current_caps (h2->sinkpad); @@ -166,7 +174,7 @@ GST_START_TEST (no_captions_at_beginning_and_end) g_signal_connect (h->element, "pad-added", G_CALLBACK (on_caption_pad_added), h2); - gst_harness_set_src_caps_str (h, "foo/bar"); + gst_harness_set_src_caps_str (h, VIDEO_CAPS_STR); buf = gst_buffer_new_and_alloc (128); @@ -191,7 +199,7 @@ GST_START_TEST (no_captions_at_beginning_and_end) caps = gst_pad_get_current_caps (h->sinkpad); fail_unless (caps != NULL); fail_unless (gst_caps_can_intersect (caps, - gst_static_caps_get (&foo_bar_caps))); + gst_static_caps_get (&video_caps))); gst_caps_unref (caps); fail_unless (h2->sinkpad != NULL); @@ -204,7 +212,7 @@ GST_START_TEST (no_captions_at_beginning_and_end) caps = gst_pad_get_current_caps (h->sinkpad); fail_unless (caps != NULL); fail_unless (gst_caps_can_intersect (caps, - gst_static_caps_get (&foo_bar_caps))); + gst_static_caps_get (&video_caps))); gst_caps_unref (caps); caps = gst_pad_get_current_caps (h2->sinkpad); @@ -227,7 +235,7 @@ GST_START_TEST (no_captions_at_beginning_and_end) caps = gst_pad_get_current_caps (h->sinkpad); fail_unless (caps != NULL); fail_unless (gst_caps_can_intersect (caps, - gst_static_caps_get (&foo_bar_caps))); + gst_static_caps_get (&video_caps))); gst_caps_unref (caps); caps = gst_pad_get_current_caps (h2->sinkpad); @@ -255,7 +263,7 @@ GST_START_TEST (captions_format_change) g_signal_connect (h->element, "pad-added", G_CALLBACK (on_caption_pad_added), h2); - gst_harness_set_src_caps_str (h, "foo/bar"); + gst_harness_set_src_caps_str (h, VIDEO_CAPS_STR); buf = gst_buffer_new_and_alloc (128); gst_buffer_add_video_caption_meta (buf, GST_VIDEO_CAPTION_TYPE_CEA708_RAW, @@ -278,7 +286,7 @@ GST_START_TEST (captions_format_change) caps = gst_pad_get_current_caps (h->sinkpad); fail_unless (caps != NULL); fail_unless (gst_caps_can_intersect (caps, - gst_static_caps_get (&foo_bar_caps))); + gst_static_caps_get (&video_caps))); gst_caps_unref (caps); caps = gst_pad_get_current_caps (h2->sinkpad); @@ -308,7 +316,7 @@ GST_START_TEST (captions_format_change) caps = gst_pad_get_current_caps (h->sinkpad); fail_unless (caps != NULL); fail_unless (gst_caps_can_intersect (caps, - gst_static_caps_get (&foo_bar_caps))); + gst_static_caps_get (&video_caps))); gst_caps_unref (caps); caps = gst_pad_get_current_caps (h2->sinkpad); |