summaryrefslogtreecommitdiff
path: root/tests/check/libs/video.c
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2015-03-04 12:28:47 +0100
committerWim Taymans <wtaymans@redhat.com>2015-03-04 12:29:45 +0100
commit72fd1345ad946b586d016fd84f3d9c04d0c6548f (patch)
treec6d8728b60c14203225450223353ec2802f08684 /tests/check/libs/video.c
parente0a192d3dde09e52e24f0e91d2b7eddd135a04ed (diff)
downloadgstreamer-plugins-base-72fd1345ad946b586d016fd84f3d9c04d0c6548f.tar.gz
check: add another generic converter test
Run conversion and scaling with borders.
Diffstat (limited to 'tests/check/libs/video.c')
-rw-r--r--tests/check/libs/video.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/check/libs/video.c b/tests/check/libs/video.c
index ef648b850..da484dc49 100644
--- a/tests/check/libs/video.c
+++ b/tests/check/libs/video.c
@@ -2267,6 +2267,8 @@ GST_START_TEST (test_video_convert)
outbuffer = gst_buffer_new_and_alloc (outinfo.size);
gst_video_frame_map (&outframe, &outinfo, outbuffer, GST_MAP_WRITE);
+ /* see that we don't reuse the source line directly because we need
+ * to add borders to it */
convert = gst_video_converter_new (&ininfo, &outinfo,
gst_structure_new ("options",
GST_VIDEO_CONVERTER_OPT_RESAMPLER_METHOD,
@@ -2283,6 +2285,24 @@ GST_START_TEST (test_video_convert)
gst_video_converter_frame (convert, &inframe, &outframe);
gst_video_converter_free (convert);
+ /* see that we reuse the source line directly because we need to scale
+ * it first */
+ convert = gst_video_converter_new (&ininfo, &outinfo,
+ gst_structure_new ("options",
+ GST_VIDEO_CONVERTER_OPT_RESAMPLER_METHOD,
+ GST_TYPE_VIDEO_RESAMPLER_METHOD, 3,
+ GST_VIDEO_CONVERTER_OPT_SRC_X, G_TYPE_INT, 10,
+ GST_VIDEO_CONVERTER_OPT_SRC_Y, G_TYPE_INT, 0,
+ GST_VIDEO_CONVERTER_OPT_SRC_WIDTH, G_TYPE_INT, 300,
+ GST_VIDEO_CONVERTER_OPT_SRC_HEIGHT, G_TYPE_INT, 220,
+ GST_VIDEO_CONVERTER_OPT_DEST_X, G_TYPE_INT, 80,
+ GST_VIDEO_CONVERTER_OPT_DEST_Y, G_TYPE_INT, 60,
+ GST_VIDEO_CONVERTER_OPT_DEST_WIDTH, G_TYPE_INT, 310,
+ GST_VIDEO_CONVERTER_OPT_DEST_HEIGHT, G_TYPE_INT, 230, NULL));
+
+ gst_video_converter_frame (convert, &inframe, &outframe);
+ gst_video_converter_free (convert);
+
gst_video_frame_unmap (&outframe);
gst_buffer_unref (outbuffer);
gst_video_frame_unmap (&inframe);