whitespace removal and width coercion

Original commit message from CVS:
whitespace removal and width coercion
This commit is contained in:
Thomas Vander Stichele 2006-05-03 16:42:08 +00:00
parent 0442db045b
commit 493b84107d
2 changed files with 61 additions and 62 deletions

View file

@ -26,16 +26,16 @@
* *
* #GstBaseSink is the base class for sink elements in GStreamer, such as * #GstBaseSink is the base class for sink elements in GStreamer, such as
* xvimagesink or filesink. It is a layer on top of #GstElement that provides a * xvimagesink or filesink. It is a layer on top of #GstElement that provides a
* simplified interface to plugin writers. #GstBaseSink handles many details * simplified interface to plugin writers. #GstBaseSink handles many details
* for you, for example: preroll, clock synchronization, state changes, * for you, for example: preroll, clock synchronization, state changes,
* activation in push or pull mode, and queries. * activation in push or pull mode, and queries.
* *
* In most cases, when writing sink elements, there is no need to implement * In most cases, when writing sink elements, there is no need to implement
* class methods from #GstElement or to set functions on pads, because the * class methods from #GstElement or to set functions on pads, because the
* #GstBaseSink infrastructure should be sufficient. * #GstBaseSink infrastructure should be sufficient.
* *
* #GstBaseSink provides support for exactly one sink pad, which should be * #GstBaseSink provides support for exactly one sink pad, which should be
* named "sink". A sink implementation (subclass of GstBaseSink) should * named "sink". A sink implementation (subclass of GstBaseSink) should
* install a pad template in its base_init function, like so: * install a pad template in its base_init function, like so:
* <programlisting> * <programlisting>
* static void * static void
@ -53,15 +53,15 @@
* </programlisting> * </programlisting>
* *
* #GstBaseSink will handle the prerolling correctly. This means that it will * #GstBaseSink will handle the prerolling correctly. This means that it will
* return GST_STATE_CHANGE_ASYNC from a state change to PAUSED until the first * return GST_STATE_CHANGE_ASYNC from a state change to PAUSED until the first
* buffer arrives in this element. The base class will call the * buffer arrives in this element. The base class will call the
* GstBaseSink::preroll vmethod with this preroll buffer and will then commit * GstBaseSink::preroll vmethod with this preroll buffer and will then commit
* the state change to the next asynchronously pending state. * the state change to the next asynchronously pending state.
* *
* When the element is set to PLAYING, #GstBaseSink will synchronise on the * When the element is set to PLAYING, #GstBaseSink will synchronise on the
* clock using the times returned from ::get_times. If this function returns * clock using the times returned from ::get_times. If this function returns
* #GST_CLOCK_TIME_NONE for the start time, no synchronisation will be done. * #GST_CLOCK_TIME_NONE for the start time, no synchronisation will be done.
* Synchronisation can be disabled entirely by setting the object "sync" * Synchronisation can be disabled entirely by setting the object "sync"
* property to FALSE. * property to FALSE.
* *
* After synchronisation the virtual method #GstBaseSink::render will be called. * After synchronisation the virtual method #GstBaseSink::render will be called.
@ -70,61 +70,61 @@
* Since 0.10.3 subclasses that synchronise on the clock in the ::render method * Since 0.10.3 subclasses that synchronise on the clock in the ::render method
* are supported as well. These classes typically receive a buffer in the render * are supported as well. These classes typically receive a buffer in the render
* method and can then potentially block on the clock while rendering. A typical * method and can then potentially block on the clock while rendering. A typical
* example is an audiosink. * example is an audiosink.
* *
* Upon receiving the EOS event in the PLAYING state, #GstBaseSink will wait * Upon receiving the EOS event in the PLAYING state, #GstBaseSink will wait
* for the clock to reach the time indicated by the stop time of the last * for the clock to reach the time indicated by the stop time of the last
* ::get_times call before posting an EOS message. When the element receives * ::get_times call before posting an EOS message. When the element receives
* EOS in PAUSED, preroll completes, the event is queued and an EOS message is * EOS in PAUSED, preroll completes, the event is queued and an EOS message is
* posted when going to PLAYING. * posted when going to PLAYING.
* *
* #GstBaseSink will internally use the GST_EVENT_NEW_SEGMENT events to schedule * #GstBaseSink will internally use the GST_EVENT_NEW_SEGMENT events to schedule
* synchronisation and clipping of buffers. Buffers that fall completely outside * synchronisation and clipping of buffers. Buffers that fall completely outside
* of the current segment are dropped. Buffers that fall partially in the * of the current segment are dropped. Buffers that fall partially in the
* segment are rendered (and prerolled). Subclasses should do any subbuffer * segment are rendered (and prerolled). Subclasses should do any subbuffer
* clipping themselves when needed. * clipping themselves when needed.
* *
* #GstBaseSink will by default report the current playback position in * #GstBaseSink will by default report the current playback position in
* GST_FORMAT_TIME based on the current clock time and segment information. * GST_FORMAT_TIME based on the current clock time and segment information.
* If no clock has been set on the element, the query will be forwarded * If no clock has been set on the element, the query will be forwarded
* upstream. * upstream.
* *
* The ::set_caps function will be called when the subclass should configure * The ::set_caps function will be called when the subclass should configure
* itself to process a specific media type. * itself to process a specific media type.
*
* The ::start and ::stop virtual methods will be called when resources should
* be allocated. Any ::preroll, ::render and ::set_caps function will be
* called between the ::start and ::stop calls.
* *
* The ::event virtual method will be called when an event is received by * The ::start and ::stop virtual methods will be called when resources should
* be allocated. Any ::preroll, ::render and ::set_caps function will be
* called between the ::start and ::stop calls.
*
* The ::event virtual method will be called when an event is received by
* #GstBaseSink. Normally this method should only be overriden by very specific * #GstBaseSink. Normally this method should only be overriden by very specific
* elements (such as file sinks) which need to handle the newsegment event * elements (such as file sinks) which need to handle the newsegment event
* specially. * specially.
* *
* #GstBaseSink provides an overridable ::buffer_alloc function that can be * #GstBaseSink provides an overridable ::buffer_alloc function that can be
* used by sinks that want to do reverse negotiation or to provide * used by sinks that want to do reverse negotiation or to provide
* custom buffers (hardware buffers for example) to upstream elements. * custom buffers (hardware buffers for example) to upstream elements.
* *
* The ::unlock method is called when the elements should unblock any blocking * The ::unlock method is called when the elements should unblock any blocking
* operations they perform in the ::render method. This is mostly useful when * operations they perform in the ::render method. This is mostly useful when
* the ::render method performs a blocking write on a file descriptor, for * the ::render method performs a blocking write on a file descriptor, for
* example. * example.
* *
* The max-lateness property affects how the sink deals with buffers that * The max-lateness property affects how the sink deals with buffers that
* arrive too late in the sink. A buffer arrives too late in the sink when * arrive too late in the sink. A buffer arrives too late in the sink when
* the presentation time (as a combination of the last segment, buffer * the presentation time (as a combination of the last segment, buffer
* timestamp and element base_time) plus the duration is before the current * timestamp and element base_time) plus the duration is before the current
* time of the clock. * time of the clock.
* If the frame is later than max-lateness, the sink will drop the buffer * If the frame is later than max-lateness, the sink will drop the buffer
* without calling the render method. * without calling the render method.
* This feature is disabled if sync is disabled, the ::get-times method does * This feature is disabled if sync is disabled, the ::get-times method does
* not return a valid start time or max-lateness is set to -1 (the default). * not return a valid start time or max-lateness is set to -1 (the default).
* Subclasses can use gst_base_sink_set_max_lateness() to configure the * Subclasses can use gst_base_sink_set_max_lateness() to configure the
* max-lateness value. * max-lateness value.
* *
* The qos property will enable the quality-of-service features of the basesink * The qos property will enable the quality-of-service features of the basesink
* which gather statistics about the real-time performance of the clock * which gather statistics about the real-time performance of the clock
* synchronisation. For each dropped buffer it will also send a QoS message * synchronisation. For each dropped buffer it will also send a QoS message
* upstream. * upstream.
* *
* Last reviewed on 2006-03-31 (0.10.5) * Last reviewed on 2006-03-31 (0.10.5)
@ -145,7 +145,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_base_sink_debug);
#define GST_BASE_SINK_GET_PRIVATE(obj) \ #define GST_BASE_SINK_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_BASE_SINK, GstBaseSinkPrivate)) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_BASE_SINK, GstBaseSinkPrivate))
/* FIXME, some stuff in ABI.data and other in Private... /* FIXME, some stuff in ABI.data and other in Private...
* Make up your mind please. * Make up your mind please.
*/ */
struct _GstBaseSinkPrivate struct _GstBaseSinkPrivate
@ -171,9 +171,9 @@ struct _GstBaseSinkPrivate
GstClockTime avg_duration; GstClockTime avg_duration;
gdouble avg_rate; gdouble avg_rate;
/* these are done on system time. avg_jitter and avg_render are /* these are done on system time. avg_jitter and avg_render are
* compared to eachother to see if the rendering time takes a * compared to eachother to see if the rendering time takes a
* huge amount of the processing, If so we are flooded with * huge amount of the processing, If so we are flooded with
* buffers. */ * buffers. */
GstClockTime last_left_systime; GstClockTime last_left_systime;
GstClockTime avg_jitter; GstClockTime avg_jitter;
@ -208,8 +208,8 @@ enum
#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

View file

@ -104,28 +104,27 @@ struct _GstBaseSink {
/** /**
* GstBaseSinkClass: * GstBaseSinkClass:
* @parent_class: Element parent class * @get_caps: Called to get sink pad caps from the subclass
* @get_caps: Called to get sink pad caps from the subclass
* @set_caps: Notify subclass of changed caps * @set_caps: Notify subclass of changed caps
* @buffer_alloc: Subclasses can override to perform custom buffer allocations * @buffer_alloc: Subclasses can override to perform custom buffer allocations
* @get_times: Called to get the start and end times for synchronising * @get_times: Called to get the start and end times for synchronising
* the passed buffer to the clock * the passed buffer to the clock
* @start: Start processing. Ideal for opening resources in the subclass * @start: Start processing. Ideal for opening resources in the subclass
* @stop: Stop processing. Subclasses should use this to close resources. * @stop: Stop processing. Subclasses should use this to close resources.
* @unlock: Unlock any pending access to the resource. Subclasses should * @unlock: Unlock any pending access to the resource. Subclasses should
* unblock any blocked function ASAP * unblock any blocked function ASAP
* @event: Override this to handle events arriving on the sink pad * @event: Override this to handle events arriving on the sink pad
* @preroll: Called to present the preroll buffer if desired * @preroll: Called to present the preroll buffer if desired
* @render: Called when a buffer should be presented or output, at the * @render: Called when a buffer should be presented or output, at the
* correct moment if the #GstBaseSink has been set to sync to * correct moment if the #GstBaseSink has been set to sync to
* the clock. * the clock.
* @async_play: Subclasses should override this when they need to perform * @async_play: Subclasses should override this when they need to perform
* special processing when changing to the PLAYING state asynchronously. * special processing when changing to the PLAYING state
* Called with the OBJECT_LOCK held. * asynchronously. Called with the OBJECT_LOCK held.
* *
* Subclasses can override any of the available virtual methods or not, as * Subclasses can override any of the available virtual methods or not, as
* needed. At the minimum, the render method should be overridden to * needed. At the minimum, the render method should be overridden to
* output/present buffers * output/present buffers.
*/ */
struct _GstBaseSinkClass { struct _GstBaseSinkClass {
GstElementClass parent_class; GstElementClass parent_class;