{
gint i;
- g_print ("%d: %08x ", entry->id, GST_INDEX_ASSOC_FLAGS (entry));
+ g_print ("%p, %d: %08x ", entry, entry->id, GST_INDEX_ASSOC_FLAGS (entry));
for (i = 0; i < GST_INDEX_NASSOCS (entry); i++) {
g_print ("%d %lld ", GST_INDEX_ASSOC_FORMAT (entry, i),
GST_INDEX_ASSOC_VALUE (entry, i));
gint count = 0;
GstEvent *event;
gboolean res;
- gint i;
+ GstElement *sink;
struct poptOption options[] = {
{ "verbose", 'v', POPT_ARG_NONE|POPT_ARGFLAG_STRIP, &verbose, 0,
"Print index entries", NULL},
/* create index that elements can fill */
index = gst_index_factory_make ("memindex");
- if (verbose)
+ index = NULL;
+ if (verbose && index)
g_signal_connect (G_OBJECT (index), "entry_added", G_CALLBACK (entry_added), NULL);
/* construct pipeline */
gst_element_set_state (pipeline, GST_STATE_READY);
gst_element_set_state (pipeline, GST_STATE_PAUSED);
- GST_FLAG_UNSET (index, GST_INDEX_WRITABLE);
+ if (index)
+ GST_FLAG_UNSET (index, GST_INDEX_WRITABLE);
src = gst_bin_get_by_name (GST_BIN (pipeline), "video_decoder");
pad = gst_element_get_pad (src, "src");
+ sink = gst_element_factory_make ("fakesink", "sink");
+ gst_element_connect_pads (src, "src", sink, "sink");
+ gst_bin_add (GST_BIN (pipeline), sink);
g_print ("seeking %s...\n", argv [2]);
event = gst_event_new_seek (GST_FORMAT_TIME |
GST_SEEK_METHOD_SET |
- GST_SEEK_FLAG_FLUSH, 1 * GST_SECOND);
+ GST_SEEK_FLAG_FLUSH, 5 * GST_SECOND);
res = gst_pad_send_event (pad, event);
if (!res) {
}
gst_element_set_state (pipeline, GST_STATE_PLAYING);
- for (i = 0; i < 100; i++) {
- gst_bin_iterate (GST_BIN (pipeline));
+ count = 0;
+ while (gst_bin_iterate (GST_BIN (pipeline))) {
+ if (!quiet && (count % 1000 == 0)) {
+ print_progress (pad);
+ }
+ count++;
}
gst_element_set_state (pipeline, GST_STATE_NULL);
src = gst_element_factory_make_or_warn (SOURCE, "src");
parser = gst_element_factory_make_or_warn ("mpegparse", "parse");
fakesink = gst_element_factory_make_or_warn ("fakesink", "sink");
- g_object_set (G_OBJECT (fakesink), "sync", FALSE, NULL);
+ g_object_set (G_OBJECT (fakesink), "silent", TRUE, NULL);
+ g_object_set (G_OBJECT (fakesink), "sync", TRUE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("vorbisfile", "decoder");
audiosink = gst_element_factory_make_or_warn ("osssink", "sink");
- //g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
+ g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
video_bin = gst_bin_new ("v_decoder_bin");
//v_decoder = gst_element_factory_make_or_warn ("identity", "v_dec");
- v_decoder = gst_element_factory_make_or_warn ("windec", "v_dec");
+ //v_decoder = gst_element_factory_make_or_warn ("windec", "v_dec");
+ v_decoder = gst_element_factory_make_or_warn ("ffdec_msmpeg4", "v_dec");
video_thread = gst_thread_new ("v_decoder_thread");
videosink = gst_element_factory_make_or_warn ("xvideosink", "v_sink");
//videosink = gst_element_factory_make_or_warn ("fakesink", "v_sink");
//g_object_set (G_OBJECT (videosink), "sync", TRUE, NULL);
v_queue = gst_element_factory_make_or_warn ("queue", "v_queue");
- g_object_set (G_OBJECT (v_queue), "max_level", 10, NULL);
+ //g_object_set (G_OBJECT (v_queue), "max_level", 10, NULL);
gst_element_connect (v_decoder, v_queue);
gst_element_connect (v_queue, videosink);
gst_bin_add (GST_BIN (video_bin), v_decoder);
g_object_set (G_OBJECT (src), "location", location, NULL);
demux = gst_element_factory_make_or_warn ("mpegdemux", "demux");
- //g_object_set (G_OBJECT (demux), "sync", FALSE, NULL);
- g_object_set (G_OBJECT (demux), "sync", TRUE, NULL);
+ //g_object_set (G_OBJECT (demux), "sync", TRUE, NULL);
seekable_elements = g_list_prepend (seekable_elements, demux);
video_bin = gst_bin_new ("v_decoder_bin");
v_decoder = gst_element_factory_make_or_warn ("mpeg2dec", "v_dec");
video_thread = gst_thread_new ("v_decoder_thread");
- g_object_set (G_OBJECT (video_thread), "schedpolicy", 2, NULL);
+ //g_object_set (G_OBJECT (video_thread), "priority", 2, NULL);
v_queue = gst_element_factory_make_or_warn ("queue", "v_queue");
v_filter = gst_element_factory_make_or_warn ("colorspace", "v_filter");
videosink = gst_element_factory_make_or_warn ("xvideosink", "v_sink");
g_object_set (G_OBJECT (src), "location", location, NULL);
demux = gst_element_factory_make_or_warn ("mpegdemux", "demux");
- //g_object_set (G_OBJECT (demux), "sync", FALSE, NULL);
//g_object_set (G_OBJECT (demux), "sync", TRUE, NULL);
seekable_elements = g_list_prepend (seekable_elements, demux);
/* show the gui. */
gtk_widget_show_all (window);
+ g_signal_connect (pipeline, "deep_notify", G_CALLBACK (gst_element_default_deep_notify), NULL);
+ g_signal_connect (pipeline, "error", G_CALLBACK (gst_element_default_error), NULL);
+
gtk_main ();
+ gst_element_set_state (pipeline, GST_STATE_NULL);
+
//gst_object_unref (GST_OBJECT (pipeline));
gst_buffer_print_stats();
gst_event_print_stats();
src = gst_element_factory_make_or_warn (SOURCE, "src");
parser = gst_element_factory_make_or_warn ("mpegparse", "parse");
fakesink = gst_element_factory_make_or_warn ("fakesink", "sink");
- g_object_set (G_OBJECT (fakesink), "sync", FALSE, NULL);
+ g_object_set (G_OBJECT (fakesink), "silent", TRUE, NULL);
+ g_object_set (G_OBJECT (fakesink), "sync", TRUE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("vorbisfile", "decoder");
audiosink = gst_element_factory_make_or_warn ("osssink", "sink");
- //g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
+ g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
video_bin = gst_bin_new ("v_decoder_bin");
//v_decoder = gst_element_factory_make_or_warn ("identity", "v_dec");
- v_decoder = gst_element_factory_make_or_warn ("windec", "v_dec");
+ //v_decoder = gst_element_factory_make_or_warn ("windec", "v_dec");
+ v_decoder = gst_element_factory_make_or_warn ("ffdec_msmpeg4", "v_dec");
video_thread = gst_thread_new ("v_decoder_thread");
videosink = gst_element_factory_make_or_warn ("xvideosink", "v_sink");
//videosink = gst_element_factory_make_or_warn ("fakesink", "v_sink");
//g_object_set (G_OBJECT (videosink), "sync", TRUE, NULL);
v_queue = gst_element_factory_make_or_warn ("queue", "v_queue");
- g_object_set (G_OBJECT (v_queue), "max_level", 10, NULL);
+ //g_object_set (G_OBJECT (v_queue), "max_level", 10, NULL);
gst_element_connect (v_decoder, v_queue);
gst_element_connect (v_queue, videosink);
gst_bin_add (GST_BIN (video_bin), v_decoder);
g_object_set (G_OBJECT (src), "location", location, NULL);
demux = gst_element_factory_make_or_warn ("mpegdemux", "demux");
- //g_object_set (G_OBJECT (demux), "sync", FALSE, NULL);
- g_object_set (G_OBJECT (demux), "sync", TRUE, NULL);
+ //g_object_set (G_OBJECT (demux), "sync", TRUE, NULL);
seekable_elements = g_list_prepend (seekable_elements, demux);
video_bin = gst_bin_new ("v_decoder_bin");
v_decoder = gst_element_factory_make_or_warn ("mpeg2dec", "v_dec");
video_thread = gst_thread_new ("v_decoder_thread");
- g_object_set (G_OBJECT (video_thread), "schedpolicy", 2, NULL);
+ //g_object_set (G_OBJECT (video_thread), "priority", 2, NULL);
v_queue = gst_element_factory_make_or_warn ("queue", "v_queue");
v_filter = gst_element_factory_make_or_warn ("colorspace", "v_filter");
videosink = gst_element_factory_make_or_warn ("xvideosink", "v_sink");
g_object_set (G_OBJECT (src), "location", location, NULL);
demux = gst_element_factory_make_or_warn ("mpegdemux", "demux");
- //g_object_set (G_OBJECT (demux), "sync", FALSE, NULL);
//g_object_set (G_OBJECT (demux), "sync", TRUE, NULL);
seekable_elements = g_list_prepend (seekable_elements, demux);
/* show the gui. */
gtk_widget_show_all (window);
+ g_signal_connect (pipeline, "deep_notify", G_CALLBACK (gst_element_default_deep_notify), NULL);
+ g_signal_connect (pipeline, "error", G_CALLBACK (gst_element_default_error), NULL);
+
gtk_main ();
+ gst_element_set_state (pipeline, GST_STATE_NULL);
+
//gst_object_unref (GST_OBJECT (pipeline));
gst_buffer_print_stats();
gst_event_print_stats();
{
gint i;
- g_print ("%d: %08x ", entry->id, GST_INDEX_ASSOC_FLAGS (entry));
+ g_print ("%p, %d: %08x ", entry, entry->id, GST_INDEX_ASSOC_FLAGS (entry));
for (i = 0; i < GST_INDEX_NASSOCS (entry); i++) {
g_print ("%d %lld ", GST_INDEX_ASSOC_FORMAT (entry, i),
GST_INDEX_ASSOC_VALUE (entry, i));
gint count = 0;
GstEvent *event;
gboolean res;
- gint i;
+ GstElement *sink;
struct poptOption options[] = {
{ "verbose", 'v', POPT_ARG_NONE|POPT_ARGFLAG_STRIP, &verbose, 0,
"Print index entries", NULL},
/* create index that elements can fill */
index = gst_index_factory_make ("memindex");
- if (verbose)
+ index = NULL;
+ if (verbose && index)
g_signal_connect (G_OBJECT (index), "entry_added", G_CALLBACK (entry_added), NULL);
/* construct pipeline */
gst_element_set_state (pipeline, GST_STATE_READY);
gst_element_set_state (pipeline, GST_STATE_PAUSED);
- GST_FLAG_UNSET (index, GST_INDEX_WRITABLE);
+ if (index)
+ GST_FLAG_UNSET (index, GST_INDEX_WRITABLE);
src = gst_bin_get_by_name (GST_BIN (pipeline), "video_decoder");
pad = gst_element_get_pad (src, "src");
+ sink = gst_element_factory_make ("fakesink", "sink");
+ gst_element_connect_pads (src, "src", sink, "sink");
+ gst_bin_add (GST_BIN (pipeline), sink);
g_print ("seeking %s...\n", argv [2]);
event = gst_event_new_seek (GST_FORMAT_TIME |
GST_SEEK_METHOD_SET |
- GST_SEEK_FLAG_FLUSH, 1 * GST_SECOND);
+ GST_SEEK_FLAG_FLUSH, 5 * GST_SECOND);
res = gst_pad_send_event (pad, event);
if (!res) {
}
gst_element_set_state (pipeline, GST_STATE_PLAYING);
- for (i = 0; i < 100; i++) {
- gst_bin_iterate (GST_BIN (pipeline));
+ count = 0;
+ while (gst_bin_iterate (GST_BIN (pipeline))) {
+ if (!quiet && (count % 1000 == 0)) {
+ print_progress (pad);
+ }
+ count++;
}
gst_element_set_state (pipeline, GST_STATE_NULL);