basesink: whitespace fixes

This commit is contained in:
Wim Taymans 2009-08-24 17:56:32 +02:00
parent 6df1127daa
commit 989d9861e3

View file

@ -42,7 +42,7 @@
* my_element_base_init (gpointer g_class) * my_element_base_init (gpointer g_class)
* { * {
* GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class); * GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
* *
* // sinktemplate should be a #GstStaticPadTemplate with direction * // sinktemplate should be a #GstStaticPadTemplate with direction
* // #GST_PAD_SINK and name "sink" * // #GST_PAD_SINK and name "sink"
* gst_element_class_add_pad_template (gstelement_class, * gst_element_class_add_pad_template (gstelement_class,
@ -267,14 +267,14 @@ struct _GstBaseSinkPrivate
#define DEFAULT_CAN_ACTIVATE_PULL FALSE /* fixme: enable me */ #define DEFAULT_CAN_ACTIVATE_PULL FALSE /* fixme: enable me */
#define DEFAULT_CAN_ACTIVATE_PUSH TRUE #define DEFAULT_CAN_ACTIVATE_PUSH TRUE
#define DEFAULT_PREROLL_QUEUE_LEN 0 #define DEFAULT_PREROLL_QUEUE_LEN 0
#define DEFAULT_SYNC TRUE #define DEFAULT_SYNC TRUE
#define DEFAULT_MAX_LATENESS -1 #define DEFAULT_MAX_LATENESS -1
#define DEFAULT_QOS FALSE #define DEFAULT_QOS FALSE
#define DEFAULT_ASYNC TRUE #define DEFAULT_ASYNC TRUE
#define DEFAULT_TS_OFFSET 0 #define DEFAULT_TS_OFFSET 0
#define DEFAULT_BLOCKSIZE 4096 #define DEFAULT_BLOCKSIZE 4096
#define DEFAULT_RENDER_DELAY 0 #define DEFAULT_RENDER_DELAY 0
enum enum
{ {
@ -430,7 +430,7 @@ gst_base_sink_class_init (GstBaseSinkClass * klass)
* GstBaseSink:ts-offset * GstBaseSink:ts-offset
* *
* Controls the final synchronisation, a negative value will render the buffer * Controls the final synchronisation, a negative value will render the buffer
* earlier while a positive value delays playback. This property can be * earlier while a positive value delays playback. This property can be
* used to fix synchronisation in bad files. * used to fix synchronisation in bad files.
* *
* Since: 0.10.15 * Since: 0.10.15
@ -890,7 +890,7 @@ gst_base_sink_get_ts_offset (GstBaseSink * sink)
* rendering. This property can be used to generate thumbnails. * rendering. This property can be used to generate thumbnails.
* *
* The #GstCaps on the buffer can be used to determine the type of the buffer. * The #GstCaps on the buffer can be used to determine the type of the buffer.
* *
* Returns: a #GstBuffer. gst_buffer_unref() after usage. This function returns * Returns: a #GstBuffer. gst_buffer_unref() after usage. This function returns
* NULL when no buffer has arrived in the sink yet or when the sink is not in * NULL when no buffer has arrived in the sink yet or when the sink is not in
* PAUSED or PLAYING. * PAUSED or PLAYING.
@ -968,13 +968,13 @@ gst_base_sink_get_latency (GstBaseSink * sink)
* Query the sink for the latency parameters. The latency will be queried from * Query the sink for the latency parameters. The latency will be queried from
* the upstream elements. @live will be TRUE if @sink is configured to * the upstream elements. @live will be TRUE if @sink is configured to
* synchronize against the clock. @upstream_live will be TRUE if an upstream * synchronize against the clock. @upstream_live will be TRUE if an upstream
* element is live. * element is live.
* *
* If both @live and @upstream_live are TRUE, the sink will want to compensate * If both @live and @upstream_live are TRUE, the sink will want to compensate
* for the latency introduced by the upstream elements by setting the * for the latency introduced by the upstream elements by setting the
* @min_latency to a strictly possitive value. * @min_latency to a strictly possitive value.
* *
* This function is mostly used by subclasses. * This function is mostly used by subclasses.
* *
* Returns: TRUE if the query succeeded. * Returns: TRUE if the query succeeded.
* *
@ -1065,10 +1065,10 @@ gst_base_sink_query_latency (GstBaseSink * sink, gboolean * live,
* @sink: a #GstBaseSink * @sink: a #GstBaseSink
* @delay: the new delay * @delay: the new delay
* *
* Set the render delay in @sink to @delay. The render delay is the time * Set the render delay in @sink to @delay. The render delay is the time
* between actual rendering of a buffer and its synchronisation time. Some * between actual rendering of a buffer and its synchronisation time. Some
* devices might delay media rendering which can be compensated for with this * devices might delay media rendering which can be compensated for with this
* function. * function.
* *
* After calling this function, this sink will report additional latency and * After calling this function, this sink will report additional latency and
* other sinks will adjust their latency to delay the rendering of their media. * other sinks will adjust their latency to delay the rendering of their media.
@ -1966,7 +1966,7 @@ gst_base_sink_wait_clock (GstBaseSink * sink, GstClockTime time,
GST_OBJECT_UNLOCK (sink); GST_OBJECT_UNLOCK (sink);
/* A blocking wait is performed on the clock. We save the ClockID /* A blocking wait is performed on the clock. We save the ClockID
* so we can unlock the entry at any time. While we are blocking, we * so we can unlock the entry at any time. While we are blocking, we
* release the PREROLL_LOCK so that other threads can interrupt the * release the PREROLL_LOCK so that other threads can interrupt the
* entry. */ * entry. */
sink->clock_id = id; sink->clock_id = id;
@ -2155,7 +2155,7 @@ gst_base_sink_wait_eos (GstBaseSink * sink, GstClockTime time,
* because we don't interact with the device on EOS normally. */ * because we don't interact with the device on EOS normally. */
stime = gst_base_sink_adjust_time (sink, time); stime = gst_base_sink_adjust_time (sink, time);
/* wait for the clock, this can be interrupted because we got shut down or /* wait for the clock, this can be interrupted because we got shut down or
* we PAUSED. */ * we PAUSED. */
status = gst_base_sink_wait_clock (sink, stime, jitter); status = gst_base_sink_wait_clock (sink, stime, jitter);
@ -2198,7 +2198,7 @@ flushing:
* Some objects do not need synchronisation (most events) and so this function * Some objects do not need synchronisation (most events) and so this function
* immediatly returns GST_FLOW_OK. * immediatly returns GST_FLOW_OK.
* *
* for objects that arrive later than max-lateness to be synchronized to the * for objects that arrive later than max-lateness to be synchronized to the
* clock have the @late boolean set to TRUE. * clock have the @late boolean set to TRUE.
* *
* This function keeps a running average of the jitter (the diff between the * This function keeps a running average of the jitter (the diff between the
@ -2563,7 +2563,7 @@ gst_base_sink_is_too_late (GstBaseSink * basesink, GstMiniObject * obj,
"buffer is too late %" GST_TIME_FORMAT "buffer is too late %" GST_TIME_FORMAT
" > %" GST_TIME_FORMAT, GST_TIME_ARGS (start + jitter), " > %" GST_TIME_FORMAT, GST_TIME_ARGS (start + jitter),
GST_TIME_ARGS (max_lateness)); GST_TIME_ARGS (max_lateness));
/* !!emergency!!, if we did not receive anything valid for more than a /* !!emergency!!, if we did not receive anything valid for more than a
* second, render it anyway so the user sees something */ * second, render it anyway so the user sees something */
if (priv->last_in_time != -1 && start - priv->last_in_time > GST_SECOND) { if (priv->last_in_time != -1 && start - priv->last_in_time > GST_SECOND) {
late = FALSE; late = FALSE;
@ -2756,8 +2756,8 @@ again:
GstMessage *message; GstMessage *message;
/* the EOS event is completely handled so we mark /* the EOS event is completely handled so we mark
* ourselves as being in the EOS state. eos is also * ourselves as being in the EOS state. eos is also
* protected by the object lock so we can read it when * protected by the object lock so we can read it when
* answering the POSITION query. */ * answering the POSITION query. */
GST_OBJECT_LOCK (basesink); GST_OBJECT_LOCK (basesink);
basesink->eos = TRUE; basesink->eos = TRUE;
@ -2819,8 +2819,8 @@ flushing:
/* with STREAM_LOCK, PREROLL_LOCK /* with STREAM_LOCK, PREROLL_LOCK
* *
* Perform preroll on the given object. For buffers this means * Perform preroll on the given object. For buffers this means
* calling the preroll subclass method. * calling the preroll subclass method.
* If that succeeds, the state will be commited. * If that succeeds, the state will be commited.
* *
* function does not take ownership of obj. * function does not take ownership of obj.
@ -2890,7 +2890,7 @@ stopping:
} }
} }
/* with STREAM_LOCK, PREROLL_LOCK /* with STREAM_LOCK, PREROLL_LOCK
* *
* Queue an object for rendering. * Queue an object for rendering.
* The first prerollable object queued will complete the preroll. If the * The first prerollable object queued will complete the preroll. If the
@ -2920,7 +2920,7 @@ gst_base_sink_queue_object_unlocked (GstBaseSink * basesink, GstPad * pad,
if (G_UNLIKELY (ret != GST_FLOW_OK)) if (G_UNLIKELY (ret != GST_FLOW_OK))
goto preroll_failed; goto preroll_failed;
} }
/* need to recheck if we need preroll, commmit state during preroll /* need to recheck if we need preroll, commmit state during preroll
* could have made us not need more preroll. */ * could have made us not need more preroll. */
if (G_UNLIKELY (basesink->need_preroll)) { if (G_UNLIKELY (basesink->need_preroll)) {
/* see if we can render now, if we can't add the object to the preroll /* see if we can render now, if we can't add the object to the preroll
@ -3127,7 +3127,7 @@ gst_base_sink_event (GstPad * pad, GstEvent * event)
gst_event_unref (event); gst_event_unref (event);
} else { } else {
/* the new segment is a non prerollable item and does not block anything, /* the new segment is a non prerollable item and does not block anything,
* we need to configure the current clipping segment and insert the event * we need to configure the current clipping segment and insert the event
* in the queue to serialize it with the buffers for rendering. */ * in the queue to serialize it with the buffers for rendering. */
gst_base_sink_configure_segment (basesink, pad, event, gst_base_sink_configure_segment (basesink, pad, event,
basesink->abidata.ABI.clip_segment); basesink->abidata.ABI.clip_segment);
@ -3235,7 +3235,7 @@ gst_base_sink_needs_preroll (GstBaseSink * basesink)
return res; return res;
} }
/* with STREAM_LOCK, PREROLL_LOCK /* with STREAM_LOCK, PREROLL_LOCK
* *
* Takes a buffer and compare the timestamps with the last segment. * Takes a buffer and compare the timestamps with the last segment.
* If the buffer falls outside of the segment boundaries, drop it. * If the buffer falls outside of the segment boundaries, drop it.
@ -3455,7 +3455,7 @@ gst_base_sink_default_prepare_seek_segment (GstBaseSink * sink,
GstEvent * event, GstSegment * segment) GstEvent * event, GstSegment * segment)
{ {
/* By default, we try one of 2 things: /* By default, we try one of 2 things:
* - For absolute seek positions, convert the requested position to our * - For absolute seek positions, convert the requested position to our
* configured processing format and place it in the output segment \ * configured processing format and place it in the output segment \
* - For relative seek positions, convert our current (input) values to the * - For relative seek positions, convert our current (input) values to the
* seek format, adjust by the relative seek offset and then convert back to * seek format, adjust by the relative seek offset and then convert back to
@ -3573,7 +3573,7 @@ gst_base_sink_perform_seek (GstBaseSink * sink, GstPad * pad, GstEvent * event)
cur_type, cur, stop_type, stop, &update); cur_type, cur, stop_type, stop, &update);
} }
} }
/* Else, no seek event passed, so we're just (re)starting the /* Else, no seek event passed, so we're just (re)starting the
current segment. */ current segment. */
} }
@ -3592,13 +3592,13 @@ gst_base_sink_perform_seek (GstBaseSink * sink, GstPad * pad, GstEvent * event)
gst_pad_push_event (pad, gst_event_new_flush_stop ()); gst_pad_push_event (pad, gst_event_new_flush_stop ());
gst_base_sink_flush_stop (sink, pad); gst_base_sink_flush_stop (sink, pad);
} else if (res && sink->abidata.ABI.running) { } else if (res && sink->abidata.ABI.running) {
/* we are running the current segment and doing a non-flushing seek, /* we are running the current segment and doing a non-flushing seek,
* close the segment first based on the last_stop. */ * close the segment first based on the last_stop. */
GST_DEBUG_OBJECT (sink, "closing running segment %" G_GINT64_FORMAT GST_DEBUG_OBJECT (sink, "closing running segment %" G_GINT64_FORMAT
" to %" G_GINT64_FORMAT, sink->segment.start, sink->segment.last_stop); " to %" G_GINT64_FORMAT, sink->segment.start, sink->segment.last_stop);
} }
/* The subclass must have converted the segment to the processing format /* The subclass must have converted the segment to the processing format
* by now */ * by now */
if (res && seeksegment.format != dest_format) { if (res && seeksegment.format != dest_format) {
GST_DEBUG_OBJECT (sink, "Subclass failed to prepare a seek segment " GST_DEBUG_OBJECT (sink, "Subclass failed to prepare a seek segment "
@ -4354,7 +4354,7 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format,
/* this function might release the LOCK */ /* this function might release the LOCK */
gst_base_sink_get_position_last (basesink, format, &last, upstream); gst_base_sink_get_position_last (basesink, format, &last, upstream);
/* need to release the object lock before we can get the time, /* need to release the object lock before we can get the time,
* a clock might take the LOCK of the provider, which could be * a clock might take the LOCK of the provider, which could be
* a basesink subclass. */ * a basesink subclass. */
GST_OBJECT_UNLOCK (basesink); GST_OBJECT_UNLOCK (basesink);
@ -4374,9 +4374,9 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format,
goto convert_failed; goto convert_failed;
} }
/* subtract base time and accumulated time from the clock time. /* subtract base time and accumulated time from the clock time.
* Make sure we don't go negative. This is the current time in * Make sure we don't go negative. This is the current time in
* the segment which we need to scale with the combined * the segment which we need to scale with the combined
* rate and applied rate. */ * rate and applied rate. */
base += accum; base += accum;
base += latency; base += latency;