fakesink = GST_FAKESINK (gst_pad_get_parent (pad));
if (!fakesink->silent)
- g_print("fakesink: chain ******* (%s:%s)< (%d bytes, %llu) \n",
+ g_print("fakesink: chain ******* (%s:%s)< (%d bytes, %llu) \n",
GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_signal_emit (G_OBJECT (fakesink), gst_fakesink_signals[SIGNAL_HANDOFF], 0,
1, G_MAXINT, 1, G_PARAM_READABLE));
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOOP_BASED,
g_param_spec_boolean("loop_based","loop_based","loop_based",
- TRUE,G_PARAM_READWRITE)); // CHECKME
+ FALSE, G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_OUTPUT,
g_param_spec_enum("output","output","output",
GST_TYPE_FAKESRC_OUTPUT,FAKESRC_FIRST_LAST_LOOP,G_PARAM_READWRITE)); // CHECKME!
gst_element_add_pad (GST_ELEMENT (fakesrc), pad);
fakesrc->srcpads = g_slist_append (NULL, pad);
- fakesrc->loop_based = TRUE;
+ fakesrc->loop_based = FALSE;
if (fakesrc->loop_based)
gst_element_set_loop_function (GST_ELEMENT (fakesrc), GST_DEBUG_FUNCPTR (gst_fakesrc_loop));
GST_BUFFER_TIMESTAMP (buf) = src->buffer_count++;
if (!src->silent)
- g_print("fakesrc: get ******* (%s:%s)> (%d bytes, %llu) \n",
+ g_print("fakesrc: get ******* (%s:%s)> (%d bytes, %llu) \n",
GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_signal_emit (G_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF], 0,
GST_BUFFER_TIMESTAMP (buf) = src->buffer_count++;
if (!src->silent)
- g_print("fakesrc: loop ******* (%s:%s) > (%d bytes, %llu) \n",
+ g_print("fakesrc: loop ******* (%s:%s) > (%d bytes, %llu) \n",
GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_signal_emit (G_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF], 0,
ARG_0,
ARG_LOOP_BASED,
ARG_SLEEP_TIME,
+ ARG_DUPLICATE,
ARG_SILENT,
};
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
- g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOOP_BASED,
- g_param_spec_boolean("loop_based","loop_based","loop_based",
- TRUE,G_PARAM_READWRITE)); // CHECKME
- g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SLEEP_TIME,
- g_param_spec_uint("sleep_time","sleep_time","sleep_time",
- 0,G_MAXUINT,0,G_PARAM_READWRITE)); // CHECKME
- g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SILENT,
- g_param_spec_boolean("silent","silent","silent",
- TRUE,G_PARAM_READWRITE)); // CHECKME
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOOP_BASED,
+ g_param_spec_boolean ("loop_based", "loop_based", "loop_based",
+ TRUE, G_PARAM_READWRITE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SLEEP_TIME,
+ g_param_spec_uint ("sleep_time", "sleep_time", "sleep_time",
+ 0, G_MAXUINT, 0, G_PARAM_READWRITE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DUPLICATE,
+ g_param_spec_uint ("duplicate", "duplicate", "duplicate",
+ 0, G_MAXUINT, 1, G_PARAM_READWRITE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SILENT,
+ g_param_spec_boolean ("silent", "silent", "silent",
+ TRUE,G_PARAM_READWRITE));
gst_identity_signals[SIGNAL_HANDOFF] =
g_signal_newc ("handoff", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
identity->loop_based = FALSE;
identity->sleep_time = 0;
+ identity->duplicate = 1;
identity->silent = FALSE;
}
gst_identity_chain (GstPad *pad, GstBuffer *buf)
{
GstIdentity *identity;
+ guint i;
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
identity = GST_IDENTITY (gst_pad_get_parent (pad));
- if (!identity->silent)
- g_print("identity: chain ******* (%s:%s)i (%d bytes, %llu) \n",
+ for (i=identity->duplicate; i; i--) {
+ if (!identity->silent)
+ g_print("identity: chain ******* (%s:%s)i (%d bytes, %llu) \n",
GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
- g_signal_emit (G_OBJECT (identity), gst_identity_signals[SIGNAL_HANDOFF], 0,
+ g_signal_emit (G_OBJECT (identity), gst_identity_signals[SIGNAL_HANDOFF], 0,
buf);
- gst_pad_push (identity->srcpad, buf);
+ if (i>1)
+ gst_buffer_ref (buf);
+
+ gst_pad_push (identity->srcpad, buf);
- if (identity->sleep_time)
- usleep (identity->sleep_time);
+ if (identity->sleep_time)
+ usleep (identity->sleep_time);
+ }
}
static void
{
GstIdentity *identity;
GstBuffer *buf;
+ guint i;
g_return_if_fail (element != NULL);
g_return_if_fail (GST_IS_IDENTITY (element));
do {
buf = gst_pad_pull (identity->sinkpad);
- if (!identity->silent)
- g_print("identity: loop ******* (%s:%s)i (%d bytes, %llu) \n",
+
+ for (i=identity->duplicate; i; i--) {
+ if (!identity->silent)
+ g_print("identity: loop ******* (%s:%s)i (%d bytes, %llu) \n",
GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
- g_signal_emit (G_OBJECT (identity), gst_identity_signals[SIGNAL_HANDOFF], 0,
+ g_signal_emit (G_OBJECT (identity), gst_identity_signals[SIGNAL_HANDOFF], 0,
buf);
- gst_pad_push (identity->srcpad, buf);
+ if (i>1)
+ gst_buffer_ref (buf);
- if (identity->sleep_time)
- usleep (identity->sleep_time);
+ gst_pad_push (identity->srcpad, buf);
+
+ if (identity->sleep_time)
+ usleep (identity->sleep_time);
+ }
} while (!GST_ELEMENT_IS_COTHREAD_STOPPING(element));
}
case ARG_SILENT:
identity->silent = g_value_get_boolean (value);
break;
+ case ARG_DUPLICATE:
+ identity->duplicate = g_value_get_uint (value);
+ break;
default:
break;
}
case ARG_SLEEP_TIME:
g_value_set_uint (value, identity->sleep_time);
break;
+ case ARG_DUPLICATE:
+ g_value_set_uint (value, identity->duplicate);
+ break;
case ARG_SILENT:
g_value_set_boolean (value, identity->silent);
break;
GstPad *srcpad;
gboolean loop_based;
-
+ guint duplicate;
guint sleep_time;
gboolean silent;
};
enum {
ARG_0,
+ ARG_SILENT,
ARG_NUM_PADS,
/* FILL ME */
};
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NUM_PADS,
g_param_spec_int ("num_pads", "num_pads", "num_pads",
0, G_MAXINT, 0, G_PARAM_READABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SILENT,
+ g_param_spec_boolean ("silent", "silent", "silent",
+ FALSE, G_PARAM_READWRITE));
+
+
gobject_class->set_property = GST_DEBUG_FUNCPTR(gst_tee_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR(gst_tee_get_property);
tee->numsrcpads = 0;
tee->srcpads = NULL;
+ tee->silent = FALSE;
}
static GstPad*
tee = GST_TEE (object);
switch (prop_id) {
-// case ARG_NUM_PADS:
-// g_value_set_int (value, tee->numsrcpads);
-// break;
+ case ARG_SILENT:
+ tee->silent = g_value_get_boolean (value);
+ break;
default:
break;
}
case ARG_NUM_PADS:
g_value_set_int (value, tee->numsrcpads);
break;
+ case ARG_SILENT:
+ g_value_set_boolean (value, tee->silent);
+ break;
default:
break;
}
srcpads = tee->srcpads;
while (srcpads) {
- gst_pad_push (GST_PAD (srcpads->data), buf);
+ GstPad *outpad = GST_PAD (srcpads->data);
srcpads = g_slist_next (srcpads);
+
+ if (!tee->silent)
+ g_print("tee: chain ******* (%s:%s)t (%d bytes, %llu) \n",
+ GST_DEBUG_PAD_NAME (outpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
+
+ gst_pad_push (outpad, buf);
}
}
GstPad *sinkpad;
+ gboolean silent;
gint numsrcpads;
GSList *srcpads;
};
fakesink = GST_FAKESINK (gst_pad_get_parent (pad));
if (!fakesink->silent)
- g_print("fakesink: chain ******* (%s:%s)< (%d bytes, %llu) \n",
+ g_print("fakesink: chain ******* (%s:%s)< (%d bytes, %llu) \n",
GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_signal_emit (G_OBJECT (fakesink), gst_fakesink_signals[SIGNAL_HANDOFF], 0,
1, G_MAXINT, 1, G_PARAM_READABLE));
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOOP_BASED,
g_param_spec_boolean("loop_based","loop_based","loop_based",
- TRUE,G_PARAM_READWRITE)); // CHECKME
+ FALSE, G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_OUTPUT,
g_param_spec_enum("output","output","output",
GST_TYPE_FAKESRC_OUTPUT,FAKESRC_FIRST_LAST_LOOP,G_PARAM_READWRITE)); // CHECKME!
gst_element_add_pad (GST_ELEMENT (fakesrc), pad);
fakesrc->srcpads = g_slist_append (NULL, pad);
- fakesrc->loop_based = TRUE;
+ fakesrc->loop_based = FALSE;
if (fakesrc->loop_based)
gst_element_set_loop_function (GST_ELEMENT (fakesrc), GST_DEBUG_FUNCPTR (gst_fakesrc_loop));
GST_BUFFER_TIMESTAMP (buf) = src->buffer_count++;
if (!src->silent)
- g_print("fakesrc: get ******* (%s:%s)> (%d bytes, %llu) \n",
+ g_print("fakesrc: get ******* (%s:%s)> (%d bytes, %llu) \n",
GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_signal_emit (G_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF], 0,
GST_BUFFER_TIMESTAMP (buf) = src->buffer_count++;
if (!src->silent)
- g_print("fakesrc: loop ******* (%s:%s) > (%d bytes, %llu) \n",
+ g_print("fakesrc: loop ******* (%s:%s) > (%d bytes, %llu) \n",
GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_signal_emit (G_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF], 0,
ARG_0,
ARG_LOOP_BASED,
ARG_SLEEP_TIME,
+ ARG_DUPLICATE,
ARG_SILENT,
};
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
- g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOOP_BASED,
- g_param_spec_boolean("loop_based","loop_based","loop_based",
- TRUE,G_PARAM_READWRITE)); // CHECKME
- g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SLEEP_TIME,
- g_param_spec_uint("sleep_time","sleep_time","sleep_time",
- 0,G_MAXUINT,0,G_PARAM_READWRITE)); // CHECKME
- g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SILENT,
- g_param_spec_boolean("silent","silent","silent",
- TRUE,G_PARAM_READWRITE)); // CHECKME
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOOP_BASED,
+ g_param_spec_boolean ("loop_based", "loop_based", "loop_based",
+ TRUE, G_PARAM_READWRITE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SLEEP_TIME,
+ g_param_spec_uint ("sleep_time", "sleep_time", "sleep_time",
+ 0, G_MAXUINT, 0, G_PARAM_READWRITE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DUPLICATE,
+ g_param_spec_uint ("duplicate", "duplicate", "duplicate",
+ 0, G_MAXUINT, 1, G_PARAM_READWRITE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SILENT,
+ g_param_spec_boolean ("silent", "silent", "silent",
+ TRUE,G_PARAM_READWRITE));
gst_identity_signals[SIGNAL_HANDOFF] =
g_signal_newc ("handoff", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
identity->loop_based = FALSE;
identity->sleep_time = 0;
+ identity->duplicate = 1;
identity->silent = FALSE;
}
gst_identity_chain (GstPad *pad, GstBuffer *buf)
{
GstIdentity *identity;
+ guint i;
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
identity = GST_IDENTITY (gst_pad_get_parent (pad));
- if (!identity->silent)
- g_print("identity: chain ******* (%s:%s)i (%d bytes, %llu) \n",
+ for (i=identity->duplicate; i; i--) {
+ if (!identity->silent)
+ g_print("identity: chain ******* (%s:%s)i (%d bytes, %llu) \n",
GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
- g_signal_emit (G_OBJECT (identity), gst_identity_signals[SIGNAL_HANDOFF], 0,
+ g_signal_emit (G_OBJECT (identity), gst_identity_signals[SIGNAL_HANDOFF], 0,
buf);
- gst_pad_push (identity->srcpad, buf);
+ if (i>1)
+ gst_buffer_ref (buf);
+
+ gst_pad_push (identity->srcpad, buf);
- if (identity->sleep_time)
- usleep (identity->sleep_time);
+ if (identity->sleep_time)
+ usleep (identity->sleep_time);
+ }
}
static void
{
GstIdentity *identity;
GstBuffer *buf;
+ guint i;
g_return_if_fail (element != NULL);
g_return_if_fail (GST_IS_IDENTITY (element));
do {
buf = gst_pad_pull (identity->sinkpad);
- if (!identity->silent)
- g_print("identity: loop ******* (%s:%s)i (%d bytes, %llu) \n",
+
+ for (i=identity->duplicate; i; i--) {
+ if (!identity->silent)
+ g_print("identity: loop ******* (%s:%s)i (%d bytes, %llu) \n",
GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
- g_signal_emit (G_OBJECT (identity), gst_identity_signals[SIGNAL_HANDOFF], 0,
+ g_signal_emit (G_OBJECT (identity), gst_identity_signals[SIGNAL_HANDOFF], 0,
buf);
- gst_pad_push (identity->srcpad, buf);
+ if (i>1)
+ gst_buffer_ref (buf);
- if (identity->sleep_time)
- usleep (identity->sleep_time);
+ gst_pad_push (identity->srcpad, buf);
+
+ if (identity->sleep_time)
+ usleep (identity->sleep_time);
+ }
} while (!GST_ELEMENT_IS_COTHREAD_STOPPING(element));
}
case ARG_SILENT:
identity->silent = g_value_get_boolean (value);
break;
+ case ARG_DUPLICATE:
+ identity->duplicate = g_value_get_uint (value);
+ break;
default:
break;
}
case ARG_SLEEP_TIME:
g_value_set_uint (value, identity->sleep_time);
break;
+ case ARG_DUPLICATE:
+ g_value_set_uint (value, identity->duplicate);
+ break;
case ARG_SILENT:
g_value_set_boolean (value, identity->silent);
break;
GstPad *srcpad;
gboolean loop_based;
-
+ guint duplicate;
guint sleep_time;
gboolean silent;
};
enum {
ARG_0,
+ ARG_SILENT,
ARG_NUM_PADS,
/* FILL ME */
};
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NUM_PADS,
g_param_spec_int ("num_pads", "num_pads", "num_pads",
0, G_MAXINT, 0, G_PARAM_READABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SILENT,
+ g_param_spec_boolean ("silent", "silent", "silent",
+ FALSE, G_PARAM_READWRITE));
+
+
gobject_class->set_property = GST_DEBUG_FUNCPTR(gst_tee_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR(gst_tee_get_property);
tee->numsrcpads = 0;
tee->srcpads = NULL;
+ tee->silent = FALSE;
}
static GstPad*
tee = GST_TEE (object);
switch (prop_id) {
-// case ARG_NUM_PADS:
-// g_value_set_int (value, tee->numsrcpads);
-// break;
+ case ARG_SILENT:
+ tee->silent = g_value_get_boolean (value);
+ break;
default:
break;
}
case ARG_NUM_PADS:
g_value_set_int (value, tee->numsrcpads);
break;
+ case ARG_SILENT:
+ g_value_set_boolean (value, tee->silent);
+ break;
default:
break;
}
srcpads = tee->srcpads;
while (srcpads) {
- gst_pad_push (GST_PAD (srcpads->data), buf);
+ GstPad *outpad = GST_PAD (srcpads->data);
srcpads = g_slist_next (srcpads);
+
+ if (!tee->silent)
+ g_print("tee: chain ******* (%s:%s)t (%d bytes, %llu) \n",
+ GST_DEBUG_PAD_NAME (outpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
+
+ gst_pad_push (outpad, buf);
}
}
GstPad *sinkpad;
+ gboolean silent;
gint numsrcpads;
GSList *srcpads;
};