check: add another generic converter test

Run conversion and scaling with borders.
This commit is contained in:
Wim Taymans 2015-03-04 12:28:47 +01:00
parent e0a192d3dd
commit 72fd1345ad

View file

@ -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);