2002-08-02 11:43:25 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
static gint looping;
|
|
|
|
static GstEvent *event;
|
|
|
|
static GstPad *pad;
|
|
|
|
|
|
|
|
static void
|
2004-03-13 15:27:01 +00:00
|
|
|
event_received (GObject * object, GstEvent * event, GstElement * pipeline)
|
2002-08-02 11:43:25 +00:00
|
|
|
{
|
docs/design/part-events.txt: Small update.
Original commit message from CVS:
* docs/design/part-events.txt:
Small update.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_activate_push),
(gst_base_sink_activate_pull):
Some more comments.
* gst/elements/gstfakesrc.c: (gst_fake_src_class_init),
(gst_fake_src_create):
Fix handoff marshall.
* gst/elements/gstidentity.c: (gst_identity_class_init),
(gst_identity_transform_ip):
We're a real inplace element.
* gst/gstbus.c: (gst_bus_post):
Added some comments.
* tests/lat.c: (fakesrc), (fakesink), (simple), (queue), (main):
* tests/muxing/case1.c: (main):
* tests/sched/dynamic-pipeline.c: (main):
* tests/sched/interrupt1.c: (main):
* tests/sched/interrupt2.c: (main):
* tests/sched/interrupt3.c: (main):
* tests/sched/runxml.c: (main):
* tests/sched/sched-stress.c: (main):
* tests/seeking/seeking1.c: (event_received), (main):
* tests/threadstate/threadstate2.c: (bus_handler), (timeout_func),
(main):
* tests/threadstate/threadstate3.c: (main):
* tests/threadstate/threadstate4.c: (main):
* tests/threadstate/threadstate5.c: (main):
Fix the tests.
2005-07-22 11:47:10 +00:00
|
|
|
#if 0
|
2002-08-02 11:43:25 +00:00
|
|
|
if (GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT_DONE) {
|
|
|
|
g_print ("segment done\n");
|
|
|
|
if (--looping == 1) {
|
|
|
|
event = gst_event_new_segment_seek (GST_FORMAT_DEFAULT |
|
2004-03-15 19:27:17 +00:00
|
|
|
GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH, 20, 25);
|
2004-03-13 15:27:01 +00:00
|
|
|
} else {
|
2002-08-02 11:43:25 +00:00
|
|
|
event = gst_event_new_segment_seek (GST_FORMAT_DEFAULT |
|
2004-03-15 19:27:17 +00:00
|
|
|
GST_SEEK_METHOD_SET |
|
|
|
|
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SEGMENT_LOOP, 50, 55);
|
2002-08-02 11:43:25 +00:00
|
|
|
}
|
|
|
|
gst_pad_send_event (pad, event);
|
|
|
|
}
|
docs/design/part-events.txt: Small update.
Original commit message from CVS:
* docs/design/part-events.txt:
Small update.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_activate_push),
(gst_base_sink_activate_pull):
Some more comments.
* gst/elements/gstfakesrc.c: (gst_fake_src_class_init),
(gst_fake_src_create):
Fix handoff marshall.
* gst/elements/gstidentity.c: (gst_identity_class_init),
(gst_identity_transform_ip):
We're a real inplace element.
* gst/gstbus.c: (gst_bus_post):
Added some comments.
* tests/lat.c: (fakesrc), (fakesink), (simple), (queue), (main):
* tests/muxing/case1.c: (main):
* tests/sched/dynamic-pipeline.c: (main):
* tests/sched/interrupt1.c: (main):
* tests/sched/interrupt2.c: (main):
* tests/sched/interrupt3.c: (main):
* tests/sched/runxml.c: (main):
* tests/sched/sched-stress.c: (main):
* tests/seeking/seeking1.c: (event_received), (main):
* tests/threadstate/threadstate2.c: (bus_handler), (timeout_func),
(main):
* tests/threadstate/threadstate3.c: (main):
* tests/threadstate/threadstate4.c: (main):
* tests/threadstate/threadstate5.c: (main):
Fix the tests.
2005-07-22 11:47:10 +00:00
|
|
|
#endif
|
2002-08-02 11:43:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
2004-03-13 15:27:01 +00:00
|
|
|
main (gint argc, gchar * argv[])
|
2002-08-02 11:43:25 +00:00
|
|
|
{
|
|
|
|
GstElement *pipeline;
|
|
|
|
GstElement *fakesrc;
|
|
|
|
GstElement *fakesink;
|
docs/design/part-events.txt: Small update.
Original commit message from CVS:
* docs/design/part-events.txt:
Small update.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_activate_push),
(gst_base_sink_activate_pull):
Some more comments.
* gst/elements/gstfakesrc.c: (gst_fake_src_class_init),
(gst_fake_src_create):
Fix handoff marshall.
* gst/elements/gstidentity.c: (gst_identity_class_init),
(gst_identity_transform_ip):
We're a real inplace element.
* gst/gstbus.c: (gst_bus_post):
Added some comments.
* tests/lat.c: (fakesrc), (fakesink), (simple), (queue), (main):
* tests/muxing/case1.c: (main):
* tests/sched/dynamic-pipeline.c: (main):
* tests/sched/interrupt1.c: (main):
* tests/sched/interrupt2.c: (main):
* tests/sched/interrupt3.c: (main):
* tests/sched/runxml.c: (main):
* tests/sched/sched-stress.c: (main):
* tests/seeking/seeking1.c: (event_received), (main):
* tests/threadstate/threadstate2.c: (bus_handler), (timeout_func),
(main):
* tests/threadstate/threadstate3.c: (main):
* tests/threadstate/threadstate4.c: (main):
* tests/threadstate/threadstate5.c: (main):
Fix the tests.
2005-07-22 11:47:10 +00:00
|
|
|
|
|
|
|
/* guint64 value; */
|
2002-08-02 11:43:25 +00:00
|
|
|
GstFormat format;
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2002-08-02 11:43:25 +00:00
|
|
|
gst_init (&argc, &argv);
|
|
|
|
|
|
|
|
pipeline = gst_pipeline_new ("pipeline");
|
|
|
|
|
|
|
|
fakesrc = gst_element_factory_make ("fakesrc", "src");
|
|
|
|
|
|
|
|
fakesink = gst_element_factory_make ("fakesink", "sink");
|
|
|
|
|
|
|
|
gst_bin_add (GST_BIN (pipeline), fakesrc);
|
|
|
|
gst_bin_add (GST_BIN (pipeline), fakesink);
|
|
|
|
|
2003-01-09 14:15:37 +00:00
|
|
|
gst_element_link_pads (fakesrc, "src", fakesink, "sink");
|
2002-08-02 11:43:25 +00:00
|
|
|
|
|
|
|
gst_element_set_state (pipeline, GST_STATE_READY);
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
pad = gst_element_get_pad (fakesrc, "src");
|
|
|
|
|
2002-08-02 11:43:25 +00:00
|
|
|
g_print ("doing segment seek from 5 to 10\n");
|
|
|
|
|
|
|
|
gst_pad_send_event (pad,
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_event_new_segment_seek (GST_FORMAT_DEFAULT |
|
2004-03-15 19:27:17 +00:00
|
|
|
GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH, 5, 10));
|
2002-08-02 11:43:25 +00:00
|
|
|
|
|
|
|
format = GST_FORMAT_DEFAULT;
|
|
|
|
|
docs/design/part-events.txt: Small update.
Original commit message from CVS:
* docs/design/part-events.txt:
Small update.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_activate_push),
(gst_base_sink_activate_pull):
Some more comments.
* gst/elements/gstfakesrc.c: (gst_fake_src_class_init),
(gst_fake_src_create):
Fix handoff marshall.
* gst/elements/gstidentity.c: (gst_identity_class_init),
(gst_identity_transform_ip):
We're a real inplace element.
* gst/gstbus.c: (gst_bus_post):
Added some comments.
* tests/lat.c: (fakesrc), (fakesink), (simple), (queue), (main):
* tests/muxing/case1.c: (main):
* tests/sched/dynamic-pipeline.c: (main):
* tests/sched/interrupt1.c: (main):
* tests/sched/interrupt2.c: (main):
* tests/sched/interrupt3.c: (main):
* tests/sched/runxml.c: (main):
* tests/sched/sched-stress.c: (main):
* tests/seeking/seeking1.c: (event_received), (main):
* tests/threadstate/threadstate2.c: (bus_handler), (timeout_func),
(main):
* tests/threadstate/threadstate3.c: (main):
* tests/threadstate/threadstate4.c: (main):
* tests/threadstate/threadstate5.c: (main):
Fix the tests.
2005-07-22 11:47:10 +00:00
|
|
|
#if 0
|
2002-12-30 17:42:11 +00:00
|
|
|
gst_pad_query (pad, GST_QUERY_START, &format, &value);
|
2003-02-01 20:29:27 +00:00
|
|
|
g_print ("configured for start %" G_GINT64_FORMAT "\n", value);
|
2002-12-30 17:42:11 +00:00
|
|
|
gst_pad_query (pad, GST_QUERY_SEGMENT_END, &format, &value);
|
2003-02-01 20:29:27 +00:00
|
|
|
g_print ("configured segment end %" G_GINT64_FORMAT "\n", value);
|
docs/design/part-events.txt: Small update.
Original commit message from CVS:
* docs/design/part-events.txt:
Small update.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_activate_push),
(gst_base_sink_activate_pull):
Some more comments.
* gst/elements/gstfakesrc.c: (gst_fake_src_class_init),
(gst_fake_src_create):
Fix handoff marshall.
* gst/elements/gstidentity.c: (gst_identity_class_init),
(gst_identity_transform_ip):
We're a real inplace element.
* gst/gstbus.c: (gst_bus_post):
Added some comments.
* tests/lat.c: (fakesrc), (fakesink), (simple), (queue), (main):
* tests/muxing/case1.c: (main):
* tests/sched/dynamic-pipeline.c: (main):
* tests/sched/interrupt1.c: (main):
* tests/sched/interrupt2.c: (main):
* tests/sched/interrupt3.c: (main):
* tests/sched/runxml.c: (main):
* tests/sched/sched-stress.c: (main):
* tests/seeking/seeking1.c: (event_received), (main):
* tests/threadstate/threadstate2.c: (bus_handler), (timeout_func),
(main):
* tests/threadstate/threadstate3.c: (main):
* tests/threadstate/threadstate4.c: (main):
* tests/threadstate/threadstate5.c: (main):
Fix the tests.
2005-07-22 11:47:10 +00:00
|
|
|
#endif
|
2002-08-02 11:43:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
g_signal_connect (G_OBJECT (pipeline), "deep_notify",
|
docs/design/part-events.txt: Small update.
Original commit message from CVS:
* docs/design/part-events.txt:
Small update.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_activate_push),
(gst_base_sink_activate_pull):
Some more comments.
* gst/elements/gstfakesrc.c: (gst_fake_src_class_init),
(gst_fake_src_create):
Fix handoff marshall.
* gst/elements/gstidentity.c: (gst_identity_class_init),
(gst_identity_transform_ip):
We're a real inplace element.
* gst/gstbus.c: (gst_bus_post):
Added some comments.
* tests/lat.c: (fakesrc), (fakesink), (simple), (queue), (main):
* tests/muxing/case1.c: (main):
* tests/sched/dynamic-pipeline.c: (main):
* tests/sched/interrupt1.c: (main):
* tests/sched/interrupt2.c: (main):
* tests/sched/interrupt3.c: (main):
* tests/sched/runxml.c: (main):
* tests/sched/sched-stress.c: (main):
* tests/seeking/seeking1.c: (event_received), (main):
* tests/threadstate/threadstate2.c: (bus_handler), (timeout_func),
(main):
* tests/threadstate/threadstate3.c: (main):
* tests/threadstate/threadstate4.c: (main):
* tests/threadstate/threadstate5.c: (main):
Fix the tests.
2005-07-22 11:47:10 +00:00
|
|
|
G_CALLBACK (gst_object_default_deep_notify), NULL);
|
2002-08-02 11:43:25 +00:00
|
|
|
|
docs/design/part-events.txt: Small update.
Original commit message from CVS:
* docs/design/part-events.txt:
Small update.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_activate_push),
(gst_base_sink_activate_pull):
Some more comments.
* gst/elements/gstfakesrc.c: (gst_fake_src_class_init),
(gst_fake_src_create):
Fix handoff marshall.
* gst/elements/gstidentity.c: (gst_identity_class_init),
(gst_identity_transform_ip):
We're a real inplace element.
* gst/gstbus.c: (gst_bus_post):
Added some comments.
* tests/lat.c: (fakesrc), (fakesink), (simple), (queue), (main):
* tests/muxing/case1.c: (main):
* tests/sched/dynamic-pipeline.c: (main):
* tests/sched/interrupt1.c: (main):
* tests/sched/interrupt2.c: (main):
* tests/sched/interrupt3.c: (main):
* tests/sched/runxml.c: (main):
* tests/sched/sched-stress.c: (main):
* tests/seeking/seeking1.c: (event_received), (main):
* tests/threadstate/threadstate2.c: (bus_handler), (timeout_func),
(main):
* tests/threadstate/threadstate3.c: (main):
* tests/threadstate/threadstate4.c: (main):
* tests/threadstate/threadstate5.c: (main):
Fix the tests.
2005-07-22 11:47:10 +00:00
|
|
|
g_usleep (2 * G_USEC_PER_SEC);
|
2002-08-02 11:43:25 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
g_print
|
|
|
|
("doing segment seek from 50 to 55 with looping (2 times), then 20 to 25 without looping\n");
|
2002-08-02 11:43:25 +00:00
|
|
|
looping = 3;
|
|
|
|
|
|
|
|
event = gst_event_new_segment_seek (GST_FORMAT_DEFAULT |
|
2004-03-13 15:27:01 +00:00
|
|
|
GST_SEEK_METHOD_SET |
|
|
|
|
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SEGMENT_LOOP, 50, 55);
|
2002-08-02 11:43:25 +00:00
|
|
|
gst_pad_send_event (pad, event);
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
g_signal_connect (G_OBJECT (gst_element_get_pad (fakesink, "sink")),
|
|
|
|
"event_received", G_CALLBACK (event_received), event);
|
2002-08-02 11:43:25 +00:00
|
|
|
|
docs/design/part-events.txt: Small update.
Original commit message from CVS:
* docs/design/part-events.txt:
Small update.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_activate_push),
(gst_base_sink_activate_pull):
Some more comments.
* gst/elements/gstfakesrc.c: (gst_fake_src_class_init),
(gst_fake_src_create):
Fix handoff marshall.
* gst/elements/gstidentity.c: (gst_identity_class_init),
(gst_identity_transform_ip):
We're a real inplace element.
* gst/gstbus.c: (gst_bus_post):
Added some comments.
* tests/lat.c: (fakesrc), (fakesink), (simple), (queue), (main):
* tests/muxing/case1.c: (main):
* tests/sched/dynamic-pipeline.c: (main):
* tests/sched/interrupt1.c: (main):
* tests/sched/interrupt2.c: (main):
* tests/sched/interrupt3.c: (main):
* tests/sched/runxml.c: (main):
* tests/sched/sched-stress.c: (main):
* tests/seeking/seeking1.c: (event_received), (main):
* tests/threadstate/threadstate2.c: (bus_handler), (timeout_func),
(main):
* tests/threadstate/threadstate3.c: (main):
* tests/threadstate/threadstate4.c: (main):
* tests/threadstate/threadstate5.c: (main):
Fix the tests.
2005-07-22 11:47:10 +00:00
|
|
|
#if 0
|
2002-12-30 17:42:11 +00:00
|
|
|
gst_pad_query (pad, GST_QUERY_START, &format, &value);
|
2003-02-01 20:29:27 +00:00
|
|
|
g_print ("configured for start %" G_GINT64_FORMAT "\n", value);
|
2002-12-30 17:42:11 +00:00
|
|
|
gst_pad_query (pad, GST_QUERY_SEGMENT_END, &format, &value);
|
2003-02-01 20:29:27 +00:00
|
|
|
g_print ("configured segment end %" G_GINT64_FORMAT "\n", value);
|
docs/design/part-events.txt: Small update.
Original commit message from CVS:
* docs/design/part-events.txt:
Small update.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_activate_push),
(gst_base_sink_activate_pull):
Some more comments.
* gst/elements/gstfakesrc.c: (gst_fake_src_class_init),
(gst_fake_src_create):
Fix handoff marshall.
* gst/elements/gstidentity.c: (gst_identity_class_init),
(gst_identity_transform_ip):
We're a real inplace element.
* gst/gstbus.c: (gst_bus_post):
Added some comments.
* tests/lat.c: (fakesrc), (fakesink), (simple), (queue), (main):
* tests/muxing/case1.c: (main):
* tests/sched/dynamic-pipeline.c: (main):
* tests/sched/interrupt1.c: (main):
* tests/sched/interrupt2.c: (main):
* tests/sched/interrupt3.c: (main):
* tests/sched/runxml.c: (main):
* tests/sched/sched-stress.c: (main):
* tests/seeking/seeking1.c: (event_received), (main):
* tests/threadstate/threadstate2.c: (bus_handler), (timeout_func),
(main):
* tests/threadstate/threadstate3.c: (main):
* tests/threadstate/threadstate4.c: (main):
* tests/threadstate/threadstate5.c: (main):
Fix the tests.
2005-07-22 11:47:10 +00:00
|
|
|
#endif
|
2002-08-02 11:43:25 +00:00
|
|
|
|
|
|
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
|
|
|
|
docs/design/part-events.txt: Small update.
Original commit message from CVS:
* docs/design/part-events.txt:
Small update.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_activate_push),
(gst_base_sink_activate_pull):
Some more comments.
* gst/elements/gstfakesrc.c: (gst_fake_src_class_init),
(gst_fake_src_create):
Fix handoff marshall.
* gst/elements/gstidentity.c: (gst_identity_class_init),
(gst_identity_transform_ip):
We're a real inplace element.
* gst/gstbus.c: (gst_bus_post):
Added some comments.
* tests/lat.c: (fakesrc), (fakesink), (simple), (queue), (main):
* tests/muxing/case1.c: (main):
* tests/sched/dynamic-pipeline.c: (main):
* tests/sched/interrupt1.c: (main):
* tests/sched/interrupt2.c: (main):
* tests/sched/interrupt3.c: (main):
* tests/sched/runxml.c: (main):
* tests/sched/sched-stress.c: (main):
* tests/seeking/seeking1.c: (event_received), (main):
* tests/threadstate/threadstate2.c: (bus_handler), (timeout_func),
(main):
* tests/threadstate/threadstate3.c: (main):
* tests/threadstate/threadstate4.c: (main):
* tests/threadstate/threadstate5.c: (main):
Fix the tests.
2005-07-22 11:47:10 +00:00
|
|
|
g_usleep (2 * G_USEC_PER_SEC);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2002-08-02 11:43:25 +00:00
|
|
|
gst_element_set_state (pipeline, GST_STATE_NULL);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2002-08-02 11:43:25 +00:00
|
|
|
return 0;
|
|
|
|
}
|