summaryrefslogtreecommitdiff
path: root/tests/test-rgb-upload.c
diff options
context:
space:
mode:
authorEdward Hervey <edward.hervey@collabora.co.uk>2011-10-20 12:11:45 +0200
committerEdward Hervey <edward.hervey@collabora.co.uk>2012-07-12 16:17:53 +0200
commite02d8c7a3a140fb9f607ed14f8f233843b09d757 (patch)
treea38741ed971ede9180edcfa33b4f9eb0e8ef013b /tests/test-rgb-upload.c
parentab78d2d6f25d31205f1b7a50b004275074d549da (diff)
port to GStreamer 1.0
Contributions from: Alban Browaeys <prahal@yahoo.com>
Diffstat (limited to 'tests/test-rgb-upload.c')
-rw-r--r--tests/test-rgb-upload.c23
1 files changed, 12 insertions, 11 deletions
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));