libs/gst/base/gstbasesrc.c: Small comment update.

Original commit message from CVS:
* libs/gst/base/gstbasesrc.c: (gst_base_src_perform_seek):
Small comment update.
* plugins/elements/gstidentity.c: (gst_identity_class_init),
(gst_identity_transform_ip):
Drop-probability is broken, mention this in the code with a
FIXME and also in the property description.
Make silent also be silent about the drop messages.
This commit is contained in:
Wim Taymans 2006-08-28 15:48:24 +00:00
parent 16b6310ae8
commit 4016e6c577
3 changed files with 36 additions and 15 deletions

View file

@ -1,3 +1,14 @@
2006-08-28 Wim Taymans <wim@fluendo.com>
* libs/gst/base/gstbasesrc.c: (gst_base_src_perform_seek):
Small comment update.
* plugins/elements/gstidentity.c: (gst_identity_class_init),
(gst_identity_transform_ip):
Drop-probability is broken, mention this in the code with a
FIXME and also in the property description.
Make silent also be silent about the drop messages.
2006-08-28 Tim-Philipp Müller <tim at centricular dot net>
* docs/manual/appendix-win32.xml:

View file

@ -855,6 +855,7 @@ gst_base_src_perform_seek (GstBaseSrc * src, GstEvent * event, gboolean unlock)
GST_DEBUG_OBJECT (src, "closing running segment %" G_GINT64_FORMAT
" to %" G_GINT64_FORMAT, src->segment.start, src->segment.last_stop);
/* queue the segment for sending in the stream thread */
if (src->priv->close_segment)
gst_event_unref (src->priv->close_segment);
src->priv->close_segment =
@ -874,13 +875,16 @@ gst_base_src_perform_seek (GstBaseSrc * src, GstEvent * event, gboolean unlock)
src->segment.format, src->segment.last_stop));
}
/* for deriving a stop position for the playback segment form the seek
* segment, we must take the duration when the stop is not set */
if ((stop = src->segment.stop) == -1)
stop = src->segment.duration;
/* now send the newsegment */
GST_DEBUG_OBJECT (src, "Sending newsegment from %" G_GINT64_FORMAT
" to %" G_GINT64_FORMAT, src->segment.start, stop);
/* now replace the old segment so that we send it in the stream thread the
* next time it is scheduled. */
if (src->priv->start_segment)
gst_event_unref (src->priv->start_segment);
src->priv->start_segment =

View file

@ -182,7 +182,8 @@ gst_identity_class_init (GstIdentityClass * klass)
G_MININT, G_MAXINT, DEFAULT_ERROR_AFTER, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_DROP_PROBABILITY, g_param_spec_float ("drop_probability",
"Drop Probability", "The Probability a buffer is dropped", 0.0, 1.0,
"Drop Probability",
"The Probability a buffer is dropped (not implemented)", 0.0, 1.0,
DEFAULT_DROP_PROBABILITY, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, PROP_DATARATE,
g_param_spec_int ("datarate", "Datarate",
@ -364,19 +365,24 @@ gst_identity_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
if (identity->drop_probability > 0.0) {
if ((gfloat) (1.0 * rand () / (RAND_MAX)) < identity->drop_probability) {
GST_OBJECT_LOCK (identity);
g_free (identity->last_message);
identity->last_message =
g_strdup_printf ("dropping ******* (%s:%s)i (%d bytes, timestamp: %"
GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ", offset: %"
G_GINT64_FORMAT ", offset_end: % " G_GINT64_FORMAT ", flags: %d) %p",
GST_DEBUG_PAD_NAME (trans->sinkpad), GST_BUFFER_SIZE (buf),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)),
GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET_END (buf),
GST_BUFFER_FLAGS (buf), buf);
GST_OBJECT_UNLOCK (identity);
g_object_notify (G_OBJECT (identity), "last-message");
if (!identity->silent) {
GST_OBJECT_LOCK (identity);
g_free (identity->last_message);
identity->last_message =
g_strdup_printf
("dropping ******* (%s:%s)i (%d bytes, timestamp: %"
GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ", offset: %"
G_GINT64_FORMAT ", offset_end: % " G_GINT64_FORMAT
", flags: %d) %p", GST_DEBUG_PAD_NAME (trans->sinkpad),
GST_BUFFER_SIZE (buf), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), GST_BUFFER_OFFSET (buf),
GST_BUFFER_OFFSET_END (buf), GST_BUFFER_FLAGS (buf), buf);
GST_OBJECT_UNLOCK (identity);
g_object_notify (G_OBJECT (identity), "last-message");
}
/* FIXME, this does not drop the buffer in basetransform. Actually
* dropping the buffer in transform_ip is not possible without a new
* custom GstFlowReturn value. */
return GST_FLOW_OK;
}
}