videoscale: Add test to ensure that non-scaled metas are kept

Just make sure that we're not breaking non-scaled metas

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1630>
This commit is contained in:
Olivier Crête 2022-04-20 16:25:49 -05:00 committed by GStreamer Marge Bot
parent 2290af332b
commit 2613930372

View file

@ -22,6 +22,7 @@
#include <gst/video/video.h> #include <gst/video/video.h>
#include <gst/base/gstbasesink.h> #include <gst/base/gstbasesink.h>
#include <gst/rtp/rtp.h>
#include <gst/check/gstcheck.h> #include <gst/check/gstcheck.h>
#include <gst/check/gstharness.h> #include <gst/check/gstharness.h>
@ -973,6 +974,8 @@ GST_START_TEST (test_transform_meta)
const guint8 data[16] = { 0 }; const guint8 data[16] = { 0 };
GstCaps *caps; GstCaps *caps;
GstVideoRegionOfInterestMeta *roi_meta; GstVideoRegionOfInterestMeta *roi_meta;
GstRTPSourceMeta *rtp_source_meta;
guint32 ssrc = 1234;
h = gst_harness_new ("videoscale"); h = gst_harness_new ("videoscale");
@ -981,6 +984,7 @@ GST_START_TEST (test_transform_meta)
caps = gst_caps_new_empty_simple ("timestamp/test"); caps = gst_caps_new_empty_simple ("timestamp/test");
gst_buffer_add_video_region_of_interest_meta (buffer, "face", 0, 1, 2, 3); gst_buffer_add_video_region_of_interest_meta (buffer, "face", 0, 1, 2, 3);
rtp_source_meta = gst_buffer_add_rtp_source_meta (buffer, &ssrc, NULL, 0);
gst_harness_set_sink_caps_str (h, gst_harness_set_sink_caps_str (h,
"video/x-raw,width=8,height=8,format=GRAY8"); "video/x-raw,width=8,height=8,format=GRAY8");
@ -999,6 +1003,11 @@ GST_START_TEST (test_transform_meta)
fail_unless_equals_int (roi_meta->w, 4); fail_unless_equals_int (roi_meta->w, 4);
fail_unless_equals_int (roi_meta->h, 6); fail_unless_equals_int (roi_meta->h, 6);
rtp_source_meta = gst_buffer_get_rtp_source_meta (buffer);
fail_unless (rtp_source_meta != NULL);
fail_unless (rtp_source_meta->ssrc_valid);
fail_unless_equals_int (rtp_source_meta->ssrc, ssrc);
gst_buffer_unref (buffer); gst_buffer_unref (buffer);
gst_caps_unref (caps); gst_caps_unref (caps);
gst_harness_teardown (h); gst_harness_teardown (h);