check: add another generic converter test
authorWim Taymans <wtaymans@redhat.com>
Wed, 4 Mar 2015 11:28:47 +0000 (12:28 +0100)
committerWim Taymans <wtaymans@redhat.com>
Wed, 4 Mar 2015 11:29:45 +0000 (12:29 +0100)
Run conversion and scaling with borders.

tests/check/libs/video.c

index ef648b8..da484dc 100644 (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);