Commit 1dae961c authored by Wim Taymans's avatar Wim Taymans

Plugin port to 0.9, ogg/theora playback should work in the seek example now.

Original commit message from CVS:
Plugin port to 0.9, ogg/theora playback should work in the seek
example now.
Removed old examples.
Removed old oggvorbisenc, renamed rawvorbisenc to vorbisenc as
explained in 0.9 TODO doc.
parent 66cd4c10
2005-03-31 Wim Taymans <wim@fluendo.com>
* examples/seeking/Makefile.am:
* examples/seeking/cdparanoia.c: (main):
* examples/seeking/cdplayer.c: (update_scale), (stop_seek),
(play_cb), (pause_cb), (stop_cb), (main):
* examples/seeking/playbin.c:
* examples/seeking/seek.c: (dynamic_link), (make_mod_pipeline),
(make_dv_pipeline), (make_wav_pipeline), (make_flac_pipeline),
(make_sid_pipeline), (make_vorbis_pipeline),
(make_theora_pipeline), (make_vorbis_theora_pipeline),
(make_avi_msmpeg4v3_mp3_pipeline), (make_mp3_pipeline),
(make_avi_pipeline), (make_mpeg_pipeline), (make_mpegnt_pipeline),
(make_playerbin_pipeline), (update_scale), (end_scrub), (do_seek),
(seek_cb), (start_seek), (stop_seek), (play_cb), (pause_cb),
(stop_cb), (main):
* examples/seeking/spider_seek.c:
* examples/seeking/vorbisfile.c:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_base_init),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_get_property), (gst_gnomevfssrc_get),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file),
(gst_gnomevfssrc_getrange), (gst_gnomevfssrc_loop),
(gst_gnomevfssrc_activate), (gst_gnomevfssrc_change_state),
(gst_gnomevfssrc_srcpad_query), (gst_gnomevfssrc_srcpad_event):
* ext/ogg/README:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_get_type),
(gst_ogg_pad_class_init), (gst_ogg_pad_init),
(gst_ogg_pad_dispose), (gst_ogg_pad_finalize),
(gst_ogg_pad_formats), (gst_ogg_pad_event_masks),
(gst_ogg_pad_query_types), (gst_ogg_pad_getcaps),
(gst_ogg_pad_src_convert), (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_pad_reset),
(gst_ogg_demux_factory_filter), (compare_ranks),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_pad_submit_packet), (gst_ogg_pad_submit_page),
(gst_ogg_chain_new), (gst_ogg_chain_free),
(gst_ogg_chain_new_stream), (gst_ogg_chain_get_stream),
(gst_ogg_chain_has_stream), (gst_ogg_demux_base_init),
(gst_ogg_demux_class_init), (gst_ogg_demux_init),
(gst_ogg_demux_finalize), (gst_ogg_demux_handle_event),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_seek),
(gst_ogg_demux_get_data), (gst_ogg_demux_get_next_page),
(gst_ogg_demux_get_prev_page),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain),
(gst_ogg_demux_find_pad), (gst_ogg_demux_find_chain),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain_unlocked),
(gst_ogg_demux_chain), (gst_ogg_demux_send_eos),
(gst_ogg_demux_loop), (gst_ogg_demux_sink_activate),
(gst_ogg_demux_change_state), (gst_ogg_print):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_class_init),
(gst_ogg_mux_init), (gst_ogg_mux_sinkconnect),
(gst_ogg_mux_next_buffer), (gst_ogg_mux_buffer_from_page),
(gst_ogg_mux_push_page), (gst_ogg_mux_send_headers),
(gst_ogg_mux_loop):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (gst_theora_dec_init), (_inc_granulepos),
(theora_dec_src_convert), (theora_dec_sink_convert),
(theora_dec_src_query), (theora_dec_src_event),
(theora_dec_sink_event), (theora_dec_chain),
(theora_dec_change_state):
* ext/theora/theoraenc.c: (gst_theora_enc_init),
(theora_enc_sink_setcaps), (theora_buffer_from_packet),
(theora_push_buffer), (theora_enc_sink_event), (theora_enc_chain),
(theora_enc_change_state):
* ext/vorbis/Makefile.am:
* ext/vorbis/oggvorbisenc.c:
* ext/vorbis/oggvorbisenc.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (gst_vorbis_dec_init),
(vorbis_dec_src_query), (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_dec_chain),
(vorbis_dec_change_state):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_class_init),
(gst_vorbisenc_sink_setcaps), (gst_vorbisenc_init),
(gst_vorbisenc_buffer_from_packet), (gst_vorbisenc_push_buffer),
(gst_vorbisenc_sink_event), (gst_vorbisenc_chain),
(gst_vorbisenc_change_state):
* ext/vorbis/vorbisenc.h:
* ext/vorbis/vorbisparse.c: (vorbis_parse_chain):
* gst-libs/gst/audio/audioclock.c:
* gst-libs/gst/audio/gstaudiofilter.c: (gst_audiofilter_link),
(gst_audiofilter_init), (gst_audiofilter_chain):
* gst-libs/gst/audio/testchannels.c: (main):
* gst-libs/gst/gconf/gconf.c: (gst_bin_find_unconnected_pad):
* gst-libs/gst/media-info/media-info-priv.c: (gmip_reset),
(gmip_find_type), (gmip_find_stream), (gmip_find_track_metadata),
(gmip_find_track_streaminfo), (gmip_find_track_format):
* gst-libs/gst/media-info/media-info.c:
(gst_media_info_read_idler):
* gst-libs/gst/play/play.c: (gst_play_get_sink_element),
(gst_play_get_all_by_interface):
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_chunk),
(gst_riff_parse_chunk), (gst_riff_parse_file_header),
(gst_riff_parse_strh), (gst_riff_parse_strf_vids),
(gst_riff_parse_strf_auds), (gst_riff_parse_strf_iavs),
(gst_riff_parse_info):
* gst-libs/gst/riff/riff-read.h:
* gst-libs/gst/riff/riff.c: (plugin_init):
* gst-libs/gst/video/Makefile.am:
* gst-libs/gst/video/gstvideosink.c: (gst_videosink_init),
(gst_videosink_class_init), (gst_videosink_get_type):
* gst-libs/gst/video/videosink.h:
* gst/audioconvert/bufferframesconvert.c:
(buffer_frames_convert_init), (buffer_frames_convert_fixate),
(buffer_frames_convert_setcaps), (buffer_frames_convert_chain):
* gst/audioconvert/channelmixtest.c: (main):
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_init),
(gst_audio_convert_chain),
(gst_audio_convert_caps_remove_format_info),
(gst_audio_convert_getcaps), (gst_audio_convert_parse_caps),
(gst_audio_convert_setcaps), (_fixate_caps_to_int),
(gst_audio_convert_fixate), (gst_audio_convert_get_buffer),
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format),
(gst_audio_convert_channels):
* gst/audioconvert/gstchannelmix.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_caps_remove_format_info), (gst_ffmpegcsp_getcaps),
(gst_ffmpegcsp_configure_context), (gst_ffmpegcsp_setcaps),
(gst_ffmpegcsp_init), (gst_ffmpegcsp_chain):
* gst/tags/gstid3tag.c: (gst_tag_extract_id3v1_string):
* gst/tags/gstvorbistag.c: (gst_vorbis_tag_chain):
* gst/typefind/gsttypefindfunctions.c: (aac_type_find),
(mp3_type_find), (mpeg2_sys_type_find), (mpeg1_sys_type_find),
(mpeg_video_type_find), (mpeg_video_stream_type_find),
(dv_type_find):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_class_init), (gst_videotestsrc_src_negotiate),
(gst_videotestsrc_src_link), (gst_videotestsrc_parse_caps),
(gst_videotestsrc_src_accept_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_src_unlink), (gst_videotestsrc_activate),
(gst_videotestsrc_change_state), (gst_videotestsrc_getcaps),
(gst_videotestsrc_init), (gst_videotestsrc_src_query),
(gst_videotestsrc_handle_src_event), (gst_videotestsrc_loop):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear), (gst_xvimagesink_fixate),
(gst_xvimagesink_getcaps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_get_times),
(gst_xvimagesink_show_frame), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_expose),
(gst_xvimagesink_set_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
Plugin port to 0.9, ogg/theora playback should work in the seek
example now.
Removed old examples.
Removed old oggvorbisenc, renamed rawvorbisenc to vorbisenc as
explained in 0.9 TODO doc.
2005-02-23 Thomas Vander Stichele <thomas at apestaart dot org>
* autogen.sh:
......
common @ 131c2632
Subproject commit b2638c100721f67b280c3b43b21f1ce1c9b5e316
Subproject commit 131c2632127e6f061b5270d8f80651782a4fdd13
examples = seek spider_seek cdplayer cdparanoia vorbisfile playbin chained
examples = seek cdplayer cdparanoia
noinst_PROGRAMS = $(examples)
......
......@@ -159,7 +159,7 @@ main (int argc, char **argv)
gst_element_link_pads (cdparanoia, "src", audiosink, "sink");
g_signal_connect (G_OBJECT (pipeline), "deep_notify",
G_CALLBACK (gst_element_default_deep_notify), NULL);
G_CALLBACK (gst_object_default_deep_notify), NULL);
gst_element_set_state (pipeline, GST_STATE_PAUSED);
......@@ -184,10 +184,9 @@ main (int argc, char **argv)
gst_element_set_state (pipeline, GST_STATE_PLAYING);
count = 0;
while (gst_bin_iterate (GST_BIN (pipeline))) {
while (count++ < 500) {
get_position_info (cdparanoia);
if (count++ > 500)
break;
g_usleep (G_USEC_PER_SEC / 2);
}
gst_element_set_state (pipeline, GST_STATE_PAUSED);
......@@ -202,8 +201,10 @@ main (int argc, char **argv)
gst_element_set_state (pipeline, GST_STATE_PLAYING);
while (gst_bin_iterate (GST_BIN (pipeline))) {
count = 0;
while (count++ < 500) {
get_position_info (cdparanoia);
g_usleep (G_USEC_PER_SEC / 2);
}
g_print ("\n");
......
......@@ -125,7 +125,7 @@ update_scale (gpointer data)
GstFormat format = GST_FORMAT_TIME;
duration = 0;
clock = gst_bin_get_clock (GST_BIN (pipeline));
clock = gst_pipeline_get_clock (GST_PIPELINE (pipeline));
if (seekable_elements) {
GstElement *element = GST_ELEMENT (seekable_elements->data);
......@@ -148,20 +148,6 @@ update_scale (gpointer data)
return TRUE;
}
static gboolean
iterate (gpointer data)
{
gboolean res = TRUE;
g_print ("iterate\n");
res = gst_bin_iterate (GST_BIN (data));
if (!res) {
gtk_timeout_remove (update_id);
g_print ("stopping iterations\n");
}
return res;
}
static gboolean
start_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data)
{
......@@ -194,8 +180,6 @@ stop_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data)
}
gst_element_set_state (pipeline, GST_STATE_PLAYING);
if (!GST_FLAG_IS_SET (pipeline, GST_BIN_SELF_SCHEDULABLE))
gtk_idle_add ((GtkFunction) iterate, pipeline);
update_id =
gtk_timeout_add (UPDATE_INTERVAL, (GtkFunction) update_scale, pipeline);
......@@ -205,10 +189,11 @@ stop_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data)
static void
play_cb (GtkButton * button, gpointer data)
{
if (gst_element_get_state (pipeline) != GST_STATE_PLAYING) {
GstElementState state;
gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_PLAYING) {
gst_element_set_state (pipeline, GST_STATE_PLAYING);
if (!GST_FLAG_IS_SET (pipeline, GST_BIN_SELF_SCHEDULABLE))
gtk_idle_add ((GtkFunction) iterate, pipeline);
update_id =
gtk_timeout_add (UPDATE_INTERVAL, (GtkFunction) update_scale, pipeline);
}
......@@ -217,7 +202,10 @@ play_cb (GtkButton * button, gpointer data)
static void
pause_cb (GtkButton * button, gpointer data)
{
if (gst_element_get_state (pipeline) != GST_STATE_PAUSED) {
GstElementState state;
gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_PAUSED) {
gst_element_set_state (pipeline, GST_STATE_PAUSED);
gtk_timeout_remove (update_id);
}
......@@ -226,7 +214,10 @@ pause_cb (GtkButton * button, gpointer data)
static void
stop_cb (GtkButton * button, gpointer data)
{
if (gst_element_get_state (pipeline) != GST_STATE_READY) {
GstElementState state;
gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_READY) {
gst_element_set_state (pipeline, GST_STATE_READY);
gtk_timeout_remove (update_id);
}
......@@ -249,9 +240,7 @@ main (int argc, char **argv)
pipeline = make_cdaudio_pipeline ();
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);
G_CALLBACK (gst_object_default_deep_notify), NULL);
/* initialize gui elements ... */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
......
#include <stdlib.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <gst/gst.h>
#include <string.h>
static GstElement *playbin = NULL;
static GstElement *pipeline;
static guint64 duration;
static GtkAdjustment *adjustment;
static GtkWidget *hscale;
static gboolean verbose = FALSE;
static guint update_id;
#define UPDATE_INTERVAL 500
static GstElement *
make_playerbin_pipeline (const gchar * location)
{
playbin = gst_element_factory_make ("playbin", "player");
g_assert (playbin);
g_object_set (G_OBJECT (playbin), "uri", location, NULL);
return playbin;
}
static gchar *
format_value (GtkScale * scale, gdouble value)
{
gint64 real;
gint64 seconds;
gint64 subseconds;
real = value * duration / 100;
seconds = (gint64) real / GST_SECOND;
subseconds = (gint64) real / (GST_SECOND / 100);
return g_strdup_printf ("%02" G_GINT64_FORMAT ":%02" G_GINT64_FORMAT ":%02"
G_GINT64_FORMAT, seconds / 60, seconds % 60, subseconds % 100);
}
static gboolean
update_scale (gpointer data)
{
GstClock *clock;
guint64 position;
GstFormat format = GST_FORMAT_TIME;
gboolean res;
duration = 0;
clock = gst_bin_get_clock (GST_BIN (pipeline));
res = gst_element_query (playbin, GST_QUERY_TOTAL, &format, &duration);
if (!res)
duration = 0;
res = gst_element_query (playbin, GST_QUERY_POSITION, &format, &position);
if (!res)
position = 0;
if (position >= duration)
duration = position;
if (duration > 0) {
gtk_adjustment_set_value (adjustment, position * 100.0 / duration);
gtk_widget_queue_draw (hscale);
}
return TRUE;
}
static gboolean
iterate (gpointer data)
{
gboolean res;
if (!GST_FLAG_IS_SET (GST_OBJECT (data), GST_BIN_SELF_SCHEDULABLE)) {
res = gst_bin_iterate (GST_BIN (data));
} else {
g_usleep (UPDATE_INTERVAL);
res = gst_element_get_state (GST_ELEMENT (data)) == GST_STATE_PLAYING;
}
if (!res) {
gtk_timeout_remove (update_id);
g_print ("stopping iterations\n");
}
return res;
}
static gboolean
start_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data)
{
gst_element_set_state (pipeline, GST_STATE_PAUSED);
gtk_timeout_remove (update_id);
return FALSE;
}
static gboolean
stop_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data)
{
gint64 real = gtk_range_get_value (GTK_RANGE (widget)) * duration / 100;
gboolean res;
GstEvent *s_event;
g_print ("seek to %" G_GINT64_FORMAT " on element %s\n", real,
gst_element_get_name (playbin));
s_event =
gst_event_new_seek (GST_FORMAT_TIME | GST_SEEK_METHOD_SET |
GST_SEEK_FLAG_FLUSH, real);
res = gst_element_send_event (playbin, s_event);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
gtk_idle_add ((GtkFunction) iterate, pipeline);
update_id =
gtk_timeout_add (UPDATE_INTERVAL, (GtkFunction) update_scale, pipeline);
return FALSE;
}
static void
print_media_info (GstElement * playbin)
{
GList *streaminfo;
GList *s;
g_print ("have media info now\n");
/* get info about the stream */
g_object_get (G_OBJECT (playbin), "stream-info", &streaminfo, NULL);
for (s = streaminfo; s; s = g_list_next (s)) {
GObject *obj = G_OBJECT (s->data);
gint type;
gboolean mute;
g_object_get (obj, "type", &type, NULL);
g_object_get (obj, "mute", &mute, NULL);
g_print ("%d %d\n", type, mute);
}
}
static void
play_cb (GtkButton * button, gpointer data)
{
if (gst_element_get_state (pipeline) != GST_STATE_PLAYING) {
GstElementStateReturn res;
res = gst_element_set_state (pipeline, GST_STATE_PAUSED);
if (res == GST_STATE_SUCCESS) {
print_media_info (playbin);
res = gst_element_set_state (pipeline, GST_STATE_PLAYING);
gtk_idle_add ((GtkFunction) iterate, pipeline);
update_id =
gtk_timeout_add (UPDATE_INTERVAL, (GtkFunction) update_scale,
pipeline);
} else {
g_print ("failed playing\n");
}
}
}
static void
pause_cb (GtkButton * button, gpointer data)
{
if (gst_element_get_state (pipeline) != GST_STATE_PAUSED) {
gst_element_set_state (pipeline, GST_STATE_PAUSED);
gtk_timeout_remove (update_id);
}
}
static void
stop_cb (GtkButton * button, gpointer data)
{
if (gst_element_get_state (pipeline) != GST_STATE_READY) {
gst_element_set_state (pipeline, GST_STATE_READY);
gtk_adjustment_set_value (adjustment, 0.0);
gtk_timeout_remove (update_id);
}
}
static void
print_usage (int argc, char **argv)
{
g_print ("usage: %s <uri>\n", argv[0]);
}
int
main (int argc, char **argv)
{
GtkWidget *window, *hbox, *vbox, *play_button, *pause_button, *stop_button;
struct poptOption options[] = {
{"verbose", 'v', POPT_ARG_NONE | POPT_ARGFLAG_STRIP, &verbose, 0,
"Verbose properties", NULL},
POPT_TABLEEND
};
gst_init_with_popt_table (&argc, &argv, options);
gtk_init (&argc, &argv);
if (argc != 2) {
print_usage (argc, argv);
exit (-1);
}
pipeline = make_playerbin_pipeline (argv[1]);
g_assert (pipeline);
/* initialize gui elements ... */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
hbox = gtk_hbox_new (FALSE, 0);
vbox = gtk_vbox_new (FALSE, 0);
play_button = gtk_button_new_with_label ("play");
pause_button = gtk_button_new_with_label ("pause");
stop_button = gtk_button_new_with_label ("stop");
adjustment =
GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.00, 100.0, 0.1, 1.0, 1.0));
hscale = gtk_hscale_new (adjustment);
gtk_scale_set_digits (GTK_SCALE (hscale), 2);
gtk_range_set_update_policy (GTK_RANGE (hscale), GTK_UPDATE_CONTINUOUS);
gtk_signal_connect (GTK_OBJECT (hscale),
"button_press_event", G_CALLBACK (start_seek), pipeline);
gtk_signal_connect (GTK_OBJECT (hscale),
"button_release_event", G_CALLBACK (stop_seek), pipeline);
gtk_signal_connect (GTK_OBJECT (hscale),
"format_value", G_CALLBACK (format_value), pipeline);
/* do the packing stuff ... */
gtk_window_set_default_size (GTK_WINDOW (window), 96, 96);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_box_pack_start (GTK_BOX (hbox), play_button, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), pause_button, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), stop_button, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (vbox), hscale, TRUE, TRUE, 2);
/* connect things ... */
g_signal_connect (G_OBJECT (play_button), "clicked", G_CALLBACK (play_cb),
pipeline);
g_signal_connect (G_OBJECT (pause_button), "clicked", G_CALLBACK (pause_cb),
pipeline);
g_signal_connect (G_OBJECT (stop_button), "clicked", G_CALLBACK (stop_cb),
pipeline);
g_signal_connect (G_OBJECT (window), "delete_event", gtk_main_quit, NULL);
/* show the gui. */
gtk_widget_show_all (window);
if (verbose) {
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));
return 0;
}
This diff is collapsed.
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <gst/gst.h>
#include <string.h>
static GList *rate_pads = NULL;
static GList *seekable_elements = NULL;
static GstElement *pipeline;
static GtkAdjustment *adjustment;
static gboolean stats = FALSE;
static guint64 duration;
static guint update_id;
//#define SOURCE "gnomevfssrc"
#define SOURCE "filesrc"
#define UPDATE_INTERVAL 500
static GstElement *
make_spider_pipeline (const gchar * location, gboolean thread)
{
GstElement *pipeline;
GstElement *src, *decoder, *audiosink, *videosink, *a_thread, *v_thread,
*a_queue, *v_queue;
if (thread) {
pipeline = gst_thread_new ("app");
} else {
pipeline = gst_pipeline_new ("app");
}
src = gst_element_factory_make (SOURCE, "src");
decoder = gst_element_factory_make ("spider", "decoder");
a_thread = gst_thread_new ("a_thread");
a_queue = gst_element_factory_make ("queue", "a_queue");
audiosink = gst_element_factory_make (DEFAULT_AUDIOSINK, "a_sink");
//g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL);
v_thread = gst_thread_new ("v_thread");
v_queue = gst_element_factory_make ("queue", "v_queue");
videosink = gst_element_factory_make (DEFAULT_VIDEOSINK, "v_sink");
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
gst_bin_add (GST_BIN (pipeline), src);
gst_bin_add (GST_BIN (pipeline), decoder);
gst_bin_add (GST_BIN (a_thread), a_queue);
gst_bin_add (GST_BIN (a_thread), audiosink);
gst_bin_add (GST_BIN (v_thread), v_queue);
gst_bin_add (GST_BIN (v_thread), videosink);
gst_bin_add (GST_BIN (pipeline), a_thread);
gst_bin_add (GST_BIN (pipeline), v_thread);
gst_element_link (src, decoder);
gst_element_link (v_queue, videosink);