summaryrefslogtreecommitdiff
path: root/tests/examples/seek
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2012-02-23 13:31:37 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-02-23 13:32:00 +0100
commit03eab90fe8d38200c60641decf2fd638da826f9a (patch)
tree07eb296eb1daf1532b5b21c37258d0a4192c2c79 /tests/examples/seek
parent0ef49c5275e56be308bd804177a52499f78aca2e (diff)
seek: Use colorbalance of playbin2 directly
Diffstat (limited to 'tests/examples/seek')
-rw-r--r--tests/examples/seek/seek.c43
1 files changed, 15 insertions, 28 deletions
diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c
index c7e7e6cfc..6fc97a92f 100644
--- a/tests/examples/seek/seek.c
+++ b/tests/examples/seek/seek.c
@@ -1002,6 +1002,10 @@ make_playerbin2_pipeline (const gchar * location)
/* FIXME: this is not triggered, playbin2 is not forwarding it from the sink */
g_signal_connect (pipeline, "notify::volume", G_CALLBACK (volume_notify_cb),
NULL);
+
+ navigation_element = GST_ELEMENT (gst_object_ref (pipeline));
+ colorbalance_element = GST_ELEMENT (gst_object_ref (pipeline));
+
return pipeline;
}
@@ -2623,6 +2627,9 @@ find_interface_elements (void)
gpointer item;
gboolean done = FALSE, hardware = FALSE;
+ if (pipeline_type == 16)
+ return;
+
if (navigation_element)
gst_object_unref (navigation_element);
navigation_element = NULL;
@@ -2631,9 +2638,8 @@ find_interface_elements (void)
gst_object_unref (colorbalance_element);
colorbalance_element = NULL;
- if (pipeline_type != 16)
- navigation_element =
- gst_bin_get_by_interface (GST_BIN (pipeline), GST_TYPE_NAVIGATION);
+ navigation_element =
+ gst_bin_get_by_interface (GST_BIN (pipeline), GST_TYPE_NAVIGATION);
it = gst_bin_iterate_all_by_interface (GST_BIN (pipeline),
GST_TYPE_COLOR_BALANCE);
@@ -2693,17 +2699,13 @@ navigation_cmd_cb (GtkButton * button, gpointer data)
{
GstNavigationCommand cmd = GPOINTER_TO_INT (data);
- if (pipeline_type == 16) {
- gst_navigation_send_command (GST_NAVIGATION (pipeline), cmd);
- } else {
- if (!navigation_element) {
- find_interface_elements ();
- if (!navigation_element)
- return;
- }
-
- gst_navigation_send_command (GST_NAVIGATION (navigation_element), cmd);
+ if (!navigation_element) {
+ find_interface_elements ();
+ if (!navigation_element)
+ return;
}
+
+ gst_navigation_send_command (GST_NAVIGATION (navigation_element), cmd);
}
#if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ)
@@ -2804,9 +2806,6 @@ button_press_cb (GtkWidget * widget, GdkEventButton * event, gpointer user_data)
if (navigation_element)
gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element),
"mouse-button-press", event->button, event->x, event->y);
- else if (pipeline_type == 16)
- gst_navigation_send_mouse_event (GST_NAVIGATION (pipeline),
- "mouse-button-press", event->button, event->x, event->y);
return FALSE;
}
@@ -2818,9 +2817,6 @@ button_release_cb (GtkWidget * widget, GdkEventButton * event,
if (navigation_element)
gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element),
"mouse-button-release", event->button, event->x, event->y);
- else if (pipeline_type == 16)
- gst_navigation_send_mouse_event (GST_NAVIGATION (pipeline),
- "mouse-button-release", event->button, event->x, event->y);
return FALSE;
}
@@ -2831,9 +2827,6 @@ key_press_cb (GtkWidget * widget, GdkEventKey * event, gpointer user_data)
if (navigation_element)
gst_navigation_send_key_event (GST_NAVIGATION (navigation_element),
"key-press", gdk_keyval_name (event->keyval));
- else if (pipeline_type == 16)
- gst_navigation_send_key_event (GST_NAVIGATION (pipeline),
- "key-press", gdk_keyval_name (event->keyval));
return FALSE;
}
@@ -2844,9 +2837,6 @@ key_release_cb (GtkWidget * widget, GdkEventKey * event, gpointer user_data)
if (navigation_element)
gst_navigation_send_key_event (GST_NAVIGATION (navigation_element),
"key-release", gdk_keyval_name (event->keyval));
- else if (pipeline_type == 16)
- gst_navigation_send_key_event (GST_NAVIGATION (pipeline),
- "key-release", gdk_keyval_name (event->keyval));
return FALSE;
}
@@ -2858,9 +2848,6 @@ motion_notify_cb (GtkWidget * widget, GdkEventMotion * event,
if (navigation_element)
gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element),
"mouse-move", 0, event->x, event->y);
- else if (pipeline_type == 16)
- gst_navigation_send_mouse_event (GST_NAVIGATION (pipeline),
- "mouse-move", 0, event->x, event->y);
return FALSE;
}