diff options
author | Mathieu Duponchelle <mathieu.duponchelle@epitech.eu> | 2013-07-16 18:28:33 +0200 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2013-07-17 11:11:07 +0200 |
commit | 74dda28907cab7cd39f6961f86172d0001aa9208 (patch) | |
tree | c114adba1f38da5900e14c3eb9e2206525c7ab4d | |
parent | d868b734996b7b2e36d52d0283f4966f213167da (diff) |
tests/examples: port some of the examples.
This commit is a first step, removes glupload, switch new-decoded-pad
to pad-added, but these examples still fail for various reasons.
-rw-r--r-- | tests/examples/clutter/clutteractor.c | 2 | ||||
-rw-r--r-- | tests/examples/clutter/cluttershare.c | 3 | ||||
-rw-r--r-- | tests/examples/generic/cubeyuv/main.cpp | 18 | ||||
-rw-r--r-- | tests/examples/generic/doublecube/main.cpp | 24 |
4 files changed, 19 insertions, 28 deletions
diff --git a/tests/examples/clutter/clutteractor.c b/tests/examples/clutter/clutteractor.c index c253217..44c97ba 100644 --- a/tests/examples/clutter/clutteractor.c +++ b/tests/examples/clutter/clutteractor.c @@ -158,7 +158,7 @@ main (int argc, char *argv[]) pipeline = GST_PIPELINE (gst_parse_launch ("videotestsrc ! video/x-raw, width=320, height=240, framerate=(fraction)30/1 ! " - "glupload ! gleffects effect=twirl ! glimagesink", NULL)); + "gleffects effect=twirl ! glimagesink", NULL)); bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); diff --git a/tests/examples/clutter/cluttershare.c b/tests/examples/clutter/cluttershare.c index 6b7311f..ac13b1c 100644 --- a/tests/examples/clutter/cluttershare.c +++ b/tests/examples/clutter/cluttershare.c @@ -285,8 +285,7 @@ main (int argc, char *argv[]) pipeline = GST_PIPELINE (gst_parse_launch ("videotestsrc ! video/x-raw, width=320, height=240, framerate=(fraction)30/1 ! " - "glupload ! gleffects effect=5 ! glfiltercube ! fakesink sync=1", - NULL)); + "gleffects effect=5 ! glfiltercube ! fakesink sync=1", NULL)); /* setup bus */ diff --git a/tests/examples/generic/cubeyuv/main.cpp b/tests/examples/generic/cubeyuv/main.cpp index c88d03f..8bd8880 100644 --- a/tests/examples/generic/cubeyuv/main.cpp +++ b/tests/examples/generic/cubeyuv/main.cpp @@ -189,7 +189,7 @@ gboolean drawCallback (GLuint texture, GLuint width, GLuint height) } -static void cb_new_pad (GstElement* decodebin, GstPad* pad, gboolean last, GstElement* identity) +static void cb_new_pad (GstElement* decodebin, GstPad* pad, GstElement* identity) { GstPad* identity_pad = gst_element_get_static_pad (identity, "sink"); @@ -244,12 +244,11 @@ gint main (gint argc, gchar *argv[]) GstElement* decodebin = gst_element_factory_make ("decodebin", "decodebin"); GstElement* identity = gst_element_factory_make ("identity", "identity0"); GstElement* textoverlay = gst_element_factory_make ("textoverlay", "textoverlay0"); - GstElement* glupload = gst_element_factory_make ("glupload", "glupload0"); GstElement* glimagesink = gst_element_factory_make ("glimagesink", "glimagesink0"); if (!videosrc || !decodebin || !identity || !textoverlay || - !glupload || !glimagesink) + !glimagesink) { g_print ("one element could not be found \n"); return -1; @@ -270,29 +269,24 @@ gint main (gint argc, gchar *argv[]) /* add elements */ gst_bin_add_many (GST_BIN (pipeline), videosrc, decodebin, identity, - textoverlay, glupload, glimagesink, NULL); + textoverlay, glimagesink, NULL); /* link elements */ gst_element_link_pads (videosrc, "src", decodebin, "sink"); - g_signal_connect (decodebin, "new-decoded-pad", G_CALLBACK (cb_new_pad), identity); + g_signal_connect (decodebin, "pad-added", G_CALLBACK (cb_new_pad), identity); if (!gst_element_link_pads(identity, "src", textoverlay, "video_sink")) { g_print ("Failed to link identity to textoverlay!\n"); return -1; } - if (!gst_element_link(textoverlay, glupload)) - { - g_print ("Failed to link textoverlay to glupload!\n"); - return -1; - } - gboolean link_ok = gst_element_link_filtered(glupload, glimagesink, outcaps) ; + gboolean link_ok = gst_element_link_filtered(textoverlay, glimagesink, outcaps) ; gst_caps_unref(outcaps) ; if(!link_ok) { - g_warning("Failed to link glupload to glimagesink!\n") ; + g_warning("Failed to link textoverlay to glimagesink!\n") ; return -1 ; } diff --git a/tests/examples/generic/doublecube/main.cpp b/tests/examples/generic/doublecube/main.cpp index a7756c1..4725b04 100644 --- a/tests/examples/generic/doublecube/main.cpp +++ b/tests/examples/generic/doublecube/main.cpp @@ -188,7 +188,7 @@ gboolean drawCallback (GLuint texture, GLuint width, GLuint height) } -static void cb_new_pad (GstElement* decodebin, GstPad* pad, gboolean last, GstElement* identity) +static void cb_new_pad (GstElement* decodebin, GstPad* pad, GstElement* identity) { GstPad* identity_pad = gst_element_get_static_pad (identity, "sink"); @@ -247,11 +247,9 @@ gint main (gint argc, gchar *argv[]) GstElement* tee = gst_element_factory_make ("tee", "tee0"); GstElement* queue0 = gst_element_factory_make ("queue", "queue0"); - GstElement* glupload0 = gst_element_factory_make ("glupload", "glupload0"); GstElement* glimagesink0 = gst_element_factory_make ("glimagesink", "glimagesink0"); GstElement* queue1 = gst_element_factory_make ("queue", "queue1"); - GstElement* glupload1 = gst_element_factory_make ("glupload", "glupload1"); GstElement* glfiltercube = gst_element_factory_make ("glfiltercube", "glfiltercube"); GstElement* glimagesink1 = gst_element_factory_make ("glimagesink", "glimagesink1"); @@ -260,8 +258,8 @@ gint main (gint argc, gchar *argv[]) if (!videosrc || !decodebin || !identity || !textoverlay || !tee || - !queue0 || !glupload0 || !glimagesink0 || - !queue1 || !glupload1 || !glfiltercube || !glimagesink1 || + !queue0 || !glimagesink0 || + !queue1 || !glfiltercube || !glimagesink1 || !queue2 || !glimagesink2) { g_warning ("one element could not be found \n"); @@ -283,14 +281,14 @@ gint main (gint argc, gchar *argv[]) /* add elements */ gst_bin_add_many (GST_BIN (pipeline), videosrc, decodebin, identity, textoverlay, tee, - queue0, glupload0, glimagesink0, - queue1, glupload1, glfiltercube, glimagesink1, + queue0, glimagesink0, + queue1, glfiltercube, glimagesink1, queue2, glimagesink2, NULL); gst_element_link_pads (videosrc, "src", decodebin, "sink"); - g_signal_connect (decodebin, "new-decoded-pad", G_CALLBACK (cb_new_pad), identity); + g_signal_connect (decodebin, "pad-added", G_CALLBACK (cb_new_pad), identity); if (!gst_element_link_pads(identity, "src", textoverlay, "video_sink")) { @@ -298,21 +296,21 @@ gint main (gint argc, gchar *argv[]) return -1; } - if (!gst_element_link_many(textoverlay, tee, queue0, glupload0, NULL)) + if (!gst_element_link_many(textoverlay, tee, queue0, NULL)) { - g_warning ("Failed to link one or more elements bettween textoverlay and glupload0!\n"); + g_warning ("Failed to link one or more elements bettween textoverlay and queue0!\n"); return -1; } - gboolean link_ok = gst_element_link_filtered(glupload0, glimagesink0, cubecaps) ; + gboolean link_ok = gst_element_link_filtered(queue0, glimagesink0, cubecaps) ; gst_caps_unref(cubecaps) ; if(!link_ok) { - g_warning("Failed to link glupload0 to glimagesink0!\n") ; + g_warning("Failed to link queue0 to glimagesink0!\n") ; return -1 ; } - if (!gst_element_link_many(tee, queue1, glupload1, glfiltercube, glimagesink1, NULL)) + if (!gst_element_link_many(tee, queue1, glfiltercube, glimagesink1, NULL)) { g_warning ("Failed to link one or more elements bettween tee and glimagesink1!\n"); return -1; |