summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorZaheer Abbas Merali <zaheerabbas@merali.org>2007-08-24 15:56:52 +0000
committerZaheer Abbas Merali <zaheerabbas@merali.org>2007-08-24 15:56:52 +0000
commit629884aad3a1f110222f096c99fd29fa266091da (patch)
tree6030db8963432d38eb26d78d58fe1f88a56a62ab /examples
parentb86971338f38ce9f84f58df7cd52a50da2e27881 (diff)
downloadgst-plugins-bad-629884aad3a1f110222f096c99fd29fa266091da.tar.gz
gst-plugins-bad-629884aad3a1f110222f096c99fd29fa266091da.tar.bz2
gst-plugins-bad-629884aad3a1f110222f096c99fd29fa266091da.zip
Make switch more reliable and also not lock up when sink pad caps change.
Original commit message from CVS: * examples/switch/switcher.c (main): * gst/switch/gstswitch.c (gst_switch_chain): Make switch more reliable and also not lock up when sink pad caps change.
Diffstat (limited to 'examples')
-rw-r--r--examples/switch/switcher.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/examples/switch/switcher.c b/examples/switch/switcher.c
index 42c6d585..2874fcc5 100644
--- a/examples/switch/switcher.c
+++ b/examples/switch/switcher.c
@@ -118,11 +118,12 @@ main (int argc, char *argv[])
gst_caps_from_string ("video/x-raw-rgb,width=640,height=480"), NULL);
video_switch = gst_element_factory_make ("switch", "video_switch");
segment = gst_element_factory_make ("identity", "identity-segment");
+ g_object_set (G_OBJECT (segment), "silent", TRUE, NULL);
g_signal_connect (G_OBJECT (segment), "notify::last-message",
G_CALLBACK (last_message_received), segment);
g_object_set (G_OBJECT (segment), "single-segment", TRUE, NULL);
scaler = gst_element_factory_make ("videoscale", "videoscale0");
- video_sink = gst_element_factory_make ("ximagesink", "video_sink");
+ video_sink = gst_element_factory_make ("fakesink", "video_sink");
//g_object_set (G_OBJECT (video_sink), "sync", FALSE, NULL);
sink1_sync = gst_element_factory_make ("identity", "sink0_sync");
g_object_set (G_OBJECT (sink1_sync), "sync", TRUE, NULL);
@@ -130,21 +131,21 @@ main (int argc, char *argv[])
g_object_set (G_OBJECT (sink2_sync), "sync", TRUE, NULL);
gst_bin_add_many (GST_BIN (pipeline), src1, src2, segment, video_switch,
video_sink, sink1_sync, sink2_sync, scaler, capsfilter, NULL);
- gst_element_link (src1, sink1_sync);
- gst_element_link (sink1_sync, video_switch);
+ gst_element_link (src1, /*sink1_sync);
+ gst_element_link (sink1_sync, */ video_switch);
gst_element_link (src2, capsfilter);
- gst_element_link (capsfilter, sink2_sync);
- gst_element_link (sink2_sync, video_switch);
+ gst_element_link (capsfilter, /*sink2_sync);
+ gst_element_link (sink2_sync, */ video_switch);
gst_element_link (video_switch, segment);
- gst_element_link (segment, scaler);
- gst_element_link (scaler, video_sink);
+ gst_element_link (segment, /*scaler);
+ gst_element_link (scaler, */ video_sink);
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
gst_bus_add_watch (bus, my_bus_callback, NULL);
gst_object_unref (bus);
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
- g_timeout_add (2000, (GSourceFunc) switch_timer, video_switch);
+ g_timeout_add (200, (GSourceFunc) switch_timer, video_switch);
g_main_loop_run (loop);