Commit 60a59653 authored by Wim Taymans's avatar Wim Taymans

seek: cleanup and use playbin after rename

Remove the static pipelines and other unused things
Use playbin
parent 3a37e38c
......@@ -84,8 +84,6 @@ static gchar *opt_videosink_str; /* NULL */
#define N_GRAD 1000.0
static GList *seekable_pads = NULL;
static GList *rate_pads = NULL;
static GList *seekable_elements = NULL;
static gboolean accurate_seek = FALSE;
......@@ -106,7 +104,6 @@ static GtkAdjustment *adjustment;
static GtkWidget *hscale, *statusbar;
static guint status_id = 0;
static gboolean stats = FALSE;
static gboolean elem_seek = FALSE;
static gboolean verbose = FALSE;
static gboolean is_live = FALSE;
......@@ -171,744 +168,6 @@ gst_element_factory_make_or_warn (const gchar * type, const gchar * name)
return element;
}
static void
dynamic_link (GstPadTemplate * templ, GstPad * newpad, gpointer data)
{
gchar *padname;
dyn_link *connect = (dyn_link *) data;
padname = gst_pad_get_name (newpad);
if (connect->padname == NULL || !strcmp (padname, connect->padname)) {
if (connect->bin)
gst_bin_add (GST_BIN (pipeline), connect->bin);
gst_pad_link (newpad, connect->target);
//seekable_pads = g_list_prepend (seekable_pads, newpad);
rate_pads = g_list_prepend (rate_pads, newpad);
}
g_free (padname);
}
static void
setup_dynamic_link (GstElement * element, const gchar * padname,
GstPad * target, GstElement * bin)
{
dyn_link *connect;
connect = g_new0 (dyn_link, 1);
connect->padname = g_strdup (padname);
connect->target = target;
connect->bin = bin;
g_signal_connect (G_OBJECT (element), "pad-added", G_CALLBACK (dynamic_link),
connect);
}
static GstElement *
make_mod_pipeline (const gchar * location)
{
GstElement *pipeline;
GstElement *src, *decoder, *audiosink;
GstPad *seekable;
pipeline = gst_pipeline_new ("app");
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("modplug", "decoder");
audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "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 (pipeline), audiosink);
gst_element_link (src, decoder);
gst_element_link (decoder, audiosink);
seekable = gst_element_get_static_pad (decoder, "src");
seekable_pads = g_list_prepend (seekable_pads, seekable);
rate_pads = g_list_prepend (rate_pads, seekable);
rate_pads =
g_list_prepend (rate_pads, gst_element_get_static_pad (decoder, "sink"));
return pipeline;
}
static GstElement *
make_dv_pipeline (const gchar * location)
{
GstElement *pipeline;
GstElement *src, *demux, *decoder, *audiosink, *videosink;
GstElement *a_queue, *v_queue;
GstPad *seekable;
pipeline = gst_pipeline_new ("app");
src = gst_element_factory_make_or_warn (SOURCE, "src");
demux = gst_element_factory_make_or_warn ("dvdemux", "demuxer");
v_queue = gst_element_factory_make_or_warn ("queue", "v_queue");
decoder = gst_element_factory_make_or_warn ("ffdec_dvvideo", "decoder");
videosink = gst_element_factory_make_or_warn (opt_videosink_str, "v_sink");
a_queue = gst_element_factory_make_or_warn ("queue", "a_queue");
audiosink = gst_element_factory_make_or_warn ("alsasink", "a_sink");
g_object_set (G_OBJECT (src), "location", location, NULL);
gst_bin_add (GST_BIN (pipeline), src);
gst_bin_add (GST_BIN (pipeline), demux);
gst_bin_add (GST_BIN (pipeline), a_queue);
gst_bin_add (GST_BIN (pipeline), audiosink);
gst_bin_add (GST_BIN (pipeline), v_queue);
gst_bin_add (GST_BIN (pipeline), decoder);
gst_bin_add (GST_BIN (pipeline), videosink);
gst_element_link (src, demux);
gst_element_link (a_queue, audiosink);
gst_element_link (v_queue, decoder);
gst_element_link (decoder, videosink);
setup_dynamic_link (demux, "video", gst_element_get_static_pad (v_queue,
"sink"), NULL);
setup_dynamic_link (demux, "audio", gst_element_get_static_pad (a_queue,
"sink"), NULL);
seekable = gst_element_get_static_pad (decoder, "src");
seekable_pads = g_list_prepend (seekable_pads, seekable);
rate_pads = g_list_prepend (rate_pads, seekable);
return pipeline;
}
static GstElement *
make_wav_pipeline (const gchar * location)
{
GstElement *pipeline;
GstElement *src, *decoder, *audiosink;
pipeline = gst_pipeline_new ("app");
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("wavparse", "decoder");
audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "sink");
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 (pipeline), audiosink);
gst_element_link (src, decoder);
setup_dynamic_link (decoder, "src", gst_element_get_static_pad (audiosink,
"sink"), NULL);
seekable_elements = g_list_prepend (seekable_elements, audiosink);
/* force element seeking on this pipeline */
elem_seek = TRUE;
return pipeline;
}
static GstElement *
make_flac_pipeline (const gchar * location)
{
GstElement *pipeline;
GstElement *src, *decoder, *audiosink;
GstPad *seekable;
pipeline = gst_pipeline_new ("app");
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("flacdec", "decoder");
audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "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 (pipeline), audiosink);
gst_element_link (src, decoder);
gst_element_link (decoder, audiosink);
seekable = gst_element_get_static_pad (decoder, "src");
seekable_pads = g_list_prepend (seekable_pads, seekable);
rate_pads = g_list_prepend (rate_pads, seekable);
rate_pads =
g_list_prepend (rate_pads, gst_element_get_static_pad (decoder, "sink"));
return pipeline;
}
static GstElement *
make_sid_pipeline (const gchar * location)
{
GstElement *pipeline;
GstElement *src, *decoder, *audiosink;
GstPad *seekable;
pipeline = gst_pipeline_new ("app");
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("siddec", "decoder");
audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "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 (pipeline), audiosink);
gst_element_link (src, decoder);
gst_element_link (decoder, audiosink);
seekable = gst_element_get_static_pad (decoder, "src");
seekable_pads = g_list_prepend (seekable_pads, seekable);
rate_pads = g_list_prepend (rate_pads, seekable);
rate_pads =
g_list_prepend (rate_pads, gst_element_get_static_pad (decoder, "sink"));
return pipeline;
}
static GstElement *
make_parse_pipeline (const gchar * location)
{
GstElement *pipeline;
GstElement *src, *parser, *fakesink;
GstPad *seekable;
pipeline = gst_pipeline_new ("app");
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), "silent", TRUE, NULL);
g_object_set (G_OBJECT (fakesink), "sync", TRUE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
gst_bin_add (GST_BIN (pipeline), src);
gst_bin_add (GST_BIN (pipeline), parser);
gst_bin_add (GST_BIN (pipeline), fakesink);
gst_element_link (src, parser);
gst_element_link (parser, fakesink);
seekable = gst_element_get_static_pad (parser, "src");
seekable_pads = g_list_prepend (seekable_pads, seekable);
rate_pads = g_list_prepend (rate_pads, seekable);
rate_pads =
g_list_prepend (rate_pads, gst_element_get_static_pad (parser, "sink"));
return pipeline;
}
static GstElement *
make_vorbis_pipeline (const gchar * location)
{
GstElement *pipeline, *audio_bin;
GstElement *src, *demux, *decoder, *convert, *audiosink;
GstPad *pad, *seekable;
pipeline = gst_pipeline_new ("app");
src = gst_element_factory_make_or_warn (SOURCE, "src");
demux = gst_element_factory_make_or_warn ("oggdemux", "demux");
decoder = gst_element_factory_make_or_warn ("vorbisdec", "decoder");
convert = gst_element_factory_make_or_warn ("audioconvert", "convert");
audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "sink");
g_object_set (G_OBJECT (audiosink), "sync", TRUE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
audio_bin = gst_bin_new ("a_decoder_bin");
gst_bin_add (GST_BIN (pipeline), src);
gst_bin_add (GST_BIN (pipeline), demux);
gst_bin_add (GST_BIN (audio_bin), decoder);
gst_bin_add (GST_BIN (audio_bin), convert);
gst_bin_add (GST_BIN (audio_bin), audiosink);
gst_bin_add (GST_BIN (pipeline), audio_bin);
gst_element_link (src, demux);
gst_element_link (decoder, convert);
gst_element_link (convert, audiosink);
pad = gst_element_get_static_pad (decoder, "sink");
gst_element_add_pad (audio_bin, gst_ghost_pad_new ("sink", pad));
gst_object_unref (pad);
setup_dynamic_link (demux, NULL, gst_element_get_static_pad (audio_bin,
"sink"), NULL);
seekable = gst_element_get_static_pad (decoder, "src");
seekable_pads = g_list_prepend (seekable_pads, seekable);
rate_pads = g_list_prepend (rate_pads, seekable);
rate_pads =
g_list_prepend (rate_pads, gst_element_get_static_pad (decoder, "sink"));
return pipeline;
}
static GstElement *
make_theora_pipeline (const gchar * location)
{
GstElement *pipeline, *video_bin;
GstElement *src, *demux, *decoder, *convert, *videosink;
GstPad *pad, *seekable;
pipeline = gst_pipeline_new ("app");
src = gst_element_factory_make_or_warn (SOURCE, "src");
demux = gst_element_factory_make_or_warn ("oggdemux", "demux");
decoder = gst_element_factory_make_or_warn ("theoradec", "decoder");
convert = gst_element_factory_make_or_warn ("ffmpegcolorspace", "convert");
videosink = gst_element_factory_make_or_warn (opt_videosink_str, "sink");
g_object_set (G_OBJECT (src), "location", location, NULL);
video_bin = gst_bin_new ("v_decoder_bin");
gst_bin_add (GST_BIN (pipeline), src);
gst_bin_add (GST_BIN (pipeline), demux);
gst_bin_add (GST_BIN (video_bin), decoder);
gst_bin_add (GST_BIN (video_bin), convert);
gst_bin_add (GST_BIN (video_bin), videosink);
gst_bin_add (GST_BIN (pipeline), video_bin);
gst_element_link (src, demux);
gst_element_link (decoder, convert);
gst_element_link (convert, videosink);
pad = gst_element_get_static_pad (decoder, "sink");
gst_element_add_pad (video_bin, gst_ghost_pad_new ("sink", pad));
gst_object_unref (pad);
setup_dynamic_link (demux, NULL, gst_element_get_static_pad (video_bin,
"sink"), NULL);
seekable = gst_element_get_static_pad (decoder, "src");
seekable_pads = g_list_prepend (seekable_pads, seekable);
rate_pads = g_list_prepend (rate_pads, seekable);
rate_pads =
g_list_prepend (rate_pads, gst_element_get_static_pad (decoder, "sink"));
return pipeline;
}
static GstElement *
make_vorbis_theora_pipeline (const gchar * location)
{
GstElement *pipeline, *audio_bin, *video_bin;
GstElement *src, *demux, *a_decoder, *a_convert, *v_decoder, *v_convert;
GstElement *audiosink, *videosink;
GstElement *a_queue, *v_queue, *v_scale;
GstPad *seekable;
GstPad *pad;
pipeline = gst_pipeline_new ("app");
src = gst_element_factory_make_or_warn (SOURCE, "src");
g_object_set (G_OBJECT (src), "location", location, NULL);
demux = gst_element_factory_make_or_warn ("oggdemux", "demux");
gst_bin_add (GST_BIN (pipeline), src);
gst_bin_add (GST_BIN (pipeline), demux);
gst_element_link (src, demux);
audio_bin = gst_bin_new ("a_decoder_bin");
a_queue = gst_element_factory_make_or_warn ("queue", "a_queue");
a_decoder = gst_element_factory_make_or_warn ("vorbisdec", "a_dec");
a_convert = gst_element_factory_make_or_warn ("audioconvert", "a_convert");
audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "a_sink");
gst_bin_add (GST_BIN (pipeline), audio_bin);
gst_bin_add (GST_BIN (audio_bin), a_queue);
gst_bin_add (GST_BIN (audio_bin), a_decoder);
gst_bin_add (GST_BIN (audio_bin), a_convert);
gst_bin_add (GST_BIN (audio_bin), audiosink);
gst_element_link (a_queue, a_decoder);
gst_element_link (a_decoder, a_convert);
gst_element_link (a_convert, audiosink);
pad = gst_element_get_static_pad (a_queue, "sink");
gst_element_add_pad (audio_bin, gst_ghost_pad_new ("sink", pad));
gst_object_unref (pad);
setup_dynamic_link (demux, NULL, gst_element_get_static_pad (audio_bin,
"sink"), NULL);
video_bin = gst_bin_new ("v_decoder_bin");
v_queue = gst_element_factory_make_or_warn ("queue", "v_queue");
v_decoder = gst_element_factory_make_or_warn ("theoradec", "v_dec");
v_convert =
gst_element_factory_make_or_warn ("ffmpegcolorspace", "v_convert");
v_scale = gst_element_factory_make_or_warn ("videoscale", "v_scale");
videosink = gst_element_factory_make_or_warn (opt_videosink_str, "v_sink");
gst_bin_add (GST_BIN (pipeline), video_bin);
gst_bin_add (GST_BIN (video_bin), v_queue);
gst_bin_add (GST_BIN (video_bin), v_decoder);
gst_bin_add (GST_BIN (video_bin), v_convert);
gst_bin_add (GST_BIN (video_bin), v_scale);
gst_bin_add (GST_BIN (video_bin), videosink);
gst_element_link_many (v_queue, v_decoder, v_convert, v_scale, videosink,
NULL);
pad = gst_element_get_static_pad (v_queue, "sink");
gst_element_add_pad (video_bin, gst_ghost_pad_new ("sink", pad));
gst_object_unref (pad);
setup_dynamic_link (demux, NULL, gst_element_get_static_pad (video_bin,
"sink"), NULL);
seekable = gst_element_get_static_pad (a_decoder, "src");
seekable_pads = g_list_prepend (seekable_pads, seekable);
rate_pads = g_list_prepend (rate_pads, seekable);
rate_pads =
g_list_prepend (rate_pads, gst_element_get_static_pad (a_decoder,
"sink"));
return pipeline;
}
static GstElement *
make_avi_msmpeg4v3_mp3_pipeline (const gchar * location)
{
GstElement *pipeline, *audio_bin, *video_bin;
GstElement *src, *demux, *a_decoder, *a_convert, *v_decoder, *v_convert;
GstElement *audiosink, *videosink;
GstElement *a_queue, *v_queue;
GstPad *seekable, *pad;
pipeline = gst_pipeline_new ("app");
src = gst_element_factory_make_or_warn (SOURCE, "src");
g_object_set (G_OBJECT (src), "location", location, NULL);
demux = gst_element_factory_make_or_warn ("avidemux", "demux");
gst_bin_add (GST_BIN (pipeline), src);
gst_bin_add (GST_BIN (pipeline), demux);
gst_element_link (src, demux);
audio_bin = gst_bin_new ("a_decoder_bin");
a_queue = gst_element_factory_make_or_warn ("queue", "a_queue");
a_decoder = gst_element_factory_make_or_warn ("mad", "a_dec");
a_convert = gst_element_factory_make_or_warn ("audioconvert", "a_convert");
audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "a_sink");
gst_bin_add (GST_BIN (audio_bin), a_queue);
gst_bin_add (GST_BIN (audio_bin), a_decoder);
gst_bin_add (GST_BIN (audio_bin), a_convert);
gst_bin_add (GST_BIN (audio_bin), audiosink);
gst_element_link (a_queue, a_decoder);
gst_element_link (a_decoder, a_convert);
gst_element_link (a_convert, audiosink);
gst_bin_add (GST_BIN (pipeline), audio_bin);
pad = gst_element_get_static_pad (a_queue, "sink");
gst_element_add_pad (audio_bin, gst_ghost_pad_new ("sink", pad));
gst_object_unref (pad);
setup_dynamic_link (demux, NULL, gst_element_get_static_pad (audio_bin,
"sink"), NULL);
video_bin = gst_bin_new ("v_decoder_bin");
v_queue = gst_element_factory_make_or_warn ("queue", "v_queue");
v_decoder = gst_element_factory_make_or_warn ("ffdec_msmpeg4", "v_dec");
v_convert =
gst_element_factory_make_or_warn ("ffmpegcolorspace", "v_convert");
videosink = gst_element_factory_make_or_warn (opt_videosink_str, "v_sink");
gst_bin_add (GST_BIN (video_bin), v_queue);
gst_bin_add (GST_BIN (video_bin), v_decoder);
gst_bin_add (GST_BIN (video_bin), v_convert);
gst_bin_add (GST_BIN (video_bin), videosink);
gst_element_link_many (v_queue, v_decoder, v_convert, videosink, NULL);
gst_bin_add (GST_BIN (pipeline), video_bin);
pad = gst_element_get_static_pad (v_queue, "sink");
gst_element_add_pad (video_bin, gst_ghost_pad_new ("sink", pad));
gst_object_unref (pad);
setup_dynamic_link (demux, NULL, gst_element_get_static_pad (video_bin,
"sink"), NULL);
seekable = gst_element_get_static_pad (a_decoder, "src");
seekable_pads = g_list_prepend (seekable_pads, seekable);
rate_pads = g_list_prepend (rate_pads, seekable);
rate_pads =
g_list_prepend (rate_pads, gst_element_get_static_pad (a_decoder,
"sink"));
return pipeline;
}
static GstElement *
make_mp3_pipeline (const gchar * location)
{
GstElement *pipeline;
GstElement *src, *parser, *decoder, *audiosink, *queue;
GstPad *seekable;
pipeline = gst_pipeline_new ("app");
src = gst_element_factory_make_or_warn (SOURCE, "src");
parser = gst_element_factory_make_or_warn ("mp3parse", "parse");
decoder = gst_element_factory_make_or_warn ("mad", "dec");
queue = gst_element_factory_make_or_warn ("queue", "queue");
audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "sink");
seekable_elements = g_list_prepend (seekable_elements, audiosink);
g_object_set (G_OBJECT (src), "location", location, NULL);
//g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL);
gst_bin_add (GST_BIN (pipeline), src);
gst_bin_add (GST_BIN (pipeline), parser);
gst_bin_add (GST_BIN (pipeline), decoder);
gst_bin_add (GST_BIN (pipeline), queue);
gst_bin_add (GST_BIN (pipeline), audiosink);
gst_element_link (src, parser);
gst_element_link (parser, decoder);
gst_element_link (decoder, queue);
gst_element_link (queue, audiosink);
seekable = gst_element_get_static_pad (queue, "src");
seekable_pads = g_list_prepend (seekable_pads, seekable);
rate_pads = g_list_prepend (rate_pads, seekable);
rate_pads =
g_list_prepend (rate_pads, gst_element_get_static_pad (decoder, "sink"));
return pipeline;
}
static GstElement *
make_avi_pipeline (const gchar * location)
{
GstElement *pipeline, *audio_bin, *video_bin;
GstElement *src, *demux, *a_decoder, *v_decoder, *audiosink, *videosink;
GstElement *a_queue = NULL, *v_queue = NULL;
GstPad *seekable;
pipeline = gst_pipeline_new ("app");
src = gst_element_factory_make_or_warn (SOURCE, "src");
g_object_set (G_OBJECT (src), "location", location, NULL);
demux = gst_element_factory_make_or_warn ("avidemux", "demux");
seekable_elements = g_list_prepend (seekable_elements, demux);
gst_bin_add (GST_BIN (pipeline), src);
gst_bin_add (GST_BIN (pipeline), demux);
gst_element_link (src, demux);
audio_bin = gst_bin_new ("a_decoder_bin");
a_decoder = gst_element_factory_make_or_warn ("mad", "a_dec");
audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "a_sink");
a_queue = gst_element_factory_make_or_warn ("queue", "a_queue");
gst_element_link (a_decoder, a_queue);
gst_element_link (a_queue, audiosink);
gst_bin_add (GST_BIN (audio_bin), a_decoder);
gst_bin_add (GST_BIN (audio_bin), a_queue);
gst_bin_add (GST_BIN (audio_bin), audiosink);
gst_element_set_state (audio_bin, GST_STATE_PAUSED);
setup_dynamic_link (demux, "audio_00", gst_element_get_static_pad (a_decoder,
"sink"), audio_bin);
seekable = gst_element_get_static_pad (a_queue, "src");
seekable_pads = g_list_prepend (seekable_pads, seekable);
rate_pads = g_list_prepend (rate_pads, seekable);
rate_pads =
g_list_prepend (rate_pads, gst_element_get_static_pad (a_decoder,
"sink"));
video_bin = gst_bin_new ("v_decoder_bin");
v_decoder = gst_element_factory_make_or_warn ("ffmpegdecall", "v_dec");
videosink = gst_element_factory_make_or_warn (opt_videosink_str, "v_sink");
v_queue = gst_element_factory_make_or_warn ("queue", "v_queue");
gst_element_link (v_decoder, v_queue);
gst_element_link (v_queue, videosink);
gst_bin_add (GST_BIN (video_bin), v_decoder);
gst_bin_add (GST_BIN (video_bin), v_queue);
gst_bin_add (GST_BIN (video_bin), videosink);
gst_element_set_state (video_bin, GST_STATE_PAUSED);
setup_dynamic_link (demux, "video_00", gst_element_get_static_pad (v_decoder,
"sink"), video_bin);
seekable = gst_element_get_static_pad (v_queue, "src");
seekable_pads = g_list_prepend (seekable_pads, seekable);
rate_pads = g_list_prepend (rate_pads, seekable);
rate_pads =
g_list_prepend (rate_pads, gst_element_get_static_pad (v_decoder,
"sink"));
return pipeline;
}
static GstElement *
make_mpeg_pipeline (const gchar * location)
{
GstElement *pipeline, *audio_bin, *video_bin;
GstElement *src, *demux, *a_decoder, *v_decoder, *v_filter;
GstElement *audiosink, *videosink;
GstElement *a_queue, *v_queue;
GstPad *seekable;
GstPad *pad;
pipeline = gst_pipeline_new ("app");
src = gst_element_factory_make_or_warn (SOURCE, "src");
g_object_set (G_OBJECT (src), "location", location, NULL);
//demux = gst_element_factory_make_or_warn ("mpegdemux", "demux");
demux = gst_element_factory_make_or_warn ("flupsdemux", "demux");
gst_bin_add (GST_BIN (pipeline), src);
gst_bin_add (GST_BIN (pipeline), demux);