- Removed deprecated buffer flags.

Original commit message from CVS:
- Removed deprecated buffer flags.
- removed gst_element_signal_eos, replaced with gst_element_set_eos
to set the object to PAUSED, signal an eos event etc..
- small updates to documentation
- repair some plugins
This commit is contained in:
Wim Taymans 2001-12-28 20:20:26 +00:00
parent 01d2b54b37
commit 90355128b5
22 changed files with 56 additions and 50 deletions

View file

@ -110,6 +110,7 @@ cothread_context_init (void)
/**
* cothread_context_free:
* @ctx: the cothread context to free
*
* Free the cothread context.
*/
@ -270,6 +271,12 @@ cothread_setfunc (cothread_state * thread, cothread_func func, int argc, char **
thread->pc = (void *) func;
}
/**
* cothread_stop:
* @thread: the cothread to stop
*
* Stop the cothread and reset the stack and program counter.
*/
void
cothread_stop (cothread_state * thread)
{

View file

@ -649,7 +649,7 @@ gst_fakesrc_get(GstPad *pad)
}
if (src->rt_num_buffers == 0) {
gst_element_set_state (GST_ELEMENT (src), GST_STATE_PAUSED);
gst_element_set_eos (GST_ELEMENT (src));
return GST_BUFFER(gst_event_new (GST_EVENT_EOS));
}
else {

View file

@ -199,15 +199,12 @@ gst_fdsrc_get(GstPad *pad)
/* read it in from the file */
readbytes = read(src->fd,GST_BUFFER_DATA(buf),src->bytes_per_read);
/* if nothing was read, we're in eos */
if (readbytes == 0) {
return NULL;
gst_element_set_eos (GST_ELEMENT (src));
return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
}
/* if we didn't get as many bytes as we asked for, we're at EOF */
if (readbytes < src->bytes_per_read) {
/* set the buffer's EOF bit here */
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_EOS);
}
GST_BUFFER_OFFSET(buf) = src->curoffset;
GST_BUFFER_SIZE(buf) = readbytes;
src->curoffset += readbytes;

View file

@ -444,7 +444,7 @@ gst_filesrc_get (GstPad *pad)
/* check for EOF */
if (src->curoffset == src->filelen) {
gst_element_set_state (GST_ELEMENT (src), GST_STATE_PAUSED);
gst_element_set_eos (GST_ELEMENT (src));
return GST_BUFFER (gst_event_new(GST_EVENT_EOS));
}
@ -498,7 +498,7 @@ gst_filesrc_get (GstPad *pad)
region.size = readsize;
map = g_tree_search (src->map_regions,
(GCompareFunc) gst_filesrc_search_region_match,
&region);
(gpointer)&region);
/* if we found an exact match, subbuffer it */
if (map != NULL) {

View file

@ -228,7 +228,7 @@ gst_multidisksrc_get (GstPad *pad)
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_DONTFREE);
if (src->new_seek) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLUSH);
/* fixme, do something here */
src->new_seek = FALSE;
}

View file

@ -228,7 +228,7 @@ gst_multidisksrc_get (GstPad *pad)
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_DONTFREE);
if (src->new_seek) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLUSH);
/* fixme, do something here */
src->new_seek = FALSE;
}

View file

@ -284,7 +284,7 @@ gst_statistics_chain (GstPad *pad, GstBuffer *buf)
GstEvent *event = GST_EVENT (buf);
statistics->stats.events += 1;
if (GST_EVENT_TYPE(event) == GST_EVENT_EOS) {
gst_element_set_state (GST_ELEMENT (statistics), GST_STATE_PAUSED);
gst_element_set_eos (GST_ELEMENT (statistics));
if (statistics->update_on_eos) {
update = TRUE;
}

View file

@ -85,9 +85,6 @@ typedef enum {
GST_BUFFER_ORIGINAL,
GST_BUFFER_DONTFREE,
GST_BUFFER_FLUSH,
GST_BUFFER_EOS,
GST_BUFFER_DISCONTINUOUS,
} GstBufferFlags;

View file

@ -790,7 +790,8 @@ gst_element_message (GstElement *element, const gchar *type, const gchar *info,
/**
* gst_element_error:
* @element: Element with the error
* @error: String describing the error
* @error: A printf-like string describing the error
* @...: optional arguments for the string
*
* This function is used internally by elements to signal an error
* condition. It results in the "error" signal.
@ -930,7 +931,6 @@ gst_element_set_state (GstElement *element, GstElementState state)
/* g_print("gst_element_set_state(\"%s\",%08lx)\n", */
/* element->name,state); */
g_return_val_if_fail (element != NULL, GST_STATE_FAILURE);
g_return_val_if_fail (GST_IS_ELEMENT (element), GST_STATE_FAILURE);
GST_DEBUG_ELEMENT (GST_CAT_STATES,element, "setting state from %s to %s\n",
@ -985,7 +985,6 @@ gst_element_change_state (GstElement *element)
GstElementState old_state;
GstObject *parent;
g_return_val_if_fail (element != NULL, GST_STATE_FAILURE);
g_return_val_if_fail (GST_IS_ELEMENT (element), GST_STATE_FAILURE);
old_state = GST_STATE (element);
@ -1038,7 +1037,6 @@ gst_element_get_factory (GstElement *element)
{
GstElementClass *oclass;
g_return_val_if_fail (element != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
oclass = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS(element));
@ -1313,7 +1311,10 @@ void
gst_element_set_sched (GstElement *element,
GstScheduler *sched)
{
GST_INFO_ELEMENT (GST_CAT_PARENTAGE, element, "setting scheduler to %p",sched);
g_return_if_fail (GST_IS_ELEMENT (element));
GST_INFO_ELEMENT (GST_CAT_PARENTAGE, element, "setting scheduler to %p", sched);
element->sched = sched;
}
@ -1328,6 +1329,8 @@ gst_element_set_sched (GstElement *element,
GstScheduler*
gst_element_get_sched (GstElement *element)
{
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
return element->sched;
}
@ -1348,26 +1351,30 @@ void
gst_element_set_loop_function(GstElement *element,
GstElementLoopFunction loop)
{
g_return_if_fail (GST_IS_ELEMENT (element));
/* set the loop function */
element->loopfunc = loop;
/* set the NEW_LOOPFUNC flag so everyone knows to go try again */
GST_FLAG_SET(element,GST_ELEMENT_NEW_LOOPFUNC);
GST_FLAG_SET (element, GST_ELEMENT_NEW_LOOPFUNC);
}
/**
* gst_element_signal_eos:
* @element: element to trigger the eos signal of
* gst_element_set_eos:
* @element: element to set to the EOS state
*
* Throws the eos signal to indicate that the end of the stream is reached.
* Perform the actions needed to bring the element in the EOS state.
*/
void
gst_element_signal_eos (GstElement *element)
gst_element_set_eos (GstElement *element)
{
g_return_if_fail (element != NULL);
g_return_if_fail (GST_IS_ELEMENT (element));
GST_DEBUG(GST_CAT_EVENT, "signaling EOS on element %s\n",GST_OBJECT_NAME(element));
GST_DEBUG (GST_CAT_EVENT, "setting EOS on element %s\n", GST_OBJECT_NAME (element));
gst_element_set_state (element, GST_STATE_PAUSED);
g_signal_emit (G_OBJECT (element), gst_element_signals[EOS], 0);
}

View file

@ -205,7 +205,7 @@ void gst_element_connect (GstElement *src, const gchar *srcpadname,
void gst_element_disconnect (GstElement *src, const gchar *srcpadname,
GstElement *dest, const gchar *destpadname);
void gst_element_signal_eos (GstElement *element);
void gst_element_set_eos (GstElement *element);
void gst_element_send_event (GstElement *element, GstEvent *event);

View file

@ -251,7 +251,7 @@ gst_elementfactory_create (GstElementFactory *factory,
GST_DEBUG (GST_CAT_ELEMENTFACTORY,"class %s\n", GST_OBJECT_NAME (factory));
oclass->elementfactory = factory;
// copy pad template pointers to the element class
/* copy pad template pointers to the element class */
oclass->padtemplates = g_list_copy(factory->padtemplates);
oclass->numpadtemplates = factory->numpadtemplates;
}

View file

@ -726,7 +726,7 @@ gst_pad_get_padtemplate (GstPad *pad)
}
/*
/**
* gst_pad_set_sched:
* @pad: the pad to set the scheduler for
* @sched: The scheduler to set
@ -1583,8 +1583,7 @@ gst_pad_pullregion (GstPad *pad, GstRegionType type, guint64 offset, guint64 len
}
}
/* FIXME */
while (result && ! GST_BUFFER_FLAG_IS_SET (result, GST_BUFFER_EOS)
&& !(GST_BUFFER_OFFSET (result) == offset &&
while (result && !(GST_BUFFER_OFFSET (result) == offset &&
GST_BUFFER_SIZE (result) == len));
return result;
@ -2038,7 +2037,7 @@ gst_pad_event_default (GstPad *pad, GstEvent *event)
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
gst_element_set_state (element, GST_STATE_PAUSED);
gst_element_set_eos (element);
gst_pad_event_default_dispatch (pad, element, event);
gst_event_free (event);
/* we have to try to schedule another element because this one is disabled */

View file

@ -488,7 +488,7 @@ restart:
switch (GST_EVENT_TYPE(event)) {
case GST_EVENT_EOS:
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue \"%s\" eos\n", GST_ELEMENT_NAME (queue));
gst_element_set_state (GST_ELEMENT (queue), GST_STATE_PAUSED);
gst_element_set_eos (GST_ELEMENT (queue));
break;
default:
break;

View file

@ -180,6 +180,9 @@ gst_scheduler_add_element (GstScheduler *sched, GstElement *element)
* @transition: the state transition
*
* Tell the scheduler that an element changed its state.
*
* Returns: a GstElementStateReturn indicating success or failure
* of the state transition.
*/
GstElementStateReturn
gst_scheduler_state_transition (GstScheduler *sched, GstElement *element, gint transition)
@ -285,7 +288,7 @@ gst_scheduler_yield (GstScheduler *sched, GstElement *element)
*
* Tell the scheduler to interrupt execution of this element.
*
* Retruns: TRUE if the element should return NULL from the chain/get
* Returns: TRUE if the element should return NULL from the chain/get
* function.
*/
gboolean

View file

@ -310,8 +310,7 @@ gst_thread_change_state (GstElement * element)
break;
case GST_STATE_PLAYING_TO_PAUSED:
{
//GList *elements = (element->sched)->elements;
GList *elements = gst_bin_get_list(GST_BIN (thread));
GList *elements = gst_bin_get_list (GST_BIN (thread));
THR_INFO ("pausing thread");

View file

@ -649,7 +649,7 @@ gst_fakesrc_get(GstPad *pad)
}
if (src->rt_num_buffers == 0) {
gst_element_set_state (GST_ELEMENT (src), GST_STATE_PAUSED);
gst_element_set_eos (GST_ELEMENT (src));
return GST_BUFFER(gst_event_new (GST_EVENT_EOS));
}
else {

View file

@ -199,15 +199,12 @@ gst_fdsrc_get(GstPad *pad)
/* read it in from the file */
readbytes = read(src->fd,GST_BUFFER_DATA(buf),src->bytes_per_read);
/* if nothing was read, we're in eos */
if (readbytes == 0) {
return NULL;
gst_element_set_eos (GST_ELEMENT (src));
return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
}
/* if we didn't get as many bytes as we asked for, we're at EOF */
if (readbytes < src->bytes_per_read) {
/* set the buffer's EOF bit here */
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_EOS);
}
GST_BUFFER_OFFSET(buf) = src->curoffset;
GST_BUFFER_SIZE(buf) = readbytes;
src->curoffset += readbytes;

View file

@ -444,7 +444,7 @@ gst_filesrc_get (GstPad *pad)
/* check for EOF */
if (src->curoffset == src->filelen) {
gst_element_set_state (GST_ELEMENT (src), GST_STATE_PAUSED);
gst_element_set_eos (GST_ELEMENT (src));
return GST_BUFFER (gst_event_new(GST_EVENT_EOS));
}
@ -498,7 +498,7 @@ gst_filesrc_get (GstPad *pad)
region.size = readsize;
map = g_tree_search (src->map_regions,
(GCompareFunc) gst_filesrc_search_region_match,
&region);
(gpointer)&region);
/* if we found an exact match, subbuffer it */
if (map != NULL) {

View file

@ -228,7 +228,7 @@ gst_multidisksrc_get (GstPad *pad)
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_DONTFREE);
if (src->new_seek) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLUSH);
/* fixme, do something here */
src->new_seek = FALSE;
}

View file

@ -228,7 +228,7 @@ gst_multidisksrc_get (GstPad *pad)
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_DONTFREE);
if (src->new_seek) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLUSH);
/* fixme, do something here */
src->new_seek = FALSE;
}

View file

@ -488,7 +488,7 @@ restart:
switch (GST_EVENT_TYPE(event)) {
case GST_EVENT_EOS:
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue \"%s\" eos\n", GST_ELEMENT_NAME (queue));
gst_element_set_state (GST_ELEMENT (queue), GST_STATE_PAUSED);
gst_element_set_eos (GST_ELEMENT (queue));
break;
default:
break;

View file

@ -284,7 +284,7 @@ gst_statistics_chain (GstPad *pad, GstBuffer *buf)
GstEvent *event = GST_EVENT (buf);
statistics->stats.events += 1;
if (GST_EVENT_TYPE(event) == GST_EVENT_EOS) {
gst_element_set_state (GST_ELEMENT (statistics), GST_STATE_PAUSED);
gst_element_set_eos (GST_ELEMENT (statistics));
if (statistics->update_on_eos) {
update = TRUE;
}