disksink -> filesink

Original commit message from CVS:
disksink -> filesink
This commit is contained in:
Stéphane Loeuillet 2004-05-03 01:06:56 +00:00
parent ac27b7cdba
commit d2c0d11ea9
6 changed files with 40 additions and 40 deletions

View file

@ -137,7 +137,7 @@ case 4)
case 5)
(--------) (--------) (--------)
! disksrc! ! mad ! !disksink!
! disksrc! ! mad ! !filesink!
! src ----- sink src ---- sink !
(--------) (--------) (--------)
@ -155,14 +155,14 @@ case 5)
src pad.
the parent already has mad in the list of EOS providers so it does not
get added twice.
mad finally fires the EOS signal. This time, disksink returns false on
mad finally fires the EOS signal. This time, filesink returns false on
the eos request. the parent removes mad as an EOS provider.
disksink was responsible for the EOS delay and gets added to the bin
filesink was responsible for the EOS delay and gets added to the bin
as a possible EOS provider.
When disksink has written all of it's data and closed the output file,
When filesink has written all of it's data and closed the output file,
it fires EOS.
The parent already has disksink in the list of EOS providers so it does
The parent already has filesink in the list of EOS providers so it does
not get added twice.
The parent removes the EOS provider
from its list, and since the list is empty, the parent fires EOS.
@ -172,7 +172,7 @@ case 6)
(--------) (--------) (--------)
!disksrc1! ! mad1 ! ! mixer !
! src ----- sink src ---- sink1 ! (--------)
(--------) (--------) ! ! !disksink!
(--------) (--------) ! ! !filesink!
! src ---- sink !
(--------) (--------) ! ! (--------)
!disksrc2! ! mad2 ! ! !
@ -201,8 +201,8 @@ case 6)
realizing all of it's sources have reached eos, it sends out the final
buffer and fires EOS.
At this point, disksink will return false, mixer will be removed as an
eos provider, and disksink will write out it's final buffer and close
At this point, filesink will return false, mixer will be removed as an
eos provider, and filesink will write out it's final buffer and close
the file on disk. At this point, it fires eos, and since it's the last
eos provider, the parent can fire eos.

View file

@ -247,15 +247,15 @@ not important for the example.
time with the help of the previous length information supplied by the filesrc. It will then
issue another INFO event with that informations. This one will be send downstream and vertical.
* ... ! avimux ! disksink
* ... ! avimux ! filesink
This example is showing a more exotic way of using events. The reader should be aware that AVI
files have a limited filesize. Only 4 GB are allowed. We now show what happens when the avimux
encoder hits that limit.
- When the internal counter of avimux shows that it is approaching the filesize limit, the
avimux element pushes a buffer containig the footer to the disksink.
avimux element pushes a buffer containig the footer to the filesink.
- After that it issues a DISCONTINUOUS event of the type DISCONT_NEW indicating a new stream.
The disksink will close the file and reopen a new one.
The filesink will close the file and reopen a new one.
- The avimux plugin resets its internal size counter and restarts sending data to the new file.
* filesrc ! gunzip ! mikmod ! osssink
@ -283,7 +283,7 @@ Open Questions
Open questions are issues that should probably be solved by events but can not be solved
currently.
* A disksink needs to be able to inform elements of a restricted file size. Simply closing
* A filesink needs to be able to inform elements of a restricted file size. Simply closing
the file and opening a new one might not work because elements might need to supply a
footer. (eg avimux)

View file

@ -1,7 +1,7 @@
/*
* cutter.c - cut audio into pieces based on silence - thomas@apestaart.org
*
* construct a simple pipeline osssrc ! cutter ! disksink
* construct a simple pipeline osssrc ! cutter ! filesink
* pause when necessary, change output
*
* Latest change : 03/06/2001
@ -26,7 +26,7 @@ GstElement *audiosrc;
GstElement *queue;
GstElement *thread;
GstElement *cutter;
GstElement *disksink;
GstElement *filesink;
GstElement *encoder;
char buffer[255];
@ -36,8 +36,8 @@ void
cut_start (GstElement * element)
{
g_print ("\nDEBUG: main: cut start\n");
/* we should pause the pipeline, unlink cutter and disksink
* create a new disksink to a real file, relink, and set to play
/* we should pause the pipeline, unlink cutter and filesink
* create a new filesink to a real file, relink, and set to play
*/
g_print ("DEBUG: cut_start: main_bin pausing\n");
gst_element_set_state (main_bin, GST_STATE_PAUSED);
@ -56,8 +56,8 @@ cut_start (GstElement * element)
ct->tm_sec);
}
g_print ("DEBUG: cut_start: setting new location to %s\n", buffer);
g_object_set (G_OBJECT (disksink), "location", buffer, NULL);
g_object_set (G_OBJECT (disksink), "type", 4, NULL);
g_object_set (G_OBJECT (filesink), "location", buffer, NULL);
g_object_set (G_OBJECT (filesink), "type", 4, NULL);
gst_element_set_state (main_bin, GST_STATE_PLAYING);
++id;
@ -76,14 +76,14 @@ void
cut_stop (GstElement * element)
{
g_print ("\nDEBUG: main: cut stop\n");
/* we should pause the pipeline, unlink disksink, create a fake disksink,
/* we should pause the pipeline, unlink filesink, create a fake filesink,
* link to pipeline, and set to play
*/
g_print ("DEBUG: cut_stop: main_bin paused\n");
gst_element_set_state (main_bin, GST_STATE_PAUSED);
g_print ("DEBUG: cut_stop: setting new location\n");
g_object_set (G_OBJECT (disksink), "location", "/dev/null", NULL);
g_object_set (G_OBJECT (filesink), "location", "/dev/null", NULL);
gst_element_set_state (main_bin, GST_STATE_PLAYING);
g_print ("stop_cut_signal done\n");
@ -138,10 +138,10 @@ main (int argc, char *argv[])
if (!(encoder = gst_element_factory_make ("passthrough", "encoder")))
g_error ("Could not create 'passthrough' element !\n");
if (!(disksink = gst_element_factory_make ("afsink", "disk_sink")))
if (!(filesink = gst_element_factory_make ("afsink", "disk_sink")))
g_error ("Could not create 'afsink' element !\n");
g_object_set (G_OBJECT (disksink), "location", "/dev/null", NULL);
g_object_set (G_OBJECT (filesink), "location", "/dev/null", NULL);
thread = gst_thread_new ("thread");
g_assert (thread != NULL);
@ -157,9 +157,9 @@ main (int argc, char *argv[])
gst_bin_add (GST_BIN (main_bin), audiosrc);
gst_bin_add (GST_BIN (thread), queue);
gst_bin_add_many (GST_BIN (thread), cutter, encoder, disksink, NULL);
gst_bin_add_many (GST_BIN (thread), cutter, encoder, filesink, NULL);
gst_element_link_many (audiosrc, queue, cutter, encoder, disksink, NULL);
gst_element_link_many (audiosrc, queue, cutter, encoder, filesink, NULL);
gst_bin_add (GST_BIN (main_bin), thread);
/* set signal handlers */
@ -196,7 +196,7 @@ main (int argc, char *argv[])
gst_element_set_state (main_bin, GST_STATE_NULL);
gst_object_unref (GST_OBJECT (disksink));
gst_object_unref (GST_OBJECT (filesink));
gst_object_unref (GST_OBJECT (main_bin));
exit (0);

View file

@ -6,7 +6,7 @@
typedef struct
{
GstElement *pipe;
GstElement *disksink;
GstElement *filesink;
GstElement *audiosink;
char *location;

View file

@ -1,7 +1,7 @@
/*
* cutter.c - cut audio into pieces based on silence - thomas@apestaart.org
*
* construct a simple pipeline osssrc ! cutter ! disksink
* construct a simple pipeline osssrc ! cutter ! filesink
* pause when necessary, change output
*
* Latest change : 03/06/2001
@ -26,7 +26,7 @@ GstElement *audiosrc;
GstElement *queue;
GstElement *thread;
GstElement *cutter;
GstElement *disksink;
GstElement *filesink;
GstElement *encoder;
char buffer[255];
@ -36,8 +36,8 @@ void
cut_start (GstElement * element)
{
g_print ("\nDEBUG: main: cut start\n");
/* we should pause the pipeline, unlink cutter and disksink
* create a new disksink to a real file, relink, and set to play
/* we should pause the pipeline, unlink cutter and filesink
* create a new filesink to a real file, relink, and set to play
*/
g_print ("DEBUG: cut_start: main_bin pausing\n");
gst_element_set_state (main_bin, GST_STATE_PAUSED);
@ -56,8 +56,8 @@ cut_start (GstElement * element)
ct->tm_sec);
}
g_print ("DEBUG: cut_start: setting new location to %s\n", buffer);
g_object_set (G_OBJECT (disksink), "location", buffer, NULL);
g_object_set (G_OBJECT (disksink), "type", 4, NULL);
g_object_set (G_OBJECT (filesink), "location", buffer, NULL);
g_object_set (G_OBJECT (filesink), "type", 4, NULL);
gst_element_set_state (main_bin, GST_STATE_PLAYING);
++id;
@ -76,14 +76,14 @@ void
cut_stop (GstElement * element)
{
g_print ("\nDEBUG: main: cut stop\n");
/* we should pause the pipeline, unlink disksink, create a fake disksink,
/* we should pause the pipeline, unlink filesink, create a fake filesink,
* link to pipeline, and set to play
*/
g_print ("DEBUG: cut_stop: main_bin paused\n");
gst_element_set_state (main_bin, GST_STATE_PAUSED);
g_print ("DEBUG: cut_stop: setting new location\n");
g_object_set (G_OBJECT (disksink), "location", "/dev/null", NULL);
g_object_set (G_OBJECT (filesink), "location", "/dev/null", NULL);
gst_element_set_state (main_bin, GST_STATE_PLAYING);
g_print ("stop_cut_signal done\n");
@ -138,10 +138,10 @@ main (int argc, char *argv[])
if (!(encoder = gst_element_factory_make ("passthrough", "encoder")))
g_error ("Could not create 'passthrough' element !\n");
if (!(disksink = gst_element_factory_make ("afsink", "disk_sink")))
if (!(filesink = gst_element_factory_make ("afsink", "disk_sink")))
g_error ("Could not create 'afsink' element !\n");
g_object_set (G_OBJECT (disksink), "location", "/dev/null", NULL);
g_object_set (G_OBJECT (filesink), "location", "/dev/null", NULL);
thread = gst_thread_new ("thread");
g_assert (thread != NULL);
@ -157,9 +157,9 @@ main (int argc, char *argv[])
gst_bin_add (GST_BIN (main_bin), audiosrc);
gst_bin_add (GST_BIN (thread), queue);
gst_bin_add_many (GST_BIN (thread), cutter, encoder, disksink, NULL);
gst_bin_add_many (GST_BIN (thread), cutter, encoder, filesink, NULL);
gst_element_link_many (audiosrc, queue, cutter, encoder, disksink, NULL);
gst_element_link_many (audiosrc, queue, cutter, encoder, filesink, NULL);
gst_bin_add (GST_BIN (main_bin), thread);
/* set signal handlers */
@ -196,7 +196,7 @@ main (int argc, char *argv[])
gst_element_set_state (main_bin, GST_STATE_NULL);
gst_object_unref (GST_OBJECT (disksink));
gst_object_unref (GST_OBJECT (filesink));
gst_object_unref (GST_OBJECT (main_bin));
exit (0);

View file

@ -6,7 +6,7 @@
typedef struct
{
GstElement *pipe;
GstElement *disksink;
GstElement *filesink;
GstElement *audiosink;
char *location;