Removed the old eos and qos functions.

Original commit message from CVS:
Removed the old eos and qos functions.
Removed the functions from the elements.
This commit is contained in:
Wim Taymans 2001-08-10 17:34:59 +00:00
parent 889082ecf1
commit 453f2fee05
18 changed files with 69 additions and 216 deletions

View file

@ -240,7 +240,6 @@ gst_disksrc_get (GstPad *pad)
if (src->curoffset >= src->size) {
GST_DEBUG (0,"map offset %ld >= size %ld --> eos\n", src->curoffset, src->size);
gst_pad_event(pad,(void *)GST_EVENT_EOS);
gst_pad_set_eos (pad);
buf = gst_buffer_new();
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_EOS);
return buf;
@ -303,7 +302,7 @@ gst_disksrc_get_region (GstPad *pad, GstRegionType type,guint64 offset,guint64 l
/* deal with EOF state */
if (offset >= src->size) {
//gst_pad_set_eos (pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
GST_DEBUG (0,"map offset %lld >= size %ld --> eos\n", offset, src->size);
//FIXME
buf = gst_buffer_new();

View file

@ -334,7 +334,7 @@ gst_fakesrc_get(GstPad *pad)
g_return_val_if_fail (GST_IS_FAKESRC (src), NULL);
if (src->num_buffers == 0) {
gst_pad_set_eos (pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
return NULL;
}
else {
@ -344,7 +344,7 @@ gst_fakesrc_get(GstPad *pad)
if (src->eos) {
GST_INFO (0, "fakesrc is setting eos on pad");
gst_pad_set_eos (pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
return NULL;
}
@ -387,7 +387,7 @@ gst_fakesrc_loop(GstElement *element)
GstBuffer *buf;
if (src->num_buffers == 0) {
gst_pad_set_eos (pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
return;
}
else {
@ -397,7 +397,7 @@ gst_fakesrc_loop(GstElement *element)
if (src->eos) {
GST_INFO (0, "fakesrc is setting eos on pad");
gst_pad_set_eos (pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
return;
}

View file

@ -203,7 +203,6 @@ gst_fdsrc_get(GstPad *pad)
/* read it in from the file */
readbytes = read(src->fd,GST_BUFFER_DATA(buf),src->bytes_per_read);
if (readbytes == 0) {
gst_element_signal_eos(GST_ELEMENT(src));
return NULL;
}

View file

@ -203,7 +203,7 @@ gst_multidisksrc_get (GstPad *pad)
gst_multidisksrc_close_file(src);
if (!src->listptr) {
gst_pad_set_eos(pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
return FALSE;
}

View file

@ -203,7 +203,7 @@ gst_multidisksrc_get (GstPad *pad)
gst_multidisksrc_close_file(src);
if (!src->listptr) {
gst_pad_set_eos(pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
return FALSE;
}

View file

@ -64,7 +64,7 @@ static void gst_pipefilter_get_property (GObject *object, guint prop_id, GVal
static GstBuffer* gst_pipefilter_get (GstPad *pad);
static void gst_pipefilter_chain (GstPad *pad, GstBuffer *buf);
static gboolean gst_pipefilter_handle_eos (GstPad *pad);
static gboolean gst_pipefilter_handle_event (GstPad *pad, void *event);
static GstElementStateReturn gst_pipefilter_change_state (GstElement *element);
@ -121,7 +121,7 @@ gst_pipefilter_init (GstPipefilter *pipefilter)
pipefilter->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (pipefilter), pipefilter->sinkpad);
gst_pad_set_chain_function (pipefilter->sinkpad, gst_pipefilter_chain);
gst_pad_set_eos_function (pipefilter->sinkpad, gst_pipefilter_handle_eos);
gst_pad_set_event_function (pipefilter->sinkpad, gst_pipefilter_handle_event);
pipefilter->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (pipefilter), pipefilter->srcpad);
@ -134,13 +134,13 @@ gst_pipefilter_init (GstPipefilter *pipefilter)
}
static gboolean
gst_pipefilter_handle_eos (GstPad *pad)
gst_pipefilter_handle_event (GstPad *pad, void *event)
{
GstPipefilter *pipefilter;
pipefilter = GST_PIPEFILTER (gst_pad_get_parent (pad));
GST_DEBUG (0,"pipefilter: %s received eos\n", GST_ELEMENT_NAME (pipefilter));
GST_DEBUG (0,"pipefilter: %s received event\n", GST_ELEMENT_NAME (pipefilter));
if (close (pipefilter->fdin[1]) < 0)
perror("close");
if (close (pipefilter->fdout[0]) < 0)
@ -180,7 +180,7 @@ gst_pipefilter_get (GstPad *pad)
}
/* if we didn't get as many bytes as we asked for, we're at EOF */
if (readbytes == 0) {
gst_pad_set_eos (pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
return NULL;
}

View file

@ -193,8 +193,6 @@ gst_real_pad_init (GstRealPad *pad)
pad->chainfunc = NULL;
pad->getfunc = NULL;
pad->getregionfunc = NULL;
pad->qosfunc = NULL;
pad->eosfunc = GST_DEBUG_FUNCPTR(gst_pad_eos_func);
pad->chainhandler = GST_DEBUG_FUNCPTR(gst_pad_push_func);
pad->gethandler = NULL;
@ -420,44 +418,6 @@ gst_pad_set_getregion_function (GstPad *pad,
GST_DEBUG_PAD_NAME(pad),GST_DEBUG_FUNCPTR_NAME(getregion));
}
/**
* gst_pad_set_qos_function:
* @pad: the pad to set the qos function for
* @qos: the qos function
*
* Set the given qos function for the pad.
*/
void
gst_pad_set_qos_function (GstPad *pad,
GstPadQoSFunction qos)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
GST_RPAD_QOSFUNC(pad) = qos;
GST_DEBUG (GST_CAT_PADS,"qosfunc for %s:%s set to %s\n",
GST_DEBUG_PAD_NAME(pad),GST_DEBUG_FUNCPTR_NAME(qos));
}
/**
* gst_pad_set_eos_function:
* @pad: the pad to set the eos function for
* @eos: the eos function
*
* Set the given EOS function for the pad.
*/
void
gst_pad_set_eos_function (GstPad *pad,
GstPadEOSFunction eos)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
GST_RPAD_EOSFUNC(pad) = eos;
GST_DEBUG (GST_CAT_PADS,"eosfunc for %s:%s set to %s\n",
GST_DEBUG_PAD_NAME(pad),GST_DEBUG_FUNCPTR_NAME(eos));
}
/**
* gst_pad_set_negotiate_function:
* @pad: the pad to set the negotiate function for
@ -528,42 +488,6 @@ gst_pad_push_func(GstPad *pad, GstBuffer *buf)
}
/**
* gst_pad_handle_qos:
* @pad: the pad to handle the QoS message
* @qos_message: the QoS message to handle
*
* Pass the qos message downstream.
*/
void
gst_pad_handle_qos(GstPad *pad,
glong qos_message)
{
GstElement *element;
GList *pads;
GstPad *target_pad;
GST_DEBUG (GST_CAT_PADS,"gst_pad_handle_qos(\"%s\",%08ld)\n", GST_OBJECT_NAME (GST_PAD_PARENT (pad)),qos_message);
if (GST_RPAD_QOSFUNC(pad)) {
(GST_RPAD_QOSFUNC(pad)) (pad,qos_message);
} else {
element = GST_ELEMENT (GST_PAD_PARENT(GST_RPAD_PEER(pad)));
pads = element->pads;
GST_DEBUG (GST_CAT_PADS,"gst_pad_handle_qos recurse(\"%s\",%08ld)\n", GST_ELEMENT_NAME (element), qos_message);
while (pads) {
target_pad = GST_PAD (pads->data);
if (GST_RPAD_DIRECTION(target_pad) == GST_PAD_SINK) {
gst_pad_handle_qos (target_pad, qos_message);
}
pads = g_list_next (pads);
}
}
return;
}
/**
* gst_pad_disconnect:
* @srcpad: the source pad to disconnect
@ -1613,8 +1537,11 @@ gst_pad_peek (GstPad *pad)
GstPad*
gst_pad_select (GList *padlist)
{
// FIXME implement me
return NULL;
GstPad *pad;
pad = gst_schedule_pad_select (gst_pad_get_sched (GST_PAD (padlist->data)), padlist);
return pad;
}
/**
@ -1877,75 +1804,6 @@ gst_padtemplate_load_thyself (xmlNodePtr parent)
}
gboolean
gst_pad_eos_func(GstPad *pad)
{
GstElement *element;
GList *pads;
GstPad *srcpad;
gboolean result = TRUE, success;
g_return_val_if_fail (pad != NULL, FALSE);
g_return_val_if_fail (GST_IS_REAL_PAD(pad), FALSE); // NOTE the restriction
GST_INFO (GST_CAT_PADS,"attempting to set EOS on sink pad %s:%s",GST_DEBUG_PAD_NAME(pad));
element = GST_ELEMENT (gst_object_get_parent (GST_OBJECT (pad)));
// g_return_val_if_fail (element != NULL, FALSE);
// g_return_val_if_fail (GST_IS_ELEMENT(element), FALSE);
pads = gst_element_get_pad_list(element);
while (pads) {
srcpad = GST_PAD(pads->data);
pads = g_list_next(pads);
if (gst_pad_get_direction(srcpad) == GST_PAD_SRC) {
result = gst_pad_eos(GST_REAL_PAD(srcpad));
if (result == FALSE) success = FALSE;
}
}
if (result == FALSE) return FALSE;
GST_INFO (GST_CAT_PADS,"set EOS on sink pad %s:%s",GST_DEBUG_PAD_NAME(pad));
GST_FLAG_SET (pad, GST_PAD_EOS);
gst_element_set_state (GST_ELEMENT(GST_PAD_PARENT(pad)), GST_STATE_READY);
return TRUE;
}
/**
* gst_pad_set_eos:
* @pad: the pad to set to eos
*
* Sets the given pad to the EOS state.
*
* Returns: TRUE if it succeeded
*/
gboolean
gst_pad_set_eos(GstPad *pad)
{
g_return_val_if_fail (pad != NULL, FALSE);
g_return_val_if_fail (GST_IS_REAL_PAD(pad), FALSE); // NOTE the restriction
g_return_val_if_fail (GST_PAD_CONNECTED(pad), FALSE);
GST_INFO (GST_CAT_PADS,"attempting to set EOS on src pad %s:%s",GST_DEBUG_PAD_NAME(pad));
if (!gst_pad_eos(GST_REAL_PAD(pad))) {
return FALSE;
}
GST_INFO (GST_CAT_PADS,"set EOS on src pad %s:%s",GST_DEBUG_PAD_NAME(pad));
GST_FLAG_SET (pad, GST_PAD_EOS);
gst_element_set_state (GST_ELEMENT(GST_PAD_PARENT(pad)), GST_STATE_READY);
gst_element_signal_eos (GST_ELEMENT (GST_PAD_PARENT (pad)));
return TRUE;
}
/**
* gst_pad_set_element_private:
* @pad: the pad to set the private data to

View file

@ -96,8 +96,6 @@ typedef gboolean (*GstPadEventFunction) (GstPad *pad, void *event);
typedef GstBuffer* (*GstPadGetRegionFunction) (GstPad *pad, GstRegionType type, guint64 offset, guint64 len);
typedef GstBuffer* (*GstPadPullRegionFunction) (GstPad *pad, GstRegionType type, guint64 offset, guint64 len);
typedef void (*GstPadQoSFunction) (GstPad *pad, glong qos_message);
typedef gboolean (*GstPadEOSFunction) (GstPad *pad);
typedef GstPadNegotiateReturn (*GstPadNegotiateFunction) (GstPad *pad, GstCaps **caps, gpointer *data);
typedef void (*GstPadNewCapsFunction) (GstPad *pad, GstCaps *caps);
typedef GstBufferPool* (*GstPadBufferPoolFunction) (GstPad *pad);
@ -154,8 +152,6 @@ struct _GstRealPad {
GstPadGetRegionFunction getregionfunc;
GstPadPullRegionFunction pullregionfunc;
GstPadQoSFunction qosfunc;
GstPadEOSFunction eosfunc;
GstPadNegotiateFunction negotiatefunc;
GstPadNewCapsFunction newcapsfunc;
@ -210,8 +206,6 @@ struct _GstGhostPadClass {
#define GST_RPAD_GETREGIONFUNC(pad) (((GstRealPad *)(pad))->getregionfunc)
#define GST_RPAD_PULLREGIONFUNC(pad) (((GstRealPad *)(pad))->pullregionfunc)
#define GST_RPAD_QOSFUNC(pad) (((GstRealPad *)(pad))->qosfunc)
#define GST_RPAD_EOSFUNC(pad) (((GstRealPad *)(pad))->eosfunc)
#define GST_RPAD_NEGOTIATEFUNC(pad) (((GstRealPad *)(pad))->negotiatefunc)
#define GST_RPAD_NEWCAPSFUNC(pad) (((GstRealPad *)(pad))->newcapsfunc)
@ -309,8 +303,6 @@ void gst_pad_set_get_function (GstPad *pad, GstPadGetFunction get);
void gst_pad_set_event_function (GstPad *pad, GstPadEventFunction event);
void gst_pad_set_getregion_function (GstPad *pad, GstPadGetRegionFunction getregion);
void gst_pad_set_qos_function (GstPad *pad, GstPadQoSFunction qos);
void gst_pad_set_eos_function (GstPad *pad, GstPadEOSFunction eos);
void gst_pad_set_negotiate_function (GstPad *pad, GstPadNegotiateFunction nego);
void gst_pad_set_newcaps_function (GstPad *pad, GstPadNewCapsFunction newcaps);
@ -387,12 +379,6 @@ GstBuffer* gst_pad_peek (GstPad *pad);
GstPad* gst_pad_select (GList *padlist);
GstPad* gst_pad_selectv (GstPad *pad, ...);
#define gst_pad_eos(pad) (GST_RPAD_EOSFUNC(GST_RPAD_PEER(pad))(GST_PAD(GST_RPAD_PEER(pad))))
gboolean gst_pad_set_eos (GstPad *pad);
gboolean gst_pad_eos_func (GstPad *pad);
void gst_pad_handle_qos (GstPad *pad, glong qos_message);
void gst_pad_load_and_connect (xmlNodePtr self, GstObject *parent);

View file

@ -73,7 +73,6 @@ static void gst_queue_init (GstQueue *queue);
static void gst_queue_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_queue_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static gboolean gst_queue_handle_eos (GstPad *pad);
static GstPadNegotiateReturn gst_queue_handle_negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data);
static GstPadNegotiateReturn gst_queue_handle_negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data);
static void gst_queue_chain (GstPad *pad, GstBuffer *buf);
@ -162,7 +161,6 @@ gst_queue_init (GstQueue *queue)
queue->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_pad_set_chain_function (queue->sinkpad, GST_DEBUG_FUNCPTR(gst_queue_chain));
gst_element_add_pad (GST_ELEMENT (queue), queue->sinkpad);
gst_pad_set_eos_function (queue->sinkpad, GST_DEBUG_FUNCPTR(gst_queue_handle_eos));
gst_pad_set_negotiate_function (queue->sinkpad, GST_DEBUG_FUNCPTR(gst_queue_handle_negotiate_sink));
gst_pad_set_bufferpool_function (queue->sinkpad, GST_DEBUG_FUNCPTR(gst_queue_get_bufferpool));
@ -215,13 +213,13 @@ gst_queue_handle_negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data)
}
static gboolean
gst_queue_handle_eos (GstPad *pad)
gst_queue_handle_event (GstPad *pad)
{
GstQueue *queue;
queue = GST_QUEUE (GST_OBJECT_PARENT (pad));
GST_DEBUG (GST_CAT_DATAFLOW,"%s received eos\n", GST_ELEMENT_NAME (queue));
GST_DEBUG (GST_CAT_DATAFLOW,"%s received event\n", GST_ELEMENT_NAME (queue));
GST_LOCK (queue);
GST_DEBUG (GST_CAT_DATAFLOW,"%s has %d buffers left\n", GST_ELEMENT_NAME (queue),
@ -373,7 +371,6 @@ gst_queue_get (GstPad *pad)
if (GST_FLAG_IS_SET (queue->sinkpad, GST_PAD_EOS)) {
GST_DEBUG (GST_CAT_DATAFLOW, "%s U released lock\n", name);
GST_UNLOCK(queue);
gst_pad_set_eos (queue->srcpad);
// this return NULL shouldn't hurt anything...
return NULL;
}

View file

@ -51,26 +51,30 @@ gst_schedule_chain_wrapper (int argc,char *argv[])
{
GstElement *element = GST_ELEMENT (argv);
G_GNUC_UNUSED const gchar *name = GST_ELEMENT_NAME (element);
GList *pads;
GstPad *pad;
GstRealPad *realpad;
GstBuffer *buf;
GST_DEBUG_ENTER("(\"%s\")",name);
GST_DEBUG (GST_CAT_DATAFLOW,"stepping through pads\n");
do {
pads = element->pads;
GList *pads = element->pads;
while (pads) {
pad = GST_PAD (pads->data);
GstPad *pad = GST_PAD (pads->data);
GstRealPad *realpad;
pads = g_list_next (pads);
if (!GST_IS_REAL_PAD(pad)) continue;
if (!GST_IS_REAL_PAD(pad))
continue;
realpad = GST_REAL_PAD(pad);
if (GST_RPAD_DIRECTION (realpad) == GST_PAD_SINK) {
GstBuffer *buf;
GST_DEBUG (GST_CAT_DATAFLOW,"pulling a buffer from %s:%s\n", name, GST_PAD_NAME (pad));
buf = gst_pad_pull (pad);
GST_DEBUG (GST_CAT_DATAFLOW,"calling chain function of %s:%s\n", name, GST_PAD_NAME (pad));
if (buf) GST_RPAD_CHAINFUNC(realpad) (pad,buf);
if (buf)
GST_RPAD_CHAINFUNC(realpad) (pad,buf);
GST_DEBUG (GST_CAT_DATAFLOW,"calling chain function of %s:%s done\n", name, GST_PAD_NAME (pad));
}
}
@ -165,6 +169,7 @@ gst_schedule_select_proxy (GstPad *pad, GstBuffer *buf)
g_print ("select proxy (%s:%s)\n",GST_DEBUG_PAD_NAME(pad));
GST_DEBUG_ENTER("(%s:%s)",GST_DEBUG_PAD_NAME(pad));
GST_DEBUG (GST_CAT_DATAFLOW,"putting buffer %p in peer's pen\n",buf);
g_assert (GST_RPAD_BUFPEN(GST_RPAD_PEER(pad)) == NULL);
@ -173,6 +178,7 @@ gst_schedule_select_proxy (GstPad *pad, GstBuffer *buf)
GST_DEBUG (GST_CAT_DATAFLOW,"switching to %p\n",GST_ELEMENT (GST_PAD_PARENT (pad))->threadstate);
g_print ("%p %s\n", GST_ELEMENT (GST_PAD_PARENT (pad)), gst_element_get_name (GST_ELEMENT (GST_PAD_PARENT (pad))));
GST_ELEMENT (GST_PAD_PARENT (pad))->select_pad = pad;
GST_FLAG_UNSET(GST_PAD_PARENT (pad), GST_ELEMENT_COTHREAD_STOPPING);
cothread_switch (GST_ELEMENT (GST_PAD_PARENT (pad))->threadstate);
g_print ("done switching\n");
@ -1192,8 +1198,21 @@ GstPad*
gst_schedule_pad_select (GstSchedule *sched, GList *padlist)
{
GstPad *pad = NULL;
GList *padlist2 = padlist;
GST_INFO (GST_CAT_SCHEDULING, "performing select");
while (padlist2) {
pad = GST_PAD (padlist2->data);
if (gst_pad_peek (pad)) {
g_print ("found something in pad %s:%s\n", GST_DEBUG_PAD_NAME (pad));
return pad;
}
padlist2 = g_list_next (padlist2);
}
/* else there is nothing ready to consume, set up the select functions */
while (padlist) {
pad = GST_PAD (padlist->data);
@ -1400,11 +1419,11 @@ GST_DEBUG(GST_CAT_SCHEDULING,"there are %d elements in this chain\n",chain->num_
} else {
GST_INFO (GST_CAT_DATAFLOW,"NO ENTRY INTO CHAIN!");
eos = TRUE;
//eos = TRUE;
}
} else {
GST_INFO (GST_CAT_DATAFLOW,"NO ENABLED ELEMENTS IN CHAIN!!");
eos = TRUE;
//eos = TRUE;
}
/*

View file

@ -240,7 +240,6 @@ gst_disksrc_get (GstPad *pad)
if (src->curoffset >= src->size) {
GST_DEBUG (0,"map offset %ld >= size %ld --> eos\n", src->curoffset, src->size);
gst_pad_event(pad,(void *)GST_EVENT_EOS);
gst_pad_set_eos (pad);
buf = gst_buffer_new();
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_EOS);
return buf;
@ -303,7 +302,7 @@ gst_disksrc_get_region (GstPad *pad, GstRegionType type,guint64 offset,guint64 l
/* deal with EOF state */
if (offset >= src->size) {
//gst_pad_set_eos (pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
GST_DEBUG (0,"map offset %lld >= size %ld --> eos\n", offset, src->size);
//FIXME
buf = gst_buffer_new();

View file

@ -334,7 +334,7 @@ gst_fakesrc_get(GstPad *pad)
g_return_val_if_fail (GST_IS_FAKESRC (src), NULL);
if (src->num_buffers == 0) {
gst_pad_set_eos (pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
return NULL;
}
else {
@ -344,7 +344,7 @@ gst_fakesrc_get(GstPad *pad)
if (src->eos) {
GST_INFO (0, "fakesrc is setting eos on pad");
gst_pad_set_eos (pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
return NULL;
}
@ -387,7 +387,7 @@ gst_fakesrc_loop(GstElement *element)
GstBuffer *buf;
if (src->num_buffers == 0) {
gst_pad_set_eos (pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
return;
}
else {
@ -397,7 +397,7 @@ gst_fakesrc_loop(GstElement *element)
if (src->eos) {
GST_INFO (0, "fakesrc is setting eos on pad");
gst_pad_set_eos (pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
return;
}

View file

@ -203,7 +203,6 @@ gst_fdsrc_get(GstPad *pad)
/* read it in from the file */
readbytes = read(src->fd,GST_BUFFER_DATA(buf),src->bytes_per_read);
if (readbytes == 0) {
gst_element_signal_eos(GST_ELEMENT(src));
return NULL;
}

View file

@ -203,7 +203,7 @@ gst_multidisksrc_get (GstPad *pad)
gst_multidisksrc_close_file(src);
if (!src->listptr) {
gst_pad_set_eos(pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
return FALSE;
}

View file

@ -203,7 +203,7 @@ gst_multidisksrc_get (GstPad *pad)
gst_multidisksrc_close_file(src);
if (!src->listptr) {
gst_pad_set_eos(pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
return FALSE;
}

View file

@ -64,7 +64,7 @@ static void gst_pipefilter_get_property (GObject *object, guint prop_id, GVal
static GstBuffer* gst_pipefilter_get (GstPad *pad);
static void gst_pipefilter_chain (GstPad *pad, GstBuffer *buf);
static gboolean gst_pipefilter_handle_eos (GstPad *pad);
static gboolean gst_pipefilter_handle_event (GstPad *pad, void *event);
static GstElementStateReturn gst_pipefilter_change_state (GstElement *element);
@ -121,7 +121,7 @@ gst_pipefilter_init (GstPipefilter *pipefilter)
pipefilter->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (pipefilter), pipefilter->sinkpad);
gst_pad_set_chain_function (pipefilter->sinkpad, gst_pipefilter_chain);
gst_pad_set_eos_function (pipefilter->sinkpad, gst_pipefilter_handle_eos);
gst_pad_set_event_function (pipefilter->sinkpad, gst_pipefilter_handle_event);
pipefilter->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (pipefilter), pipefilter->srcpad);
@ -134,13 +134,13 @@ gst_pipefilter_init (GstPipefilter *pipefilter)
}
static gboolean
gst_pipefilter_handle_eos (GstPad *pad)
gst_pipefilter_handle_event (GstPad *pad, void *event)
{
GstPipefilter *pipefilter;
pipefilter = GST_PIPEFILTER (gst_pad_get_parent (pad));
GST_DEBUG (0,"pipefilter: %s received eos\n", GST_ELEMENT_NAME (pipefilter));
GST_DEBUG (0,"pipefilter: %s received event\n", GST_ELEMENT_NAME (pipefilter));
if (close (pipefilter->fdin[1]) < 0)
perror("close");
if (close (pipefilter->fdout[0]) < 0)
@ -180,7 +180,7 @@ gst_pipefilter_get (GstPad *pad)
}
/* if we didn't get as many bytes as we asked for, we're at EOF */
if (readbytes == 0) {
gst_pad_set_eos (pad);
gst_pad_event (pad, (void*)GST_EVENT_EOS);
return NULL;
}

View file

@ -73,7 +73,6 @@ static void gst_queue_init (GstQueue *queue);
static void gst_queue_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_queue_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static gboolean gst_queue_handle_eos (GstPad *pad);
static GstPadNegotiateReturn gst_queue_handle_negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data);
static GstPadNegotiateReturn gst_queue_handle_negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data);
static void gst_queue_chain (GstPad *pad, GstBuffer *buf);
@ -162,7 +161,6 @@ gst_queue_init (GstQueue *queue)
queue->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_pad_set_chain_function (queue->sinkpad, GST_DEBUG_FUNCPTR(gst_queue_chain));
gst_element_add_pad (GST_ELEMENT (queue), queue->sinkpad);
gst_pad_set_eos_function (queue->sinkpad, GST_DEBUG_FUNCPTR(gst_queue_handle_eos));
gst_pad_set_negotiate_function (queue->sinkpad, GST_DEBUG_FUNCPTR(gst_queue_handle_negotiate_sink));
gst_pad_set_bufferpool_function (queue->sinkpad, GST_DEBUG_FUNCPTR(gst_queue_get_bufferpool));
@ -215,13 +213,13 @@ gst_queue_handle_negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data)
}
static gboolean
gst_queue_handle_eos (GstPad *pad)
gst_queue_handle_event (GstPad *pad)
{
GstQueue *queue;
queue = GST_QUEUE (GST_OBJECT_PARENT (pad));
GST_DEBUG (GST_CAT_DATAFLOW,"%s received eos\n", GST_ELEMENT_NAME (queue));
GST_DEBUG (GST_CAT_DATAFLOW,"%s received event\n", GST_ELEMENT_NAME (queue));
GST_LOCK (queue);
GST_DEBUG (GST_CAT_DATAFLOW,"%s has %d buffers left\n", GST_ELEMENT_NAME (queue),
@ -373,7 +371,6 @@ gst_queue_get (GstPad *pad)
if (GST_FLAG_IS_SET (queue->sinkpad, GST_PAD_EOS)) {
GST_DEBUG (GST_CAT_DATAFLOW, "%s U released lock\n", name);
GST_UNLOCK(queue);
gst_pad_set_eos (queue->srcpad);
// this return NULL shouldn't hurt anything...
return NULL;
}