mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-25 00:28:21 +00:00
Remove crappy event code from tee
Original commit message from CVS: Remove crappy event code from tee Some more debugging info in filesrc
This commit is contained in:
parent
6f8ddd3043
commit
9940947219
4 changed files with 12 additions and 62 deletions
|
@ -466,6 +466,7 @@ gst_filesrc_get (GstPad *pad)
|
||||||
|
|
||||||
/* check for EOF */
|
/* check for EOF */
|
||||||
if (src->curoffset == src->filelen) {
|
if (src->curoffset == src->filelen) {
|
||||||
|
GST_DEBUG (0, "filesrc eos %lld %lld\n", src->curoffset, src->filelen);
|
||||||
gst_element_set_eos (GST_ELEMENT (src));
|
gst_element_set_eos (GST_ELEMENT (src));
|
||||||
return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
|
return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
|
||||||
}
|
}
|
||||||
|
@ -697,6 +698,8 @@ gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event)
|
||||||
{
|
{
|
||||||
GstFileSrc *src = GST_FILESRC (GST_PAD_PARENT (pad));
|
GstFileSrc *src = GST_FILESRC (GST_PAD_PARENT (pad));
|
||||||
|
|
||||||
|
GST_DEBUG(0, "event %d", GST_EVENT_TYPE (event));
|
||||||
|
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_SEEK:
|
case GST_EVENT_SEEK:
|
||||||
if (GST_EVENT_SEEK_FORMAT (event) != GST_FORMAT_BYTES) {
|
if (GST_EVENT_SEEK_FORMAT (event) != GST_FORMAT_BYTES) {
|
||||||
|
@ -705,12 +708,15 @@ gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event)
|
||||||
switch (GST_EVENT_SEEK_METHOD (event)) {
|
switch (GST_EVENT_SEEK_METHOD (event)) {
|
||||||
case GST_SEEK_METHOD_SET:
|
case GST_SEEK_METHOD_SET:
|
||||||
src->curoffset = (guint64) GST_EVENT_SEEK_OFFSET (event);
|
src->curoffset = (guint64) GST_EVENT_SEEK_OFFSET (event);
|
||||||
|
GST_DEBUG(0, "seek set pending to %lld", src->curoffset);
|
||||||
break;
|
break;
|
||||||
case GST_SEEK_METHOD_CUR:
|
case GST_SEEK_METHOD_CUR:
|
||||||
src->curoffset += GST_EVENT_SEEK_OFFSET (event);
|
src->curoffset += GST_EVENT_SEEK_OFFSET (event);
|
||||||
|
GST_DEBUG(0, "seek cur pending to %lld", src->curoffset);
|
||||||
break;
|
break;
|
||||||
case GST_SEEK_METHOD_END:
|
case GST_SEEK_METHOD_END:
|
||||||
src->curoffset = src->filelen - ABS (GST_EVENT_SEEK_OFFSET (event));
|
src->curoffset = src->filelen - ABS (GST_EVENT_SEEK_OFFSET (event));
|
||||||
|
GST_DEBUG(0, "seek end pending to %lld", src->curoffset);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -58,7 +58,6 @@ static void gst_tee_class_init (GstTeeClass *klass);
|
||||||
static void gst_tee_init (GstTee *tee);
|
static void gst_tee_init (GstTee *tee);
|
||||||
|
|
||||||
static GstPad* gst_tee_request_new_pad (GstElement *element, GstPadTemplate *temp, const gchar *unused);
|
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,
|
static void gst_tee_set_property (GObject *object, guint prop_id,
|
||||||
const GValue *value, GParamSpec *pspec);
|
const GValue *value, GParamSpec *pspec);
|
||||||
|
@ -213,7 +212,6 @@ gst_tee_request_new_pad (GstElement *element, GstPadTemplate *templ, const gchar
|
||||||
srcpad = gst_pad_new_from_template (templ, name);
|
srcpad = gst_pad_new_from_template (templ, name);
|
||||||
g_free (name);
|
g_free (name);
|
||||||
gst_element_add_pad (GST_ELEMENT (tee), srcpad);
|
gst_element_add_pad (GST_ELEMENT (tee), srcpad);
|
||||||
gst_pad_set_event_function (srcpad, gst_tee_event_handler);
|
|
||||||
GST_PAD_ELEMENT_PRIVATE (srcpad) = NULL;
|
GST_PAD_ELEMENT_PRIVATE (srcpad) = NULL;
|
||||||
|
|
||||||
if (GST_PAD_CAPS (tee->sinkpad)) {
|
if (GST_PAD_CAPS (tee->sinkpad)) {
|
||||||
|
@ -223,24 +221,6 @@ gst_tee_request_new_pad (GstElement *element, GstPadTemplate *templ, const gchar
|
||||||
return srcpad;
|
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
|
static void
|
||||||
gst_tee_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
gst_tee_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
|
@ -305,7 +285,6 @@ gst_tee_chain (GstPad *pad, GstBuffer *buf)
|
||||||
g_return_if_fail (buf != NULL);
|
g_return_if_fail (buf != NULL);
|
||||||
|
|
||||||
tee = GST_TEE (gst_pad_get_parent (pad));
|
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);
|
gst_buffer_ref_by_count (buf, GST_ELEMENT (tee)->numsrcpads - 1);
|
||||||
|
|
||||||
|
@ -318,16 +297,6 @@ gst_tee_chain (GstPad *pad, GstBuffer *buf)
|
||||||
if (GST_PAD_DIRECTION (outpad) != GST_PAD_SRC)
|
if (GST_PAD_DIRECTION (outpad) != GST_PAD_SRC)
|
||||||
continue;
|
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) {
|
if (!tee->silent) {
|
||||||
g_free (tee->last_message);
|
g_free (tee->last_message);
|
||||||
tee->last_message = g_strdup_printf ("chain ******* (%s:%s)t (%d bytes, %llu) %p",
|
tee->last_message = g_strdup_printf ("chain ******* (%s:%s)t (%d bytes, %llu) %p",
|
||||||
|
|
|
@ -466,6 +466,7 @@ gst_filesrc_get (GstPad *pad)
|
||||||
|
|
||||||
/* check for EOF */
|
/* check for EOF */
|
||||||
if (src->curoffset == src->filelen) {
|
if (src->curoffset == src->filelen) {
|
||||||
|
GST_DEBUG (0, "filesrc eos %lld %lld\n", src->curoffset, src->filelen);
|
||||||
gst_element_set_eos (GST_ELEMENT (src));
|
gst_element_set_eos (GST_ELEMENT (src));
|
||||||
return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
|
return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
|
||||||
}
|
}
|
||||||
|
@ -697,6 +698,8 @@ gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event)
|
||||||
{
|
{
|
||||||
GstFileSrc *src = GST_FILESRC (GST_PAD_PARENT (pad));
|
GstFileSrc *src = GST_FILESRC (GST_PAD_PARENT (pad));
|
||||||
|
|
||||||
|
GST_DEBUG(0, "event %d", GST_EVENT_TYPE (event));
|
||||||
|
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_SEEK:
|
case GST_EVENT_SEEK:
|
||||||
if (GST_EVENT_SEEK_FORMAT (event) != GST_FORMAT_BYTES) {
|
if (GST_EVENT_SEEK_FORMAT (event) != GST_FORMAT_BYTES) {
|
||||||
|
@ -705,12 +708,15 @@ gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event)
|
||||||
switch (GST_EVENT_SEEK_METHOD (event)) {
|
switch (GST_EVENT_SEEK_METHOD (event)) {
|
||||||
case GST_SEEK_METHOD_SET:
|
case GST_SEEK_METHOD_SET:
|
||||||
src->curoffset = (guint64) GST_EVENT_SEEK_OFFSET (event);
|
src->curoffset = (guint64) GST_EVENT_SEEK_OFFSET (event);
|
||||||
|
GST_DEBUG(0, "seek set pending to %lld", src->curoffset);
|
||||||
break;
|
break;
|
||||||
case GST_SEEK_METHOD_CUR:
|
case GST_SEEK_METHOD_CUR:
|
||||||
src->curoffset += GST_EVENT_SEEK_OFFSET (event);
|
src->curoffset += GST_EVENT_SEEK_OFFSET (event);
|
||||||
|
GST_DEBUG(0, "seek cur pending to %lld", src->curoffset);
|
||||||
break;
|
break;
|
||||||
case GST_SEEK_METHOD_END:
|
case GST_SEEK_METHOD_END:
|
||||||
src->curoffset = src->filelen - ABS (GST_EVENT_SEEK_OFFSET (event));
|
src->curoffset = src->filelen - ABS (GST_EVENT_SEEK_OFFSET (event));
|
||||||
|
GST_DEBUG(0, "seek end pending to %lld", src->curoffset);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -58,7 +58,6 @@ static void gst_tee_class_init (GstTeeClass *klass);
|
||||||
static void gst_tee_init (GstTee *tee);
|
static void gst_tee_init (GstTee *tee);
|
||||||
|
|
||||||
static GstPad* gst_tee_request_new_pad (GstElement *element, GstPadTemplate *temp, const gchar *unused);
|
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,
|
static void gst_tee_set_property (GObject *object, guint prop_id,
|
||||||
const GValue *value, GParamSpec *pspec);
|
const GValue *value, GParamSpec *pspec);
|
||||||
|
@ -213,7 +212,6 @@ gst_tee_request_new_pad (GstElement *element, GstPadTemplate *templ, const gchar
|
||||||
srcpad = gst_pad_new_from_template (templ, name);
|
srcpad = gst_pad_new_from_template (templ, name);
|
||||||
g_free (name);
|
g_free (name);
|
||||||
gst_element_add_pad (GST_ELEMENT (tee), srcpad);
|
gst_element_add_pad (GST_ELEMENT (tee), srcpad);
|
||||||
gst_pad_set_event_function (srcpad, gst_tee_event_handler);
|
|
||||||
GST_PAD_ELEMENT_PRIVATE (srcpad) = NULL;
|
GST_PAD_ELEMENT_PRIVATE (srcpad) = NULL;
|
||||||
|
|
||||||
if (GST_PAD_CAPS (tee->sinkpad)) {
|
if (GST_PAD_CAPS (tee->sinkpad)) {
|
||||||
|
@ -223,24 +221,6 @@ gst_tee_request_new_pad (GstElement *element, GstPadTemplate *templ, const gchar
|
||||||
return srcpad;
|
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
|
static void
|
||||||
gst_tee_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
gst_tee_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
|
@ -305,7 +285,6 @@ gst_tee_chain (GstPad *pad, GstBuffer *buf)
|
||||||
g_return_if_fail (buf != NULL);
|
g_return_if_fail (buf != NULL);
|
||||||
|
|
||||||
tee = GST_TEE (gst_pad_get_parent (pad));
|
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);
|
gst_buffer_ref_by_count (buf, GST_ELEMENT (tee)->numsrcpads - 1);
|
||||||
|
|
||||||
|
@ -318,16 +297,6 @@ gst_tee_chain (GstPad *pad, GstBuffer *buf)
|
||||||
if (GST_PAD_DIRECTION (outpad) != GST_PAD_SRC)
|
if (GST_PAD_DIRECTION (outpad) != GST_PAD_SRC)
|
||||||
continue;
|
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) {
|
if (!tee->silent) {
|
||||||
g_free (tee->last_message);
|
g_free (tee->last_message);
|
||||||
tee->last_message = g_strdup_printf ("chain ******* (%s:%s)t (%d bytes, %llu) %p",
|
tee->last_message = g_strdup_printf ("chain ******* (%s:%s)t (%d bytes, %llu) %p",
|
||||||
|
|
Loading…
Reference in a new issue