<!entity GstFakeSrc SYSTEM "sgml/gstfakesrc.sgml">
<!entity GstFakeSink SYSTEM "sgml/gstfakesink.sgml">
<!entity GstFileSrc SYSTEM "sgml/gstfilesrc.sgml">
-<!entity GstDiskSrc SYSTEM "sgml/gstdisksrc.sgml">
<!entity GstDiskSink SYSTEM "sgml/gstdisksink.sgml">
<!entity GstHttpSrc SYSTEM "sgml/gsthttpsrc.sgml">
<!entity GstFdSrc SYSTEM "sgml/gstfdsrc.sgml">
&GstFakeSink;
&GstFileSrc;
- &GstDiskSrc;
&GstDiskSink;
&GstHttpSrc;
gst_init(&argc,&argv);
- srcfactory = gst_elementfactory_find("disksrc");
+ srcfactory = gst_elementfactory_find("filesrc");
g_return_if_fail(srcfactory != NULL);
src = gst_elementfactory_create(srcfactory,"src");
pipeline = gst_pipeline_new ("launch");
/* build a pipeline in the pipeline */
- gst_parse_launch ("disksrc location=some.mp3 ! mad ! osssink", GST_BIN (pipeline));
+ gst_parse_launch ("filesrc location=some.mp3 ! mad ! osssink", GST_BIN (pipeline));
/* play the thing */
gst_element_set_state (pipeline, GST_STATE_PLAYING);
int
main (int argc, char *argv[])
{
- GstElement *disksrc, *audiosink;
+ GstElement *filesrc, *audiosink;
GstElement *pipeline;
GstElement *thread;
g_assert (pipeline != NULL);
/* create a disk reader */
- disksrc = gst_elementfactory_make ("disksrc", "disk_source");
- g_assert (disksrc != NULL);
- g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
- g_signal_connect (G_OBJECT (disksrc), "eos",
+ filesrc = gst_elementfactory_make ("filesrc", "disk_source");
+ g_assert (filesrc != NULL);
+ g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
+ g_signal_connect (G_OBJECT (filesrc), "eos",
G_CALLBACK (eos), thread);
/* and an audio sink */
g_assert (audiosink != NULL);
/* add objects to the main pipeline */
- gst_bin_add (GST_BIN (pipeline), disksrc);
+ gst_bin_add (GST_BIN (pipeline), filesrc);
gst_bin_add (GST_BIN (pipeline), audiosink);
/* automatically setup the pipeline */
}
/* remove the source element from the pipeline */
- gst_bin_remove (GST_BIN (pipeline), disksrc);
+ gst_bin_remove (GST_BIN (pipeline), filesrc);
/* insert the source element in the thread, remember a thread needs at
least one source or connection element */
- gst_bin_add (GST_BIN (thread), disksrc);
+ gst_bin_add (GST_BIN (thread), filesrc);
/* add the pipeline to the thread too */
gst_bin_add (GST_BIN (thread), GST_ELEMENT (pipeline));
A simple commandline looks like:
<screen>
-gstreamer-launch disksrc location=hello.mp3 ! mp3parse ! mpg123 ! audiosink
+gstreamer-launch filesrc location=hello.mp3 ! mp3parse ! mpg123 ! audiosink
</screen>
A more complex pipeline looks like:
<screen>
-gstreamer-launch disksrc redpill.vob audio_00! (ac3parse ! ac3dec ! audiosink) \
+gstreamer-launch filesrc redpill.vob audio_00! (ac3parse ! ac3dec ! audiosink) \
video_00! (mpeg2dec ! videosink)
</screen>
main (int argc, char *argv[])
{
GstElement *pipeline;
- GstElement *disksrc;
+ GstElement *filesrc;
gst_init (&argc, &argv);
}
pipeline = gst_pipeline_new ("my_pipeline");
- gst_parse_launch ("disksrc[my_disksrc] ! mp3parse ! mpg123 ! osssink", GST_BIN (pipeline));
+ gst_parse_launch ("filesrc[my_filesrc] ! mp3parse ! mpg123 ! osssink", GST_BIN (pipeline));
- disksrc = gst_bin_get_by_name (GST_BIN (pipeline), "my_disksrc");
- g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
+ filesrc = gst_bin_get_by_name (GST_BIN (pipeline), "my_filesrc");
+ g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
}
</programlisting>
<para>
- Note how we can retrieve the disksrc element from the constructed bin using the
+ Note how we can retrieve the filesrc element from the constructed bin using the
element name.
</para>
</sect1>
</programlisting>
<para>
In the above example, the bin now also has a pad: the pad called 'sink' of the
- given element. We can now, for example, connect the srcpad of a disksrc to the
+ given element. We can now, for example, connect the srcpad of a filesrc to the
bin with:
</para>
<programlisting>
- GstElement *disksrc;
+ GstElement *filesrc;
- disksrc = gst_elementfactory_create ("disksrc", "disk_reader");
+ filesrc = gst_elementfactory_create ("filesrc", "disk_reader");
- gst_element_connect (disksrc, "src", bin, "sink");
+ gst_element_connect (filesrc, "src", bin, "sink");
...
</programlisting>
</sect1>
int
main (int argc, char *argv[])
{
- GstElement *pipeline, *disksrc, *parse, *decoder, *audiosink;
+ GstElement *pipeline, *filesrc, *parse, *decoder, *audiosink;
gst_init(&argc, &argv);
pipeline = gst_pipeline_new ("pipeline");
/* create a disk reader */
- disksrc = gst_elementfactory_make ("disksrc", "disk_source");
- g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
+ filesrc = gst_elementfactory_make ("filesrc", "disk_source");
+ g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
/* now it's time to get the parser */
parse = gst_elementfactory_make ("mp3parse", "parse");
audiosink = gst_elementfactory_make ("osssink", "play_audio");
/* add objects to the main pipeline */
- gst_bin_add (GST_BIN (pipeline), disksrc);
+ gst_bin_add (GST_BIN (pipeline), filesrc);
gst_bin_add (GST_BIN (pipeline), parse);
gst_bin_add (GST_BIN (pipeline), decoder);
gst_bin_add (GST_BIN (pipeline), audiosink);
/* connect src to sink */
- gst_pad_connect (gst_element_get_pad (disksrc, "src"),
+ gst_pad_connect (gst_element_get_pad (filesrc, "src"),
gst_element_get_pad (parse, "sink"));
gst_pad_connect (gst_element_get_pad (parse, "src"),
gst_element_get_pad (decoder, "sink"));
gst_object_unref (GST_OBJECT (audiosink));
gst_object_unref (GST_OBJECT (parse));
gst_object_unref (GST_OBJECT (decoder));
- gst_object_unref (GST_OBJECT (disksrc));
+ gst_object_unref (GST_OBJECT (filesrc));
gst_object_unref (GST_OBJECT (pipeline));
exit (0);
</para>
<programlisting>
...
- GstElement *pipeline, *disksrc, *parse, *decoder, *audiosink;
+ GstElement *pipeline, *filesrc, *parse, *decoder, *audiosink;
...
</programlisting>
</para>
<programlisting>
/* create a disk reader */
- disksrc = gst_elementfactory_make ("disksrc", "disk_source");
- g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
+ filesrc = gst_elementfactory_make ("filesrc", "disk_source");
+ g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
</programlisting>
<note>
<para>
- You can check if the disksrc != NULL to verify the creation of the
+ You can check if the filesrc != NULL to verify the creation of the
disk source element.
</para>
</note>
</para>
<programlisting>
/* add objects to the main pipeline */
- gst_bin_add (GST_BIN (pipeline), disksrc);
+ gst_bin_add (GST_BIN (pipeline), filesrc);
gst_bin_add (GST_BIN (pipeline), parse);
gst_bin_add (GST_BIN (pipeline), decoder);
gst_bin_add (GST_BIN (pipeline), audiosink);
</para>
<programlisting>
/* connect src to sink */
- gst_pad_connect (gst_element_get_pad (disksrc, "src"),
+ gst_pad_connect (gst_element_get_pad (filesrc, "src"),
gst_element_get_pad (parse, "sink"));
gst_pad_connect (gst_element_get_pad (parse, "src"),
gst_element_get_pad (decoder, "sink"));
gst_object_unref (GST_OBJECT (audiosink));
gst_object_unref (GST_OBJECT (decoder));
- gst_object_unref (GST_OBJECT (disksrc));
+ gst_object_unref (GST_OBJECT (filesrc));
gst_object_unref (GST_OBJECT (pipeline));
exit (0);
</para>
<para>
It should be clear from the example that we can very easily replace the
- disksrc element with an httpsrc, giving you instant network streaming.
+ filesrc element with an httpsrc, giving you instant network streaming.
An element could be build to handle icecast connections, for example.
</para>
<para>
</programlisting>
<para>
In the above example, the bin now also has a pad: the pad called 'sink' of the
- given element. We can now, for example, connect the srcpad of a disksrc to the
+ given element. We can now, for example, connect the srcpad of a filesrc to the
bin with:
</para>
<programlisting>
- GstElement *disksrc;
+ GstElement *filesrc;
- disksrc = gst_elementfactory_create ("disksrc", "disk_reader");
+ filesrc = gst_elementfactory_create ("filesrc", "disk_reader");
- gst_element_connect (disksrc, "src", bin, "sink");
+ gst_element_connect (filesrc, "src", bin, "sink");
...
</programlisting>
</sect1>
pipeline = gst_pipeline_new ("pipeline");
g_return_val_if_fail (pipeline != NULL, -1);
- src = gst_elementfactory_make ("disksrc", "src");
+ src = gst_elementfactory_make ("filesrc", "src");
g_return_val_if_fail (src != NULL, -1);
g_object_set (G_OBJECT (src), "location", argv[1], NULL);
</programlisting>
<para>
- We create two elements: a disksrc (the element that will read the
+ We create two elements: a filesrc (the element that will read the
file from disk) and an mpeg1parser. We also add an EOS (End Of Stream)
- signal to the disksrc so that we will be notified when the file has ended.
+ signal to the filesrc so that we will be notified when the file has ended.
There's nothing special about this piece of code except for the signal
'new_pad' that we connected to the mpeg1parser using:
</para>
int
main (int argc, char *argv[])
{
- GstElement *pipeline, *disksrc, *parse, *decoder, *audiosink;
+ GstElement *pipeline, *filesrc, *parse, *decoder, *audiosink;
gst_init(&argc, &argv);
pipeline = gst_pipeline_new ("pipeline");
/* create a disk reader */
- disksrc = gst_elementfactory_make ("disksrc", "disk_source");
- g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
+ filesrc = gst_elementfactory_make ("filesrc", "disk_source");
+ g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
/* now it's time to get the parser */
parse = gst_elementfactory_make ("mp3parse", "parse");
audiosink = gst_elementfactory_make ("osssink", "play_audio");
/* add objects to the main pipeline */
- gst_bin_add (GST_BIN (pipeline), disksrc);
+ gst_bin_add (GST_BIN (pipeline), filesrc);
gst_bin_add (GST_BIN (pipeline), parse);
gst_bin_add (GST_BIN (pipeline), decoder);
gst_bin_add (GST_BIN (pipeline), audiosink);
/* connect src to sink */
- gst_pad_connect (gst_element_get_pad (disksrc, "src"),
+ gst_pad_connect (gst_element_get_pad (filesrc, "src"),
gst_element_get_pad (parse, "sink"));
gst_pad_connect (gst_element_get_pad (parse, "src"),
gst_element_get_pad (decoder, "sink"));
gst_object_unref (GST_OBJECT (audiosink));
gst_object_unref (GST_OBJECT (parse));
gst_object_unref (GST_OBJECT (decoder));
- gst_object_unref (GST_OBJECT (disksrc));
+ gst_object_unref (GST_OBJECT (filesrc));
gst_object_unref (GST_OBJECT (pipeline));
exit (0);
</para>
<programlisting>
...
- GstElement *pipeline, *disksrc, *parse, *decoder, *audiosink;
+ GstElement *pipeline, *filesrc, *parse, *decoder, *audiosink;
...
</programlisting>
</para>
<programlisting>
/* create a disk reader */
- disksrc = gst_elementfactory_make ("disksrc", "disk_source");
- g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
+ filesrc = gst_elementfactory_make ("filesrc", "disk_source");
+ g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
</programlisting>
<note>
<para>
- You can check if the disksrc != NULL to verify the creation of the
+ You can check if the filesrc != NULL to verify the creation of the
disk source element.
</para>
</note>
</para>
<programlisting>
/* add objects to the main pipeline */
- gst_bin_add (GST_BIN (pipeline), disksrc);
+ gst_bin_add (GST_BIN (pipeline), filesrc);
gst_bin_add (GST_BIN (pipeline), parse);
gst_bin_add (GST_BIN (pipeline), decoder);
gst_bin_add (GST_BIN (pipeline), audiosink);
</para>
<programlisting>
/* connect src to sink */
- gst_pad_connect (gst_element_get_pad (disksrc, "src"),
+ gst_pad_connect (gst_element_get_pad (filesrc, "src"),
gst_element_get_pad (parse, "sink"));
gst_pad_connect (gst_element_get_pad (parse, "src"),
gst_element_get_pad (decoder, "sink"));
gst_object_unref (GST_OBJECT (audiosink));
gst_object_unref (GST_OBJECT (decoder));
- gst_object_unref (GST_OBJECT (disksrc));
+ gst_object_unref (GST_OBJECT (filesrc));
gst_object_unref (GST_OBJECT (pipeline));
exit (0);
</para>
<para>
It should be clear from the example that we can very easily replace the
- disksrc element with an httpsrc, giving you instant network streaming.
+ filesrc element with an httpsrc, giving you instant network streaming.
An element could be build to handle icecast connections, for example.
</para>
<para>
int
main (int argc, char *argv[])
{
- GstElement *disksrc;
+ GstElement *filesrc;
GstElement *pipeline;
GstElement *autobin;
GstElement *typefind;
g_assert (pipeline != NULL);
/* create a disk reader */
- disksrc = gst_elementfactory_make ("disksrc", "disk_source");
- g_assert (disksrc != NULL);
- g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
- gst_bin_add (GST_BIN (pipeline), disksrc);
+ filesrc = gst_elementfactory_make ("filesrc", "disk_source");
+ g_assert (filesrc != NULL);
+ g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
+ gst_bin_add (GST_BIN (pipeline), filesrc);
autobin = gst_bin_new ("autobin");
cache = gst_elementfactory_make ("autoplugcache", "cache");
gst_element_add_ghost_pad (autobin, gst_element_get_pad (cache, "sink"), "sink");
gst_bin_add (GST_BIN( pipeline), autobin);
- gst_element_connect (disksrc, "src", autobin, "sink");
+ gst_element_connect (filesrc, "src", autobin, "sink");
/* start playing */
gst_element_set_state( GST_ELEMENT (pipeline), GST_STATE_PLAYING);
}
</programlisting>
<para>
- We start by constructing a 'disksrc' element and an 'autobin' element that
+ We start by constructing a 'filesrc' element and an 'autobin' element that
holds the autoplugcache and the typefind element.
</para>
<para>
GstElement *new_element;
GstAutoplug *autoplug;
GstElement *autobin;
- GstElement *disksrc;
+ GstElement *filesrc;
GstElement *cache;
GST_DEBUG (0,"GstPipeline: play have type\n");
gst_element_set_state (pipeline, GST_STATE_PAUSED);
- disksrc = gst_bin_get_by_name (GST_BIN (pipeline), "disk_source");
+ filesrc = gst_bin_get_by_name (GST_BIN (pipeline), "disk_source");
autobin = gst_bin_get_by_name (GST_BIN (pipeline), "autobin");
cache = gst_bin_get_by_name (GST_BIN (autobin), "cache");
manipulate in the pipeline with:
</para>
<programlisting>
- disksrc = gst_bin_get_by_name (GST_BIN (pipeline), "disk_source");
+ filesrc = gst_bin_get_by_name (GST_BIN (pipeline), "disk_source");
autobin = gst_bin_get_by_name (GST_BIN (pipeline), "autobin");
cache = gst_bin_get_by_name (GST_BIN (autobin), "cache");
</programlisting>
gst_play_cache_empty (GstElement *element, GstElement *pipeline)
{
GstElement *autobin;
- GstElement *disksrc;
+ GstElement *filesrc;
GstElement *cache;
GstElement *new_element;
gst_element_set_state (pipeline, GST_STATE_PAUSED);
- disksrc = gst_bin_get_by_name (GST_BIN (pipeline), "disk_source");
+ filesrc = gst_bin_get_by_name (GST_BIN (pipeline), "disk_source");
autobin = gst_bin_get_by_name (GST_BIN (pipeline), "autobin");
cache = gst_bin_get_by_name (GST_BIN (autobin), "cache");
new_element = gst_bin_get_by_name (GST_BIN (autobin), "new_element");
- gst_element_disconnect (disksrc, "src", cache, "sink");
+ gst_element_disconnect (filesrc, "src", cache, "sink");
gst_element_disconnect (cache, "src", new_element, "sink");
gst_bin_remove (GST_BIN (autobin), cache);
- gst_element_connect (disksrc, "src", new_element, "sink");
+ gst_element_connect (filesrc, "src", new_element, "sink");
gst_element_set_state (pipeline, GST_STATE_PLAYING);
<para>
The cache empty function simply removes the autoplugcache element from
- the pipeline and reconnects the disksrc to the autoplugged element.
+ the pipeline and reconnects the filesrc to the autoplugged element.
</para>
<para>
int
main (int argc, char *argv[])
{
- GstElement *disksrc, *audiosink, *queue, *queue2, *parse, *decode;
+ GstElement *filesrc, *audiosink, *queue, *queue2, *parse, *decode;
GstElement *bin;
GstElement *thread, *thread2;
g_assert (bin != NULL);
/* create a disk reader */
- disksrc = gst_elementfactory_make ("disksrc", "disk_source");
- g_assert (disksrc != NULL);
- g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
+ filesrc = gst_elementfactory_make ("filesrc", "disk_source");
+ g_assert (filesrc != NULL);
+ g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
queue = gst_elementfactory_make ("queue", "queue");
queue2 = gst_elementfactory_make ("queue", "queue2");
decode = gst_elementfactory_make ("mpg123", "decode");
/* add objects to the main bin */
- gst_bin_add (GST_BIN (bin), disksrc);
+ gst_bin_add (GST_BIN (bin), filesrc);
gst_bin_add (GST_BIN (bin), queue);
gst_bin_add (GST_BIN (thread), parse);
gst_bin_add (GST_BIN (thread2), audiosink);
- gst_pad_connect (gst_element_get_pad (disksrc,"src"),
+ gst_pad_connect (gst_element_get_pad (filesrc,"src"),
gst_element_get_pad (queue,"sink"));
gst_pad_connect (gst_element_get_pad (queue,"src"),
A simple commandline looks like:
<screen>
-gstreamer-launch disksrc location=hello.mp3 ! mp3parse ! mpg123 ! audiosink
+gstreamer-launch filesrc location=hello.mp3 ! mp3parse ! mpg123 ! audiosink
</screen>
A more complex pipeline looks like:
<screen>
-gstreamer-launch disksrc redpill.vob audio_00! (ac3parse ! ac3dec ! audiosink) \
+gstreamer-launch filesrc redpill.vob audio_00! (ac3parse ! ac3dec ! audiosink) \
video_00! (mpeg2dec ! videosink)
</screen>
main (int argc, char *argv[])
{
GstElement *pipeline;
- GstElement *disksrc;
+ GstElement *filesrc;
gst_init (&argc, &argv);
}
pipeline = gst_pipeline_new ("my_pipeline");
- gst_parse_launch ("disksrc[my_disksrc] ! mp3parse ! mpg123 ! osssink", GST_BIN (pipeline));
+ gst_parse_launch ("filesrc[my_filesrc] ! mp3parse ! mpg123 ! osssink", GST_BIN (pipeline));
- disksrc = gst_bin_get_by_name (GST_BIN (pipeline), "my_disksrc");
- g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
+ filesrc = gst_bin_get_by_name (GST_BIN (pipeline), "my_filesrc");
+ g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
}
</programlisting>
<para>
- Note how we can retrieve the disksrc element from the constructed bin using the
+ Note how we can retrieve the filesrc element from the constructed bin using the
element name.
</para>
</sect1>
int
main (int argc, char *argv[])
{
- GstElement *disksrc, *audiosink, *queue, *parse, *decode;
+ GstElement *filesrc, *audiosink, *queue, *parse, *decode;
GstElement *bin;
GstElement *thread;
g_assert (bin != NULL);
/* create a disk reader */
- disksrc = gst_elementfactory_make ("disksrc", "disk_source");
- g_assert (disksrc != NULL);
- g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
- g_signal_connect (G_OBJECT (disksrc), "eos",
+ filesrc = gst_elementfactory_make ("filesrc", "disk_source");
+ g_assert (filesrc != NULL);
+ g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
+ g_signal_connect (G_OBJECT (filesrc), "eos",
G_CALLBACK (eos), thread);
queue = gst_elementfactory_make ("queue", "queue");
decode = gst_elementfactory_make ("mpg123", "decode");
/* add objects to the main bin */
- gst_bin_add (GST_BIN (bin), disksrc);
+ gst_bin_add (GST_BIN (bin), filesrc);
gst_bin_add (GST_BIN (bin), queue);
gst_bin_add (GST_BIN (thread), parse);
gst_bin_add (GST_BIN (thread), decode);
gst_bin_add (GST_BIN (thread), audiosink);
- gst_pad_connect (gst_element_get_pad (disksrc,"src"),
+ gst_pad_connect (gst_element_get_pad (filesrc,"src"),
gst_element_get_pad (queue,"sink"));
gst_pad_connect (gst_element_get_pad (queue, "src"),
int
main (int argc, char *argv[])
{
- GstElement *disksrc, *audiosink;
+ GstElement *filesrc, *audiosink;
GstElement *pipeline;
GstElement *thread;
g_assert (pipeline != NULL);
/* create a disk reader */
- disksrc = gst_elementfactory_make ("disksrc", "disk_source");
- g_assert (disksrc != NULL);
- g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
- g_signal_connect (G_OBJECT (disksrc), "eos",
+ filesrc = gst_elementfactory_make ("filesrc", "disk_source");
+ g_assert (filesrc != NULL);
+ g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
+ g_signal_connect (G_OBJECT (filesrc), "eos",
G_CALLBACK (eos), thread);
/* and an audio sink */
g_assert (audiosink != NULL);
/* add objects to the main pipeline */
- gst_bin_add (GST_BIN (pipeline), disksrc);
+ gst_bin_add (GST_BIN (pipeline), filesrc);
gst_bin_add (GST_BIN (pipeline), audiosink);
/* automatically setup the pipeline */
}
/* remove the source element from the pipeline */
- gst_bin_remove (GST_BIN (pipeline), disksrc);
+ gst_bin_remove (GST_BIN (pipeline), filesrc);
/* insert the source element in the thread, remember a thread needs at
least one source or connection element */
- gst_bin_add (GST_BIN (thread), disksrc);
+ gst_bin_add (GST_BIN (thread), filesrc);
/* add the pipeline to the thread too */
gst_bin_add (GST_BIN (thread), GST_ELEMENT (pipeline));
<chapter id="cha-typedetection">
<title>Typedetection</title>
<para>
- Sometimes the capabilities of a pad are not specificied. The disksrc, for
+ Sometimes the capabilities of a pad are not specificied. The filesrc, for
example, does not know what type of file it is reading. Before you can attach
- an element to the pad of the disksrc, you need to determine the media type in
+ an element to the pad of the filesrc, you need to determine the media type in
order to be able to choose a compatible element.
</para>
<para>
int
main(int argc, char *argv[])
{
- GstElement *bin, *disksrc, *typefind;
+ GstElement *bin, *filesrc, *typefind;
gst_init (&argc, &argv);
g_assert (bin != NULL);
/* create a disk reader */
- disksrc = gst_elementfactory_make ("disksrc", "disk_source");
- g_assert (disksrc != NULL);
- g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
+ filesrc = gst_elementfactory_make ("filesrc", "disk_source");
+ g_assert (filesrc != NULL);
+ g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
/* create the typefind element */
typefind = gst_elementfactory_make ("typefind", "typefind");
g_assert (typefind != NULL);
/* add objects to the main pipeline */
- gst_bin_add (GST_BIN (bin), disksrc);
+ gst_bin_add (GST_BIN (bin), filesrc);
gst_bin_add (GST_BIN (bin), typefind);
g_signal_connect (G_OBJECT (typefind), "have_type",
G_CALLBACK (type_found), NULL);
- gst_pad_connect (gst_element_get_pad (disksrc, "src"),
+ gst_pad_connect (gst_element_get_pad (filesrc, "src"),
gst_element_get_pad (typefind, "sink"));
/* start playing */
}
</programlisting>
<para>
- We create a very simple pipeline with only a disksrc and the typefind element
+ We create a very simple pipeline with only a filesrc and the typefind element
in it. The sinkpad of the typefind element has been connected to the src pad
- of the disksrc.
+ of the filesrc.
</para>
<para>
We attached a signal 'have_type' to the typefind element which will be called
int
main (int argc, char *argv[])
{
- GstElement *disksrc, *audiosink, *queue, *queue2, *parse, *decode;
+ GstElement *filesrc, *audiosink, *queue, *queue2, *parse, *decode;
GstElement *bin;
GstElement *thread, *thread2;
g_assert (bin != NULL);
/* create a disk reader */
- disksrc = gst_elementfactory_make ("disksrc", "disk_source");
- g_assert (disksrc != NULL);
- g_object_set (G_OBJECT (disksrc), "location", argv[1], NULL);
+ filesrc = gst_elementfactory_make ("filesrc", "disk_source");
+ g_assert (filesrc != NULL);
+ g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
queue = gst_elementfactory_make ("queue", "queue");
queue2 = gst_elementfactory_make ("queue", "queue2");
decode = gst_elementfactory_make ("mpg123", "decode");
/* add objects to the main bin */
- gst_bin_add (GST_BIN (bin), disksrc);
+ gst_bin_add (GST_BIN (bin), filesrc);
gst_bin_add (GST_BIN (bin), queue);
gst_bin_add (GST_BIN (thread), parse);
gst_bin_add (GST_BIN (thread2), audiosink);
- gst_pad_connect (gst_element_get_pad (disksrc,"src"),
+ gst_pad_connect (gst_element_get_pad (filesrc,"src"),
gst_element_get_pad (queue,"sink"));
gst_pad_connect (gst_element_get_pad (queue,"src"),
#! /bin/sh
for loc in "$@"; do
-../../tools/gstreamer-launch disksrc \""location=$loc"\" ! mp3parse ! mpg123 ! osssink
+../../tools/gstreamer-launch filesrc \""location=$loc"\" ! mp3parse ! mpg123 ! osssink
done
gst_init(&argc,&argv);
pipeline = gst_pipeline_new("pipeline");
- src = gst_elementfactory_make ("disksrc","src");
+ src = gst_elementfactory_make ("filesrc","src");
g_object_set(G_OBJECT(src),"location",argv[1],NULL);
gst_bin_add (GST_BIN(pipeline),src);
#! /bin/sh
for loc in "$@"; do
-../../tools/gstreamer-launch disksrc \""location=$loc"\" ! mp3parse ! mpg123 ! osssink
+../../tools/gstreamer-launch filesrc \""location=$loc"\" ! mp3parse ! mpg123 ! osssink
done