Added EOS to the cache.

Original commit message from CVS:
Added EOS to the cache.
This commit is contained in:
Wim Taymans 2002-01-13 12:59:23 +00:00
parent e35929fbe0
commit 4031c2f252

View file

@ -92,8 +92,6 @@ static void gst_autoplugcache_get_property (GObject *object, guint prop_id,
static void gst_autoplugcache_loop (GstElement *element); static void gst_autoplugcache_loop (GstElement *element);
static GstPadNegotiateReturn gst_autoplugcache_nego_src (GstPad *pad, GstCaps **caps, gpointer *data);
static GstPadNegotiateReturn gst_autoplugcache_nego_sink (GstPad *pad, GstCaps **caps, gpointer *data);
static GstElementStateReturn gst_autoplugcache_change_state (GstElement *element); static GstElementStateReturn gst_autoplugcache_change_state (GstElement *element);
@ -207,6 +205,10 @@ gst_autoplugcache_loop (GstElement *element)
if (cache->current_playout == NULL) { if (cache->current_playout == NULL) {
/* get a buffer */ /* get a buffer */
buf = gst_pad_pull (cache->sinkpad); buf = gst_pad_pull (cache->sinkpad);
if (GST_IS_EVENT (buf)) {
gst_pad_event_default (cache->sinkpad, GST_EVENT (buf));
return;
}
/* add it to the cache, though cache == NULL */ /* add it to the cache, though cache == NULL */
gst_buffer_ref (buf); gst_buffer_ref (buf);
@ -240,6 +242,10 @@ gst_autoplugcache_loop (GstElement *element)
/* get a buffer */ /* get a buffer */
buf = gst_pad_pull (cache->sinkpad); buf = gst_pad_pull (cache->sinkpad);
if (GST_IS_EVENT (buf)) {
gst_pad_event_default (cache->sinkpad, GST_EVENT (buf));
return;
}
/* add it to the front of the cache */ /* add it to the front of the cache */
gst_buffer_ref (buf); gst_buffer_ref (buf);
@ -268,23 +274,6 @@ gst_autoplugcache_loop (GstElement *element)
} }
} }
static GstPadNegotiateReturn
gst_autoplugcache_nego_src (GstPad *pad, GstCaps **caps, gpointer *data)
{
GstAutoplugCache *cache = GST_AUTOPLUGCACHE (GST_PAD_PARENT (pad));
return gst_pad_negotiate_proxy (pad, cache->sinkpad, caps);
}
static GstPadNegotiateReturn
gst_autoplugcache_nego_sink (GstPad *pad, GstCaps **caps, gpointer *data)
{
GstAutoplugCache *cache = GST_AUTOPLUGCACHE (GST_PAD_PARENT (pad));
return gst_pad_negotiate_proxy (pad, cache->srcpad, caps);
}
static GstElementStateReturn static GstElementStateReturn
gst_autoplugcache_change_state (GstElement *element) gst_autoplugcache_change_state (GstElement *element)
{ {
@ -307,11 +296,7 @@ gst_autoplugcache_set_property (GObject *object, guint prop_id, const GValue *va
cache->caps_proxy = g_value_get_boolean (value); cache->caps_proxy = g_value_get_boolean (value);
GST_DEBUG(0,"caps_proxy is %d\n",cache->caps_proxy); GST_DEBUG(0,"caps_proxy is %d\n",cache->caps_proxy);
if (cache->caps_proxy) { if (cache->caps_proxy) {
gst_pad_set_negotiate_function (cache->sinkpad, GST_DEBUG_FUNCPTR(gst_autoplugcache_nego_sink));
gst_pad_set_negotiate_function (cache->srcpad, GST_DEBUG_FUNCPTR(gst_autoplugcache_nego_src));
} else { } else {
gst_pad_set_negotiate_function (cache->sinkpad, NULL);
gst_pad_set_negotiate_function (cache->srcpad, NULL);
} }
break; break;
case ARG_RESET: case ARG_RESET: