summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test-alpha.c11
-rw-r--r--tests/test-rgb-upload.c23
-rw-r--r--tests/test-yuv-upload.c14
3 files changed, 19 insertions, 29 deletions
diff --git a/tests/test-alpha.c b/tests/test-alpha.c
index 79786c9..238508e 100644
--- a/tests/test-alpha.c
+++ b/tests/test-alpha.c
@@ -171,9 +171,8 @@ main (int argc, char *argv[])
/* make videotestsrc spit the format we want */
if (g_strcmp0 (opt_fourcc, "RGB ") == 0)
{
- caps = gst_caps_new_simple ("video/x-raw-rgb",
- "bpp", G_TYPE_INT, opt_bpp,
- "depth", G_TYPE_INT, opt_depth,
+ caps = gst_caps_new_simple ("video/x-raw",
+ "format", G_TYPE_STRING, "RGB",
"framerate", GST_TYPE_FRACTION,
opt_framerate, 1,
NULL);
@@ -181,9 +180,9 @@ main (int argc, char *argv[])
}
else
{
- caps = gst_caps_new_simple ("video/x-raw-yuv",
- "format", GST_TYPE_FOURCC,
- parse_fourcc (opt_fourcc),
+ caps = gst_caps_new_simple ("video/x-raw",
+ "format", G_TYPE_STRING,
+ opt_fourcc,
"framerate", GST_TYPE_FRACTION,
opt_framerate, 1,
NULL);
diff --git a/tests/test-rgb-upload.c b/tests/test-rgb-upload.c
index 57dde63..22f77c5 100644
--- a/tests/test-rgb-upload.c
+++ b/tests/test-rgb-upload.c
@@ -29,6 +29,7 @@
#include <string.h>
#include <glib/gprintf.h>
+#include <gst/video/video.h>
#include <clutter-gst/clutter-gst.h>
static gint opt_framerate = 30;
@@ -111,6 +112,7 @@ main (int argc, char *argv[])
GstElement *capsfilter;
GstElement *sink;
GstCaps *caps;
+ GstVideoFormat format;
if (!g_thread_supported ())
g_thread_init (NULL);
@@ -152,17 +154,16 @@ main (int argc, char *argv[])
sink = gst_element_factory_make ("cluttersink", NULL);
g_object_set (sink, "texture", CLUTTER_TEXTURE (texture), NULL);
- /* make videotestsrc spit the format we want */
- caps = gst_caps_new_simple ("video/x-raw-rgb",
- "bpp", G_TYPE_INT, opt_bpp,
- "depth", G_TYPE_INT, opt_depth,
- "framerate", GST_TYPE_FRACTION, opt_framerate, 1,
-#if 0
- "red_mask", G_TYPE_INT, 0xff000000,
- "green_mask", G_TYPE_INT, 0x00ff0000,
- "blue_mask", G_TYPE_INT, 0x0000ff00,
-#endif
- NULL);
+ format = gst_video_format_from_masks(opt_depth, opt_bpp, G_BIG_ENDIAN,
+ 0xff0000,
+ 0x00ff00,
+ 0x0000ff,
+ 0x00000000);
+
+ caps = gst_caps_new_simple ("video/x-raw",
+ "format", G_TYPE_STRING, gst_video_format_to_string(format),
+ "framerate", GST_TYPE_FRACTION, opt_framerate, 1,
+ NULL);
g_object_set (capsfilter, "caps", caps, NULL);
g_printf ("%s: [caps] %s\n", __FILE__, gst_caps_to_string (caps));
diff --git a/tests/test-yuv-upload.c b/tests/test-yuv-upload.c
index ca1ff18..a8ee1dd 100644
--- a/tests/test-yuv-upload.c
+++ b/tests/test-yuv-upload.c
@@ -52,15 +52,6 @@ static GOptionEntry options[] =
{ NULL }
};
-static guint32
-parse_fourcc (const gchar *fourcc)
-{
- if (strlen (fourcc) != 4)
- return 0;
-
- return GST_STR_FOURCC (fourcc);
-}
-
void
size_change (ClutterTexture *texture,
gint width,
@@ -151,9 +142,8 @@ main (int argc, char *argv[])
g_object_set (sink, "texture", CLUTTER_TEXTURE (texture), NULL);
/* make videotestsrc spit the format we want */
- caps = gst_caps_new_simple ("video/x-raw-yuv",
- "format", GST_TYPE_FOURCC,
- parse_fourcc (opt_fourcc),
+ caps = gst_caps_new_simple ("video/x-raw",
+ "format", G_TYPE_STRING, opt_fourcc,
"framerate", GST_TYPE_FRACTION, opt_framerate, 1,
NULL);
g_object_set (capsfilter, "caps", caps, NULL);