Rename the _full versions of the functions to the normal function names.
/**
* gst_event_new_new_segment:
- * @update: is this segment an update to a previous one
- * @rate: a new rate for playback
- * @format: The format of the segment values
- * @start: the start value of the segment
- * @stop: the stop value of the segment
- * @time: the time value of the segment
- *
- * Allocate a new newsegment event with the given format/values tripplets
- *
- * This method calls gst_event_new_new_segment_full() passing a default
- * value of 1.0 for applied_rate
- *
- * Returns: (transfer full): a new newsegment event.
- */
-GstEvent *
-gst_event_new_new_segment (gboolean update, gdouble rate, GstFormat format,
- gint64 start, gint64 stop, gint64 time)
-{
- return gst_event_new_new_segment_full (update, rate, 1.0, format, start,
- stop, time);
-}
-
-/**
- * gst_event_parse_new_segment:
- * @event: The event to query
- * @update: (out): A pointer to the update flag of the segment
- * @rate: (out): A pointer to the rate of the segment
- * @format: (out): A pointer to the format of the newsegment values
- * @start: (out): A pointer to store the start value in
- * @stop: (out): A pointer to store the stop value in
- * @time: (out): A pointer to store the time value in
- *
- * Get the update flag, rate, format, start, stop and time in the
- * newsegment event. In general, gst_event_parse_new_segment_full() should
- * be used instead of this, to also retrieve the applied_rate value of the
- * segment. See gst_event_new_new_segment_full() for a full description
- * of the newsegment event.
- */
-void
-gst_event_parse_new_segment (GstEvent * event, gboolean * update,
- gdouble * rate, GstFormat * format, gint64 * start,
- gint64 * stop, gint64 * time)
-{
- gst_event_parse_new_segment_full (event, update, rate, NULL, format, start,
- stop, time);
-}
-
-/**
- * gst_event_new_new_segment_full:
* @update: Whether this segment is an update to a previous one
* @rate: A new rate for playback
* @applied_rate: The rate factor which has already been applied
* Since: 0.10.6
*/
GstEvent *
-gst_event_new_new_segment_full (gboolean update, gdouble rate,
+gst_event_new_new_segment (gboolean update, gdouble rate,
gdouble applied_rate, GstFormat format, gint64 start, gint64 stop,
gint64 time)
{
}
/**
- * gst_event_parse_new_segment_full:
+ * gst_event_parse_new_segment:
* @event: The event to query
* @update: (out): A pointer to the update flag of the segment
* @rate: (out): A pointer to the rate of the segment
* @time: (out): A pointer to store the time value in
*
* Get the update, rate, applied_rate, format, start, stop and
- * time in the newsegment event. See gst_event_new_new_segment_full()
+ * time in the newsegment event. See gst_event_new_new_segment()
* for a full description of the newsegment event.
*
* Since: 0.10.6
*/
void
-gst_event_parse_new_segment_full (GstEvent * event, gboolean * update,
+gst_event_parse_new_segment (GstEvent * event, gboolean * update,
gdouble * rate, gdouble * applied_rate, GstFormat * format,
gint64 * start, gint64 * stop, gint64 * time)
{
/* newsegment events */
GstEvent* gst_event_new_new_segment (gboolean update, gdouble rate,
- GstFormat format,
- gint64 start, gint64 stop,
- gint64 time);
-GstEvent* gst_event_new_new_segment_full (gboolean update, gdouble rate,
gdouble applied_rate,
GstFormat format,
gint64 start, gint64 stop,
void gst_event_parse_new_segment (GstEvent *event,
gboolean *update,
gdouble *rate,
- GstFormat *format,
- gint64 *start, gint64 *stop,
- gint64 *time);
-void gst_event_parse_new_segment_full (GstEvent *event,
- gboolean *update,
- gdouble *rate,
gdouble *applied_rate,
GstFormat *format,
gint64 *start, gint64 *stop,
* @segment: a #GstSegment structure.
* @update: flag indicating a new segment is started or updated
* @rate: the rate of the segment.
- * @format: the format of the segment.
- * @start: the new start value
- * @stop: the new stop value
- * @time: the new stream time
- *
- * Update the segment structure with the field values of a new segment event and
- * with a default applied_rate of 1.0.
- *
- * Since: 0.10.6
- */
-void
-gst_segment_set_newsegment (GstSegment * segment, gboolean update, gdouble rate,
- GstFormat format, gint64 start, gint64 stop, gint64 time)
-{
- gst_segment_set_newsegment_full (segment, update, rate, 1.0, format, start,
- stop, time);
-}
-
-/**
- * gst_segment_set_newsegment_full:
- * @segment: a #GstSegment structure.
- * @update: flag indicating a new segment is started or updated
- * @rate: the rate of the segment.
* @applied_rate: the applied rate of the segment.
* @format: the format of the segment.
* @start: the new start value
* Update the segment structure with the field values of a new segment event.
*/
void
-gst_segment_set_newsegment_full (GstSegment * segment, gboolean update,
+gst_segment_set_newsegment (GstSegment * segment, gboolean update,
gdouble rate, gdouble applied_rate, GstFormat format, gint64 start,
gint64 stop, gint64 time)
{
/**
* GstSegment:
* @rate: the rate of the segment
+ * @applied_rate: the already applied rate to the segment
* @format: the format of the segment values
* @flags: flags for this segment
* @start: the start of the segment
* @accum: accumulated segment
* @last_stop: last known stop time
* @duration: total duration of segment
- * @applied_rate: the already applied rate to the segment
*
* A helper structure that holds the configured region of
* interest in a media file.
gboolean *update);
void gst_segment_set_newsegment (GstSegment *segment, gboolean update, gdouble rate,
- GstFormat format, gint64 start, gint64 stop, gint64 time);
-void gst_segment_set_newsegment_full (GstSegment *segment, gboolean update, gdouble rate,
gdouble applied_rate, GstFormat format, gint64 start,
gint64 stop, gint64 time);
gint64 start, stop, pos, next_ts, offset = 0;
gboolean update;
- gst_event_parse_new_segment_full (event, &update, &rate, &applied_rate,
+ gst_event_parse_new_segment (event, &update, &rate, &applied_rate,
&format, &start, &stop, &pos);
GST_DEBUG_OBJECT (parse, "newseg rate %g, applied rate %g, "
}
gst_event_unref (event);
- event = gst_event_new_new_segment_full (update, rate, applied_rate,
+ event = gst_event_new_new_segment (update, rate, applied_rate,
GST_FORMAT_TIME, seg_start, seg_stop, seg_start);
format = GST_FORMAT_TIME;
start = seg_start;
/* Unknown incoming segment format. Output a default open-ended
* TIME segment */
gst_event_unref (event);
- event = gst_event_new_new_segment_full (update, rate, applied_rate,
+ event = gst_event_new_new_segment (update, rate, applied_rate,
GST_FORMAT_TIME, 0, GST_CLOCK_TIME_NONE, 0);
format = GST_FORMAT_TIME;
next_ts = start = 0;
next_ts = start;
}
- gst_segment_set_newsegment_full (&parse->segment, update, rate,
+ gst_segment_set_newsegment (&parse->segment, update, rate,
applied_rate, format, start, stop, start);
/* save the segment for later, right before we push a new buffer so that
GST_TIME_ARGS (parse->segment.start));
parse->priv->pending_segment =
gst_event_new_new_segment (FALSE, parse->segment.rate,
+ parse->segment.applied_rate,
parse->segment.format, parse->segment.start,
parse->segment.stop, parse->segment.start);
}
parse->segment.start = last_start;
parse->priv->pending_segment =
gst_event_new_new_segment (FALSE, parse->segment.rate,
+ parse->segment.applied_rate,
parse->segment.format, parse->segment.start,
parse->segment.stop, parse->segment.start);
} else {
/* close ahead of gap */
gst_pad_push_event (parse->srcpad,
gst_event_new_new_segment (TRUE, parse->segment.rate,
+ parse->segment.applied_rate,
parse->segment.format, parse->segment.last_stop,
parse->segment.last_stop, parse->segment.last_stop));
/* skip gap */
gst_pad_push_event (parse->srcpad,
gst_event_new_new_segment (FALSE, parse->segment.rate,
+ parse->segment.applied_rate,
parse->segment.format, last_start,
parse->segment.stop, last_start));
}
/* align segment view with downstream,
* prevents double-counting accum when closing segment */
gst_segment_set_newsegment (&parse->segment, FALSE,
- parse->segment.rate, parse->segment.format, last_start,
- parse->segment.stop, last_start);
+ parse->segment.rate, parse->segment.applied_rate,
+ parse->segment.format, last_start, parse->segment.stop, last_start);
parse->segment.last_stop = last_start;
}
}
if (result) {
if (active) {
parse->priv->pending_segment = gst_event_new_new_segment (FALSE,
- parse->segment.rate, parse->segment.format,
- parse->segment.start, parse->segment.stop, parse->segment.last_stop);
+ parse->segment.rate, parse->segment.applied_rate,
+ parse->segment.format, parse->segment.start, parse->segment.stop,
+ parse->segment.last_stop);
result &=
gst_pad_start_task (sinkpad, (GstTaskFunction) gst_base_parse_loop,
sinkpad);
gst_event_unref (parse->priv->close_segment);
parse->priv->close_segment = gst_event_new_new_segment (TRUE,
- parse->segment.rate, parse->segment.format,
- parse->segment.accum, parse->segment.last_stop, parse->segment.accum);
+ parse->segment.rate, parse->segment.applied_rate,
+ parse->segment.format, parse->segment.accum, parse->segment.last_stop,
+ parse->segment.accum);
/* keep track of our last_stop */
seeksegment.accum = parse->segment.last_stop;
/* This will be sent later in _loop() */
parse->priv->pending_segment =
gst_event_new_new_segment (FALSE, parse->segment.rate,
+ parse->segment.applied_rate,
parse->segment.format, parse->segment.start,
parse->segment.stop, parse->segment.start);
/* the newsegment event is needed to bring the buffer timestamps to the
* stream time and to drop samples outside of the playback segment. */
- gst_event_parse_new_segment_full (event, &update, &rate, &arate, &format,
+ gst_event_parse_new_segment (event, &update, &rate, &arate, &format,
&start, &stop, &time);
/* The segment is protected with both the STREAM_LOCK and the OBJECT_LOCK.
* We protect with the OBJECT_LOCK so that we can use the values to
* safely answer a POSITION query. */
GST_OBJECT_LOCK (basesink);
- gst_segment_set_newsegment_full (segment, update, rate, arate, format, start,
+ gst_segment_set_newsegment (segment, update, rate, arate, format, start,
stop, time);
if (format == GST_FORMAT_TIME) {
if (G_UNLIKELY (basesink->flushing))
goto flushing;
- gst_event_parse_new_segment_full (event, &update, NULL, NULL, NULL, NULL,
+ gst_event_parse_new_segment (event, &update, NULL, NULL, NULL, NULL,
NULL, NULL);
if (G_UNLIKELY (basesink->priv->received_eos && !update)) {
if (src->priv->close_segment)
gst_event_unref (src->priv->close_segment);
src->priv->close_segment =
- gst_event_new_new_segment_full (TRUE,
+ gst_event_new_new_segment (TRUE,
src->segment.rate, src->segment.applied_rate, src->segment.format,
src->segment.start, src->segment.last_stop, src->segment.time);
}
- gst_segment_set_newsegment_full (&src->segment, FALSE, src->segment.rate,
+ gst_segment_set_newsegment (&src->segment, FALSE, src->segment.rate,
src->segment.applied_rate, src->segment.format, start, stop, position);
if (src->priv->start_segment)
if (src->segment.rate >= 0.0) {
/* forward, we send data from last_stop to stop */
src->priv->start_segment =
- gst_event_new_new_segment_full (FALSE,
+ gst_event_new_new_segment (FALSE,
src->segment.rate, src->segment.applied_rate, src->segment.format,
src->segment.last_stop, stop, src->segment.time);
} else {
/* reverse, we send data from last_stop to start */
src->priv->start_segment =
- gst_event_new_new_segment_full (FALSE,
+ gst_event_new_new_segment (FALSE,
src->segment.rate, src->segment.applied_rate, src->segment.format,
src->segment.start, src->segment.last_stop, src->segment.time);
}
if (src->priv->close_segment)
gst_event_unref (src->priv->close_segment);
src->priv->close_segment =
- gst_event_new_new_segment_full (TRUE,
+ gst_event_new_new_segment (TRUE,
src->segment.rate, src->segment.applied_rate, src->segment.format,
src->segment.start, src->segment.last_stop, src->segment.time);
gst_event_set_seqnum (src->priv->close_segment, seqnum);
if (seeksegment.rate >= 0.0) {
/* forward, we send data from last_stop to stop */
src->priv->start_segment =
- gst_event_new_new_segment_full (FALSE,
+ gst_event_new_new_segment (FALSE,
seeksegment.rate, seeksegment.applied_rate, seeksegment.format,
seeksegment.last_stop, stop, seeksegment.time);
} else {
/* reverse, we send data from last_stop to start */
src->priv->start_segment =
- gst_event_new_new_segment_full (FALSE,
+ gst_event_new_new_segment (FALSE,
seeksegment.rate, seeksegment.applied_rate, seeksegment.format,
seeksegment.start, seeksegment.last_stop, seeksegment.time);
}
gint64 start, stop, time;
gboolean update;
- gst_event_parse_new_segment_full (event, &update, &rate, &arate, &format,
+ gst_event_parse_new_segment (event, &update, &rate, &arate, &format,
&start, &stop, &time);
trans->have_newsegment = TRUE;
- gst_segment_set_newsegment_full (&trans->segment, update, rate, arate,
+ gst_segment_set_newsegment (&trans->segment, update, rate, arate,
format, start, stop, time);
if (format == GST_FORMAT_TIME) {
GstFormat format;
gboolean update;
- gst_event_parse_new_segment_full (event, &update, &rate, &arate, &format,
+ gst_event_parse_new_segment (event, &update, &rate, &arate, &format,
&start, &stop, &time);
GST_DEBUG_OBJECT (data->pad, "got newsegment, start %" GST_TIME_FORMAT
", stop %" GST_TIME_FORMAT, GST_TIME_ARGS (start),
GST_TIME_ARGS (stop));
- gst_segment_set_newsegment_full (&data->segment, update, rate, arate,
+ gst_segment_set_newsegment (&data->segment, update, rate, arate,
format, start, stop, time);
data->abidata.ABI.new_segment = TRUE;
{
gint64 start, stop, pos;
GstFormat format;
- gst_event_parse_new_segment (event, NULL, NULL, &format, &start,
+ gst_event_parse_new_segment (event, NULL, NULL, NULL, &format, &start,
&stop, &pos);
if (format == GST_FORMAT_BYTES) {
gint64 start, stop, pos;
GstFormat format;
- gst_event_parse_new_segment (event, NULL, NULL, &format, &start,
+ gst_event_parse_new_segment (event, NULL, NULL, NULL, &format, &start,
&stop, &pos);
if (format == GST_FORMAT_BYTES) {
if (fpad->segment.format == GST_FORMAT_UNDEFINED) {
GST_WARNING_OBJECT (funnel, "Got buffer without segment,"
" setting segment [0,inf[");
- gst_segment_set_newsegment_full (&fpad->segment, FALSE, 1.0, 1.0,
+ gst_segment_set_newsegment (&fpad->segment, FALSE, 1.0, 1.0,
GST_FORMAT_TIME, 0, -1, 0);
}
}
if (!funnel->has_segment) {
- event = gst_event_new_new_segment_full (FALSE, 1.0, 1.0, GST_FORMAT_TIME,
+ event = gst_event_new_new_segment (FALSE, 1.0, 1.0, GST_FORMAT_TIME,
0, -1, 0);
funnel->has_segment = TRUE;
}
gint64 stop;
gint64 time;
- gst_event_parse_new_segment_full (event, &update, &rate, &arate,
+ gst_event_parse_new_segment (event, &update, &rate, &arate,
&format, &start, &stop, &time);
GST_OBJECT_LOCK (funnel);
- gst_segment_set_newsegment_full (&fpad->segment, update, rate, arate,
+ gst_segment_set_newsegment (&fpad->segment, update, rate, arate,
format, start, stop, time);
GST_OBJECT_UNLOCK (funnel);
GstEvent *news;
GstFormat format;
- gst_event_parse_new_segment (event, NULL, NULL, &format, NULL, NULL,
+ gst_event_parse_new_segment (event, NULL, NULL, NULL, &format, NULL, NULL,
NULL);
/* This is the first newsegment, send out a (0, -1) newsegment */
- news = gst_event_new_new_segment (TRUE, 1.0, format, 0, -1, 0);
+ news = gst_event_new_new_segment (TRUE, 1.0, 1.0, format, 0, -1, 0);
gst_pad_event_default (trans->sinkpad, news);
}
gdouble rate, arate;
gint64 start, stop, time;
- gst_event_parse_new_segment_full (event, &update, &rate, &arate, &format,
+ gst_event_parse_new_segment (event, &update, &rate, &arate, &format,
&start, &stop, &time);
GST_DEBUG_OBJECT (pad,
GST_INPUT_SELECTOR_LOCK (sel);
GST_OBJECT_LOCK (selpad);
- gst_segment_set_newsegment_full (&selpad->segment, update,
+ gst_segment_set_newsegment (&selpad->segment, update,
rate, arate, format, start, stop, time);
GST_OBJECT_UNLOCK (selpad);
cseg->start, cseg->stop, cseg->time);
/* create update segment */
- close_event = gst_event_new_new_segment_full (TRUE, cseg->rate,
+ close_event = gst_event_new_new_segment (TRUE, cseg->rate,
cseg->applied_rate, cseg->format, cseg->start, cseg->stop, cseg->time);
sel->pending_close = FALSE;
G_GINT64_FORMAT, FALSE, seg->rate, seg->applied_rate, seg->format,
seg->start, seg->stop, seg->time);
- start_event = gst_event_new_new_segment_full (FALSE, seg->rate,
+ start_event = gst_event_new_new_segment (FALSE, seg->rate,
seg->applied_rate, seg->format, seg->start, seg->stop, seg->time);
selpad->segment_pending = FALSE;
gdouble rate, arate;
gint64 start, stop, time;
- gst_event_parse_new_segment_full (event, &update, &rate, &arate,
+ gst_event_parse_new_segment (event, &update, &rate, &arate,
&format, &start, &stop, &time);
/* now configure the values, we use these to track timestamps on the
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
- gst_segment_set_newsegment_full (segment, update,
+ gst_segment_set_newsegment (segment, update,
rate, arate, format, start, stop, time);
if (segment == &sq->sink_segment)
} else {
start = position = seg->last_stop;
}
- ev = gst_event_new_new_segment (TRUE, seg->rate,
+ ev = gst_event_new_new_segment (TRUE, seg->rate, seg->applied_rate,
seg->format, start, seg->stop, position);
if (!gst_pad_push_event (osel->active_srcpad, ev)) {
GST_WARNING_OBJECT (osel,
gdouble rate, arate;
gint64 start, stop, time;
- gst_event_parse_new_segment_full (event, &update, &rate, &arate, &format,
+ gst_event_parse_new_segment (event, &update, &rate, &arate, &format,
&start, &stop, &time);
GST_DEBUG_OBJECT (sel,
"format %d, " "%" G_GINT64_FORMAT " -- %" G_GINT64_FORMAT ", time %"
G_GINT64_FORMAT, update, rate, arate, format, start, stop, time);
- gst_segment_set_newsegment_full (&sel->segment, update,
+ gst_segment_set_newsegment (&sel->segment, update,
rate, arate, format, start, stop, time);
/* Send newsegment to all src pads */
gdouble rate, arate;
gint64 start, stop, time;
- gst_event_parse_new_segment_full (event, &update, &rate, &arate,
+ gst_event_parse_new_segment (event, &update, &rate, &arate,
&format, &start, &stop, &time);
/* now configure the values, we use these to track timestamps on the
stop = -1;
time = 0;
}
- gst_segment_set_newsegment_full (segment, update,
+ gst_segment_set_newsegment (segment, update,
rate, arate, format, start, stop, time);
if (sink)
s = &queue->src_segment;
if (s->accum != 0) {
- event = gst_event_new_new_segment_full (FALSE, 1.0, 1.0, s->format, 0,
+ event = gst_event_new_new_segment (FALSE, 1.0, 1.0, s->format, 0,
s->accum, 0);
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"pushing accum newsegment event");
gst_pad_push_event (queue->srcpad, event);
}
- event = gst_event_new_new_segment_full (FALSE, s->rate, s->applied_rate,
+ event = gst_event_new_new_segment (FALSE, s->rate, s->applied_rate,
s->format, s->start, s->stop, s->time);
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "pushing real newsegment event");
gst_pad_push_event (queue->srcpad, event);
gdouble rate, arate;
gint64 start, stop, time;
- gst_event_parse_new_segment_full (event, &update, &rate, &arate,
+ gst_event_parse_new_segment (event, &update, &rate, &arate,
&format, &start, &stop, &time);
GST_DEBUG_OBJECT (queue,
stop = -1;
time = 0;
}
- gst_segment_set_newsegment_full (segment, update,
+ gst_segment_set_newsegment (segment, update,
rate, arate, format, start, stop, time);
GST_DEBUG_OBJECT (queue,
GST_DEBUG ("sending segment");
segment = gst_event_new_new_segment (FALSE,
- 1.0, GST_FORMAT_TIME, 1 * GST_SECOND, 5 * GST_SECOND, 1 * GST_SECOND);
+ 1.0, 1.0, GST_FORMAT_TIME, 1 * GST_SECOND, 5 * GST_SECOND,
+ 1 * GST_SECOND);
eret = gst_pad_send_event (sinkpad, segment);
fail_if (eret == FALSE);
GST_DEBUG ("sending segment");
segment = gst_event_new_new_segment (FALSE,
- 1.0, GST_FORMAT_TIME, 0 * GST_SECOND, 102 * GST_SECOND, 0 * GST_SECOND);
+ 1.0, 1.0, GST_FORMAT_TIME, 0 * GST_SECOND, 102 * GST_SECOND,
+ 0 * GST_SECOND);
eret = gst_pad_send_event (sinkpad, segment);
fail_if (eret == FALSE);
GST_DEBUG ("sending segment");
segment = gst_event_new_new_segment (FALSE,
- 1.0, GST_FORMAT_TIME, 0 * GST_SECOND, 2 * GST_SECOND, 0 * GST_SECOND);
+ 1.0, 1.0, GST_FORMAT_TIME, 0 * GST_SECOND, 2 * GST_SECOND,
+ 0 * GST_SECOND);
eret = gst_pad_send_event (sinkpad, segment);
fail_if (eret == TRUE);
GST_DEBUG ("sending segment");
segment = gst_event_new_new_segment (FALSE,
- 1.0, GST_FORMAT_TIME, 0 * GST_SECOND, 2 * GST_SECOND, 0 * GST_SECOND);
+ 1.0, 1.0, GST_FORMAT_TIME, 0 * GST_SECOND, 2 * GST_SECOND,
+ 0 * GST_SECOND);
eret = gst_pad_send_event (sinkpad, segment);
fail_unless (eret == TRUE);
GST_DEBUG ("sending segment");
segment = gst_event_new_new_segment (FALSE,
- 1.0, GST_FORMAT_TIME, 0 * GST_SECOND, 2 * GST_SECOND, 0 * GST_SECOND);
+ 1.0, 1.0, GST_FORMAT_TIME, 0 * GST_SECOND, 2 * GST_SECOND,
+ 0 * GST_SECOND);
eret = gst_pad_send_event (sinkpad, segment);
fail_if (eret == FALSE);
{
GST_DEBUG ("sending segment");
event = gst_event_new_new_segment (FALSE,
- 1.0, GST_FORMAT_TIME, 1 * GST_SECOND, 3 * GST_SECOND, 1 * GST_SECOND);
+ 1.0, 1.0, GST_FORMAT_TIME, 1 * GST_SECOND, 3 * GST_SECOND,
+ 1 * GST_SECOND);
eret = gst_pad_send_event (sinkpad, event);
fail_if (eret == FALSE);
{
GST_DEBUG ("sending segment");
event = gst_event_new_new_segment (FALSE,
- 1.0, GST_FORMAT_TIME, 2 * GST_SECOND, 4 * GST_SECOND, 1 * GST_SECOND);
+ 1.0, 1.0, GST_FORMAT_TIME, 2 * GST_SECOND, 4 * GST_SECOND,
+ 1 * GST_SECOND);
eret = gst_pad_send_event (sinkpad, event);
fail_if (eret == FALSE);
{
GST_DEBUG ("sending segment");
event = gst_event_new_new_segment (FALSE,
- 1.0, GST_FORMAT_TIME, 2 * GST_SECOND, 4 * GST_SECOND, 1 * GST_SECOND);
+ 1.0, 1.0, GST_FORMAT_TIME, 2 * GST_SECOND, 4 * GST_SECOND,
+ 1 * GST_SECOND);
eret = gst_pad_send_event (sinkpad, event);
fail_if (eret == FALSE);
#endif
fail_unless (gst_pad_push_event (mysrcpad,
- gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_BYTES, 0, -1, 0)));
+ gst_event_new_new_segment (FALSE, 1.0, 1.0, GST_FORMAT_BYTES, 0, -1,
+ 0)));
CHECK_QUERY_POSITION (filesink, GST_FORMAT_BYTES, 0);
CHECK_QUERY_POSITION (filesink, GST_FORMAT_BYTES, 8900);
if (gst_pad_push_event (mysrcpad,
- gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_BYTES, 8800, -1,
+ gst_event_new_new_segment (TRUE, 1.0, 1.0, GST_FORMAT_BYTES, 8800, -1,
0))) {
GST_LOG ("seek ok");
/* make sure that that new position is reported immediately */
gst_element_set_state (pipe, GST_STATE_PLAYING);
/* Push 2 new segment events */
- event = gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME, 0, -1, 0);
+ event =
+ gst_event_new_new_segment (FALSE, 1.0, 1.0, GST_FORMAT_TIME, 0, -1, 0);
gst_pad_push_event (inputpads[0], gst_event_ref (event));
gst_pad_push_event (inputpads[1], event);
g_static_mutex_unlock (&_check_lock);
/* Push a new segment update on the 2nd pad */
- event = gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_TIME, ts, -1, ts);
+ event =
+ gst_event_new_new_segment (TRUE, 1.0, 1.0, GST_FORMAT_TIME, ts, -1, ts);
gst_pad_push_event (inputpads[1], event);
}
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
- event = gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_TIME,
+ event = gst_event_new_new_segment (TRUE, 1.0, 1.0, GST_FORMAT_TIME,
1 * GST_SECOND, 5 * GST_SECOND, 0);
gst_pad_push_event (mysrcpad, event);
g_object_get (G_OBJECT (queue), "current-level-time", &time, NULL);
fail_if (time != 0 * GST_SECOND);
- event = gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME,
+ event = gst_event_new_new_segment (FALSE, 1.0, 1.0, GST_FORMAT_TIME,
1 * GST_SECOND, 5 * GST_SECOND, 0);
gst_pad_push_event (mysrcpad, event);
GstFormat format, gint64 start, gint64 stop, gint64 position)
{
gboolean ns_update;
- gdouble ns_rate;
+ gdouble ns_rate, ns_arate;
GstFormat ns_format;
gint64 ns_start;
gint64 ns_stop;
return FALSE;
}
- gst_event_parse_new_segment (event, &ns_update, &ns_rate, &ns_format,
- &ns_start, &ns_stop, &ns_position);
+ gst_event_parse_new_segment (event, &ns_update, &ns_rate, &ns_arate,
+ &ns_format, &ns_start, &ns_stop, &ns_position);
GST_DEBUG ("update %d, rate %lf, format %s, start %" GST_TIME_FORMAT
", stop %" GST_TIME_FORMAT ", position %" GST_TIME_FORMAT, ns_update,
fail_unless (overrun_count == 0);
fail_unless (underrun_count == 0);
- event = gst_event_new_new_segment (FALSE, 2.0, GST_FORMAT_TIME, 0,
+ event = gst_event_new_new_segment (FALSE, 2.0, 1.0, GST_FORMAT_TIME, 0,
2 * GST_SECOND, 0);
gst_pad_push_event (mysrcpad, event);
fail_unless (overrun_count == 0);
fail_unless (underrun_count == 0);
- event = gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME, 0,
+ event = gst_event_new_new_segment (FALSE, 1.0, 1.0, GST_FORMAT_TIME, 0,
3 * GST_SECOND, 0);
gst_pad_push_event (mysrcpad, event);
fail_unless (overrun_count == 0);
fail_unless (underrun_count == 0);
- event = gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME,
+ event = gst_event_new_new_segment (FALSE, 1.0, 1.0, GST_FORMAT_TIME,
4 * GST_SECOND, 5 * GST_SECOND, 4 * GST_SECOND);
gst_pad_push_event (mysrcpad, event);
/* make newsegment, this sets the position to 10sec when the buffer prerolls */
GST_DEBUG ("sending segment");
event =
- gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME, 0, -1,
+ gst_event_new_new_segment (FALSE, 1.0, 1.0, GST_FORMAT_TIME, 0, -1,
10 * GST_SECOND);
res = gst_pad_send_event (sinkpad, event);
/* make newsegment, this sets the position to 10sec when the buffer prerolls */
GST_DEBUG ("sending segment");
event =
- gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME, 0, -1,
+ gst_event_new_new_segment (FALSE, 1.0, 1.0, GST_FORMAT_TIME, 0, -1,
10 * GST_SECOND);
res = gst_pad_send_event (sinkpad, event);
gboolean update;
event =
- gst_event_new_new_segment (FALSE, 0.5, GST_FORMAT_TIME, 1, G_MAXINT64,
- 0xdeadbeef);
+ gst_event_new_new_segment (FALSE, 0.5, 1.0, GST_FORMAT_TIME, 1,
+ G_MAXINT64, 0xdeadbeef);
fail_if (event == NULL);
fail_unless (GST_EVENT_TYPE (event) == GST_EVENT_NEWSEGMENT);
fail_if (GST_EVENT_IS_UPSTREAM (event));
fail_unless (GST_EVENT_IS_DOWNSTREAM (event));
fail_unless (GST_EVENT_IS_SERIALIZED (event));
- gst_event_parse_new_segment (event, &update, &rate, &format, &start, &end,
- &base);
+ gst_event_parse_new_segment (event, &update, &rate, &applied_rate, &format,
+ &start, &end, &base);
fail_unless (update == FALSE);
fail_unless (rate == 0.5);
+ fail_unless (applied_rate == 1.0);
fail_unless (format == GST_FORMAT_TIME);
fail_unless (start == 1);
fail_unless (end == G_MAXINT64);
fail_unless (base == 0xdeadbeef);
/* Check that the new segment was created with applied_rate of 1.0 */
- gst_event_parse_new_segment_full (event, &update, &rate, &applied_rate,
+ gst_event_parse_new_segment (event, &update, &rate, &applied_rate,
&format, &start, &end, &base);
fail_unless (update == FALSE);
gst_event_unref (event);
event =
- gst_event_new_new_segment_full (TRUE, 0.75, 0.5, GST_FORMAT_BYTES, 0,
+ gst_event_new_new_segment (TRUE, 0.75, 0.5, GST_FORMAT_BYTES, 0,
G_MAXINT64 - 1, 0xdeadbeef);
fail_if (event == NULL);
fail_unless (GST_EVENT_IS_DOWNSTREAM (event));
fail_unless (GST_EVENT_IS_SERIALIZED (event));
- gst_event_parse_new_segment_full (event, &update, &rate, &applied_rate,
+ gst_event_parse_new_segment (event, &update, &rate, &applied_rate,
&format, &start, &end, &base);
fail_unless (update == TRUE);
gst_segment_init (&segment, GST_FORMAT_TIME);
- gst_segment_set_newsegment_full (&segment, FALSE, 1.0, 2.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 2.0,
GST_FORMAT_TIME, 0, 5 * 60 * GST_SECOND, 0);
segment.last_stop = 2 * GST_SECOND;
gst_segment_init (&segment, GST_FORMAT_BYTES);
- gst_segment_set_newsegment_full (&segment, FALSE, 1.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 1.0,
GST_FORMAT_BYTES, 0, 9999999, 0);
GST_LOG ("BYTE: %" GST_SEGMENT_FORMAT, &segment);
gst_segment_init (&segment, 98765432);
- gst_segment_set_newsegment_full (&segment, FALSE, 1.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 1.0,
GST_FORMAT_BYTES, 0, 987654321, 0);
GST_LOG ("UNKNOWN: %" GST_SEGMENT_FORMAT, &segment);
gst_segment_init (&segment, GST_FORMAT_BYTES);
/* time should also work for starting from 0 */
- gst_segment_set_newsegment (&segment, FALSE, 1.0, GST_FORMAT_TIME, 0, -1, 0);
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 1.0, GST_FORMAT_TIME, 0, -1,
+ 0);
fail_unless (segment.rate == 1.0);
fail_unless (segment.format == GST_FORMAT_BYTES);
fail_unless (segment.duration == -1);
/* we set stop but in the wrong format, stop stays open. */
- gst_segment_set_newsegment (&segment, FALSE, 1.0, GST_FORMAT_TIME, 0, 200, 0);
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 1.0, GST_FORMAT_TIME, 0,
+ 200, 0);
fail_unless (segment.start == 0);
fail_unless (segment.stop == -1);
fail_unless (segment.last_stop == 0);
/* update, nothing changes */
- gst_segment_set_newsegment (&segment, TRUE, 1.0, GST_FORMAT_BYTES, 0, -1, 0);
+ gst_segment_set_newsegment (&segment, TRUE, 1.0, 1.0, GST_FORMAT_BYTES, 0, -1,
+ 0);
fail_unless (segment.start == 0);
fail_unless (segment.stop == -1);
fail_unless (segment.last_stop == 0);
/* update */
- gst_segment_set_newsegment (&segment, TRUE, 1.0,
+ gst_segment_set_newsegment (&segment, TRUE, 1.0, 1.0,
GST_FORMAT_BYTES, 100, -1, 100);
fail_unless (segment.start == 100);
fail_unless (segment.last_stop == 100);
/* last_stop 0, accum does not change */
- gst_segment_set_newsegment (&segment, FALSE, 1.0, GST_FORMAT_BYTES, 0, -1, 0);
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 1.0, GST_FORMAT_BYTES, 0,
+ -1, 0);
fail_unless (segment.start == 0);
fail_unless (segment.stop == -1);
fail_unless (segment.last_stop == 200);
/* last_stop 200, accum changes */
- gst_segment_set_newsegment (&segment, FALSE, 1.0, GST_FORMAT_BYTES, 0, -1, 0);
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 1.0, GST_FORMAT_BYTES, 0,
+ -1, 0);
fail_unless (segment.start == 0);
fail_unless (segment.stop == -1);
gst_segment_init (&segment, GST_FORMAT_BYTES);
- gst_segment_set_newsegment (&segment, FALSE, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 1.0,
GST_FORMAT_BYTES, 0, 200, 0);
fail_unless (segment.rate == 1.0);
fail_unless (segment.last_stop == 40);
/* do an update to the start, last_stop is unchanged because it's bigger */
- gst_segment_set_newsegment (&segment, TRUE, 1.0, GST_FORMAT_BYTES, 20, 200,
- 20);
+ gst_segment_set_newsegment (&segment, TRUE, 1.0, 1.0, GST_FORMAT_BYTES, 20,
+ 200, 20);
fail_unless (segment.start == 20);
fail_unless (segment.stop == 200);
fail_unless (segment.last_stop == 40);
/* do an update past our last_stop, it should be updated now */
- gst_segment_set_newsegment (&segment, TRUE, 1.0, GST_FORMAT_BYTES, 50, 300,
- 50);
+ gst_segment_set_newsegment (&segment, TRUE, 1.0, 1.0, GST_FORMAT_BYTES, 50,
+ 300, 50);
fail_unless (segment.start == 50);
fail_unless (segment.stop == 300);
fail_unless (segment.last_stop == 50);
/* and a new accumulated one */
- gst_segment_set_newsegment (&segment, FALSE, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 1.0,
GST_FORMAT_BYTES, 100, 400, 300);
fail_unless (segment.start == 100);
fail_unless (segment.accum == 300);
/* and a new updated one */
- gst_segment_set_newsegment (&segment, TRUE, 1.0,
+ gst_segment_set_newsegment (&segment, TRUE, 1.0, 1.0,
GST_FORMAT_BYTES, 100, 500, 300);
fail_unless (segment.start == 100);
fail_unless (segment.accum == 300);
/* and a new partially updated one */
- gst_segment_set_newsegment (&segment, TRUE, 1.0,
+ gst_segment_set_newsegment (&segment, TRUE, 1.0, 1.0,
GST_FORMAT_BYTES, 200, 500, 400);
fail_unless (segment.start == 200);
/***************************
* Normal segment
***************************/
- gst_segment_set_newsegment_full (&segment, FALSE, 1.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 1.0,
GST_FORMAT_TIME, 0, 200, 0);
fail_unless (segment.rate == 1.0);
/*********************
* time shifted by 500
*********************/
- gst_segment_set_newsegment_full (&segment, FALSE, 1.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 1.0,
GST_FORMAT_TIME, 0, 200, 500);
fail_unless (segment.accum == 200);
/*********************
* time offset by 500
*********************/
- gst_segment_set_newsegment_full (&segment, FALSE, 1.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 1.0,
GST_FORMAT_TIME, 500, 700, 0);
fail_unless (segment.accum == 400);
/*************************************
* time offset by 500, shifted by 200
*************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, 1.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 1.0,
GST_FORMAT_TIME, 500, 700, 200);
fail_unless (segment.accum == 600);
/***************************
* Normal segment rate 2.0
***************************/
- gst_segment_set_newsegment_full (&segment, FALSE, 2.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 2.0, 1.0,
GST_FORMAT_TIME, 0, 200, 0);
fail_unless (segment.rate == 2.0);
/***************************************
* Normal segment rate 2.0, offset
***************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, 2.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 2.0, 1.0,
GST_FORMAT_TIME, 100, 300, 0);
fail_unless (segment.accum == 100);
/* buffers will arrive from 300 to 100 in a sink, stream time
* calculation is unaffected by the rate */
- gst_segment_set_newsegment_full (&segment, FALSE, -1.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, -1.0, 1.0,
GST_FORMAT_TIME, 100, 300, 0);
fail_unless (segment.accum == 200);
/***********************************************
* Normal segment rate -1.0, offset, time = 200
***********************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, -1.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, -1.0, 1.0,
GST_FORMAT_TIME, 100, 300, 200);
/* invalid time gives invalid result */
* This means the timestamps represents a stream going backwards
* starting from @time to 0.
************************************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, 1.0, -1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, -1.0,
GST_FORMAT_TIME, 0, 200, 200);
fail_unless (segment.rate == 1.0);
* This means the timestamps represents a stream at twice the
* normal rate
************************************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, 1.0, 2.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 2.0,
GST_FORMAT_TIME, 0, 200, 0);
fail_unless (segment.rate == 1.0);
* This means the timestamps represents a stream at twice the
* reverse rate
************************************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, 1.0, -2.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, -2.0,
GST_FORMAT_TIME, 0, 200, 400);
fail_unless (segment.rate == 1.0);
* reverse rate, start time cannot compensate the complete
* duration of the segment so we stop at 0
************************************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, 1.0, -2.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, -2.0,
GST_FORMAT_TIME, 0, 200, 200);
fail_unless (segment.rate == 1.0);
* speed up by a factor of 2.0 some more. the resulting
* stream will be played at four times the speed.
************************************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, 2.0, 2.0,
+ gst_segment_set_newsegment (&segment, FALSE, 2.0, 2.0,
GST_FORMAT_TIME, 0, 200, 0);
fail_unless (segment.rate == 2.0);
* this means we have a reverse stream that we should
* speed up by a factor of 2.0
************************************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, 2.0, -1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 2.0, -1.0,
GST_FORMAT_TIME, 0, 200, 200);
fail_unless (segment.rate == 2.0);
* this means we have a reverse stream that we should
* reverse to get the normal stream again.
************************************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, -1.0, -1.0,
+ gst_segment_set_newsegment (&segment, FALSE, -1.0, -1.0,
GST_FORMAT_TIME, 0, 200, 200);
fail_unless (segment.rate == -1.0);
* this means we have a reverse stream that we should
* reverse to get the normal stream again.
************************************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, -1.0, 2.0,
+ gst_segment_set_newsegment (&segment, FALSE, -1.0, 2.0,
GST_FORMAT_TIME, 0, 200, 0);
fail_unless (segment.rate == -1.0);
/***************************
* Normal segment
***************************/
- gst_segment_set_newsegment_full (&segment, FALSE, 1.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 1.0,
GST_FORMAT_TIME, 0, 200, 0);
fail_unless (segment.rate == 1.0);
* all positions by 2.0 in this segment.
* Then time argument is not used at all here.
***********************************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, 2.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 2.0, 1.0,
GST_FORMAT_TIME, 0, 200, 500);
/* normal speed gives elapsed of 200 */
* time offset by 500
* applied rate is not used for running time
********************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, 1.0, 2.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 2.0,
GST_FORMAT_TIME, 500, 700, 0);
/* previous segment played at double speed gives elapsed time of
* relative to the segment stop position. again time
* is ignored.
**********************************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, -1.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, -1.0, 1.0,
GST_FORMAT_TIME, 500, 700, 200);
fail_unless (segment.accum == 500);
* twice speed relative to the segment stop position. again
* time is ignored.
**********************************************************/
- gst_segment_set_newsegment_full (&segment, FALSE, -2.0, -2.0,
+ gst_segment_set_newsegment (&segment, FALSE, -2.0, -2.0,
GST_FORMAT_TIME, 500, 700, 200);
fail_unless (segment.accum == 700);
fail_unless (result == -1);
/* see if negative rate closed segment correctly */
- gst_segment_set_newsegment_full (&segment, FALSE, -2.0, -1.0,
+ gst_segment_set_newsegment (&segment, FALSE, -2.0, -1.0,
GST_FORMAT_TIME, 500, 700, 200);
/* previous segment lasted 100, and was at 700 so we should get 800 */
/***************************
* Normal reverse segment
***************************/
- gst_segment_set_newsegment_full (&segment, FALSE, -1.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, -1.0, 1.0,
GST_FORMAT_TIME, 0, 200, 0);
fail_unless (segment.rate == -1.0);
fail_unless (result == 150);
/* update segment, this accumulates 50 from the previous segment. */
- gst_segment_set_newsegment_full (&segment, TRUE, -2.0, 1.0,
+ gst_segment_set_newsegment (&segment, TRUE, -2.0, 1.0,
GST_FORMAT_TIME, 0, 150, 0);
fail_unless (segment.rate == -2.0);
fail_unless (result == 100);
/* update segment, this does not accumulate anything. */
- gst_segment_set_newsegment_full (&segment, TRUE, 1.0, 1.0,
+ gst_segment_set_newsegment (&segment, TRUE, 1.0, 1.0,
GST_FORMAT_TIME, 100, 200, 100);
fail_unless (segment.rate == 1.0);
/***************************
* Normal reverse segment
***************************/
- gst_segment_set_newsegment_full (&segment, FALSE, -1.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, -1.0, 1.0,
GST_FORMAT_TIME, 0, 200, 0);
fail_unless (segment.rate == -1.0);
fail_unless (result == 150);
/* close segment, this accumulates nothing. */
- gst_segment_set_newsegment_full (&segment, TRUE, -1.0, 1.0,
+ gst_segment_set_newsegment (&segment, TRUE, -1.0, 1.0,
GST_FORMAT_TIME, 150, 200, 0);
fail_unless (segment.rate == -1.0);
fail_unless (segment.duration == -1);
/* new segment, this accumulates 50. */
- gst_segment_set_newsegment_full (&segment, FALSE, 1.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, 1.0, 1.0,
GST_FORMAT_TIME, 150, 300, 150);
fail_unless (segment.rate == 1.0);
gst_segment_init (&segment, GST_FORMAT_TIME);
- gst_segment_set_newsegment_full (&segment, FALSE, -1.0, 1.0,
+ gst_segment_set_newsegment (&segment, FALSE, -1.0, 1.0,
GST_FORMAT_TIME, 0, 200, 0);
copy = gst_segment_copy (&segment);
fail_unless (newseg_event != NULL);
gst_event_parse_new_segment (newseg_event, NULL, &rate, NULL, NULL, NULL,
- NULL);
+ NULL, NULL);
fail_unless (rate == 0.5);
gst_pad_remove_event_probe (probe_pad, probe);