summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sourceforge.net>2008-07-22 06:32:03 +0000
committerStefan Kost <ensonic@users.sourceforge.net>2008-07-22 06:32:03 +0000
commitda2d6b62e9a289de0d11283b740d314fa09a6d4f (patch)
tree68b097a407d176af8d029eff967ba45bc12f78c1 /gst
parent260098a7617c30ee87966258dacfe58aeb1a25c0 (diff)
gst/debug/gsttaginject.*: Sent tags in _transform_ip() instead of _start(). Fixes #543404 partially.
Original commit message from CVS: * gst/debug/gsttaginject.c: * gst/debug/gsttaginject.h: Sent tags in _transform_ip() instead of _start(). Fixes #543404 partially.
Diffstat (limited to 'gst')
-rw-r--r--gst/debug/gsttaginject.c28
-rw-r--r--gst/debug/gsttaginject.h1
2 files changed, 17 insertions, 12 deletions
diff --git a/gst/debug/gsttaginject.c b/gst/debug/gsttaginject.c
index 7e2b81c8..896dfea7 100644
--- a/gst/debug/gsttaginject.c
+++ b/gst/debug/gsttaginject.c
@@ -21,7 +21,7 @@
/**
* SECTION:element-taginject
*
- * Element that inject new metadata tags, but passes incomming data through
+ * Element that injects new metadata tags, but passes incomming data through
* unmodified.
* |[
* gst-launch audiotestsrc num-buffers=100 ! taginject tags="title=testsrc,artist=gstreamer" ! vorbisenc ! oggmux ! filesink location=test.ogg
@@ -67,8 +67,8 @@ static void gst_tag_inject_set_property (GObject * object, guint prop_id,
static void gst_tag_inject_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-/*static GstFlowReturn gst_tag_inject_transform_ip (GstBaseTransform * trans,
- GstBuffer * buf); */
+static GstFlowReturn gst_tag_inject_transform_ip (GstBaseTransform * trans,
+ GstBuffer * buf);
static gboolean gst_tag_inject_start (GstBaseTransform * trans);
@@ -120,8 +120,8 @@ gst_tag_inject_class_init (GstTagInjectClass * klass)
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_tag_inject_finalize);
- /*gstbasetrans_class->transform_ip =
- GST_DEBUG_FUNCPTR (gst_tag_inject_transform_ip); */
+ gstbasetrans_class->transform_ip =
+ GST_DEBUG_FUNCPTR (gst_tag_inject_transform_ip);
gstbasetrans_class->start = GST_DEBUG_FUNCPTR (gst_tag_inject_start);
}
@@ -132,15 +132,22 @@ gst_tag_inject_init (GstTagInject * self, GstTagInjectClass * g_class)
self->tags = NULL;
}
-/*
static GstFlowReturn
gst_tag_inject_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
{
GstTagInject *self = GST_TAG_INJECT (trans);
+ if (G_UNLIKELY (!self->tags_sent)) {
+ self->tags_sent = TRUE;
+ /* send tags */
+ if (self->tags && !gst_tag_list_is_empty (self->tags)) {
+ gst_element_found_tags (GST_ELEMENT (trans),
+ gst_tag_list_copy (self->tags));
+ }
+ }
+
return GST_FLOW_OK;
}
-*/
static void
gst_tag_inject_set_property (GObject * object, guint prop_id,
@@ -179,11 +186,8 @@ gst_tag_inject_start (GstBaseTransform * trans)
{
GstTagInject *self = GST_TAG_INJECT (trans);
- /* send tags */
- if (self->tags && !gst_tag_list_is_empty (self->tags)) {
- gst_element_found_tags (GST_ELEMENT (trans),
- gst_tag_list_copy (self->tags));
- }
+ /* we need to sent tags _transform_ip() once */
+ self->tags_sent = FALSE;
return TRUE;
}
diff --git a/gst/debug/gsttaginject.h b/gst/debug/gsttaginject.h
index 7c80ec0f..4d0f04f1 100644
--- a/gst/debug/gsttaginject.h
+++ b/gst/debug/gsttaginject.h
@@ -54,6 +54,7 @@ struct _GstTagInject {
/*< private >*/
GstTagList *tags;
+ gboolean tags_sent;
};
struct _GstTagInjectClass {