/* check for EOF */
if (src->curoffset == src->filelen) {
+ GST_DEBUG (0, "filesrc eos %lld %lld\n", src->curoffset, src->filelen);
gst_element_set_eos (GST_ELEMENT (src));
return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
}
{
GstFileSrc *src = GST_FILESRC (GST_PAD_PARENT (pad));
+ GST_DEBUG(0, "event %d", GST_EVENT_TYPE (event));
+
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:
if (GST_EVENT_SEEK_FORMAT (event) != GST_FORMAT_BYTES) {
switch (GST_EVENT_SEEK_METHOD (event)) {
case GST_SEEK_METHOD_SET:
src->curoffset = (guint64) GST_EVENT_SEEK_OFFSET (event);
+ GST_DEBUG(0, "seek set pending to %lld", src->curoffset);
break;
case GST_SEEK_METHOD_CUR:
src->curoffset += GST_EVENT_SEEK_OFFSET (event);
+ GST_DEBUG(0, "seek cur pending to %lld", src->curoffset);
break;
case GST_SEEK_METHOD_END:
src->curoffset = src->filelen - ABS (GST_EVENT_SEEK_OFFSET (event));
+ GST_DEBUG(0, "seek end pending to %lld", src->curoffset);
break;
default:
return FALSE;
static void gst_tee_init (GstTee *tee);
static GstPad* gst_tee_request_new_pad (GstElement *element, GstPadTemplate *temp, const gchar *unused);
-static gboolean gst_tee_event_handler (GstPad *pad, GstEvent *event);
static void gst_tee_set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec);
srcpad = gst_pad_new_from_template (templ, name);
g_free (name);
gst_element_add_pad (GST_ELEMENT (tee), srcpad);
- gst_pad_set_event_function (srcpad, gst_tee_event_handler);
GST_PAD_ELEMENT_PRIVATE (srcpad) = NULL;
if (GST_PAD_CAPS (tee->sinkpad)) {
return srcpad;
}
-static gboolean
-gst_tee_event_handler (GstPad *pad, GstEvent *event)
-{
- GstTee *tee;
-
- tee = GST_TEE (gst_pad_get_parent (pad));
-
- switch (GST_EVENT_TYPE (event)) {
- case GST_EVENT_FLUSH:
- GST_PAD_ELEMENT_PRIVATE (pad) = gst_event_new (GST_EVENT_TYPE (event));
- break;
- default:
- break;
- }
-
- return TRUE;
-}
-
static void
gst_tee_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
g_return_if_fail (buf != NULL);
tee = GST_TEE (gst_pad_get_parent (pad));
- /*gst_trace_add_entry (NULL, 0, buf, "tee buffer");*/
gst_buffer_ref_by_count (buf, GST_ELEMENT (tee)->numsrcpads - 1);
if (GST_PAD_DIRECTION (outpad) != GST_PAD_SRC)
continue;
- if (GST_PAD_ELEMENT_PRIVATE (outpad)) {
- GstEvent *event = GST_EVENT (GST_PAD_ELEMENT_PRIVATE (outpad));
-
- GST_PAD_ELEMENT_PRIVATE (outpad) = NULL;
- if (GST_PAD_IS_CONNECTED (outpad))
- gst_pad_push (outpad, GST_BUFFER (event));
- else
- gst_event_free (event);
- }
-
if (!tee->silent) {
g_free (tee->last_message);
tee->last_message = g_strdup_printf ("chain ******* (%s:%s)t (%d bytes, %llu) %p",
/* check for EOF */
if (src->curoffset == src->filelen) {
+ GST_DEBUG (0, "filesrc eos %lld %lld\n", src->curoffset, src->filelen);
gst_element_set_eos (GST_ELEMENT (src));
return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
}
{
GstFileSrc *src = GST_FILESRC (GST_PAD_PARENT (pad));
+ GST_DEBUG(0, "event %d", GST_EVENT_TYPE (event));
+
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:
if (GST_EVENT_SEEK_FORMAT (event) != GST_FORMAT_BYTES) {
switch (GST_EVENT_SEEK_METHOD (event)) {
case GST_SEEK_METHOD_SET:
src->curoffset = (guint64) GST_EVENT_SEEK_OFFSET (event);
+ GST_DEBUG(0, "seek set pending to %lld", src->curoffset);
break;
case GST_SEEK_METHOD_CUR:
src->curoffset += GST_EVENT_SEEK_OFFSET (event);
+ GST_DEBUG(0, "seek cur pending to %lld", src->curoffset);
break;
case GST_SEEK_METHOD_END:
src->curoffset = src->filelen - ABS (GST_EVENT_SEEK_OFFSET (event));
+ GST_DEBUG(0, "seek end pending to %lld", src->curoffset);
break;
default:
return FALSE;
static void gst_tee_init (GstTee *tee);
static GstPad* gst_tee_request_new_pad (GstElement *element, GstPadTemplate *temp, const gchar *unused);
-static gboolean gst_tee_event_handler (GstPad *pad, GstEvent *event);
static void gst_tee_set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec);
srcpad = gst_pad_new_from_template (templ, name);
g_free (name);
gst_element_add_pad (GST_ELEMENT (tee), srcpad);
- gst_pad_set_event_function (srcpad, gst_tee_event_handler);
GST_PAD_ELEMENT_PRIVATE (srcpad) = NULL;
if (GST_PAD_CAPS (tee->sinkpad)) {
return srcpad;
}
-static gboolean
-gst_tee_event_handler (GstPad *pad, GstEvent *event)
-{
- GstTee *tee;
-
- tee = GST_TEE (gst_pad_get_parent (pad));
-
- switch (GST_EVENT_TYPE (event)) {
- case GST_EVENT_FLUSH:
- GST_PAD_ELEMENT_PRIVATE (pad) = gst_event_new (GST_EVENT_TYPE (event));
- break;
- default:
- break;
- }
-
- return TRUE;
-}
-
static void
gst_tee_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
g_return_if_fail (buf != NULL);
tee = GST_TEE (gst_pad_get_parent (pad));
- /*gst_trace_add_entry (NULL, 0, buf, "tee buffer");*/
gst_buffer_ref_by_count (buf, GST_ELEMENT (tee)->numsrcpads - 1);
if (GST_PAD_DIRECTION (outpad) != GST_PAD_SRC)
continue;
- if (GST_PAD_ELEMENT_PRIVATE (outpad)) {
- GstEvent *event = GST_EVENT (GST_PAD_ELEMENT_PRIVATE (outpad));
-
- GST_PAD_ELEMENT_PRIVATE (outpad) = NULL;
- if (GST_PAD_IS_CONNECTED (outpad))
- gst_pad_push (outpad, GST_BUFFER (event));
- else
- gst_event_free (event);
- }
-
if (!tee->silent) {
g_free (tee->last_message);
tee->last_message = g_strdup_printf ("chain ******* (%s:%s)t (%d bytes, %llu) %p",