Class: GstBase::BaseSink
- Inherits:
-
Gst::Element
- Object
- GObject::InitiallyUnowned
- Gst::Object
- Gst::Element
- GstBase::BaseSink
- Defined in:
- (unknown)
Overview
Subclasses can override any of the available virtual methods or not, as needed. At the minimum, the render method should be overridden to output/present buffers.
Direct Known Subclasses
Instance Method Summary collapse
-
#async=(async) ⇒ Boolean
If set to true, the basesink will perform asynchronous state changes.
-
#async? ⇒ Boolean
If set to true, the basesink will perform asynchronous state changes.
-
#async_enabled=(enabled) ⇒ nil
Configures sink to perform all state changes asynchronously.
-
#blocksize ⇒ Integer
The amount of bytes to pull when operating in pull mode.
-
#blocksize=(blocksize) ⇒ Integer
The amount of bytes to pull when operating in pull mode.
-
#do_preroll(obj) ⇒ Gst::FlowReturn
If the sink spawns its own thread for pulling buffers from upstream it should call this method after it has pulled a buffer.
-
#drop_out_of_segment ⇒ Boolean
Checks if sink is currently configured to drop buffers which are outside the current segment current segment.
-
#drop_out_of_segment=(drop_out_of_segment) ⇒ nil
Configure sink to drop buffers which are outside the current segment.
-
#enable_last_sample=(enable_last_sample) ⇒ Boolean
Enable the last-sample property.
-
#enable_last_sample? ⇒ Boolean
Enable the last-sample property.
-
#is_async_enabled ⇒ Boolean
Checks if sink is currently configured to perform asynchronous state changes to PAUSED.
-
#is_last_sample_enabled ⇒ Boolean
Checks if sink is currently configured to store the last received sample in the last-sample property.
-
#is_qos_enabled ⇒ Boolean
Checks if sink is currently configured to send Quality-of-Service events upstream.
-
#last_sample ⇒ Gst::Sample
The last buffer that arrived in the sink and was used for preroll or for rendering.
-
#last_sample=(last_sample) ⇒ Gst::Sample
The last buffer that arrived in the sink and was used for preroll or for rendering.
-
#last_sample_enabled=(enabled) ⇒ nil
Configures sink to store the last received sample in the last-sample property.
-
#latency ⇒ Gst::ClockTime
Get the currently configured latency.
-
#max_bitrate ⇒ Integer
Control the maximum amount of bits that will be rendered per second.
-
#max_bitrate=(max_bitrate) ⇒ Integer
Control the maximum amount of bits that will be rendered per second.
-
#max_lateness ⇒ Integer
Max-lateness.
- #max_lateness=(max_lateness) ⇒ Integer
-
#processing_deadline ⇒ Integer
Maximum amount of time (in nanoseconds) that the pipeline can take for processing the buffer.
-
#processing_deadline=(processing_deadline) ⇒ Integer
Maximum amount of time (in nanoseconds) that the pipeline can take for processing the buffer.
- #qos=(qos) ⇒ Boolean
-
#qos? ⇒ Boolean
Qos.
-
#qos_enabled=(enabled) ⇒ nil
Configures sink to send Quality-of-Service events upstream.
-
#query_latency(live, upstream_live, min_latency, max_latency) ⇒ Boolean
Query the sink for the latency parameters.
-
#render_delay ⇒ Integer
The additional delay between synchronisation and actual rendering of the media.
-
#render_delay=(render_delay) ⇒ Integer
The additional delay between synchronisation and actual rendering of the media.
-
#stats ⇒ Gst::Structure
Various Gst::BaseSink statistics.
-
#stats=(stats) ⇒ Gst::Structure
Various Gst::BaseSink statistics.
-
#sync ⇒ Boolean
Checks if sink is currently configured to synchronize against the clock.
- #sync=(sync) ⇒ Boolean
-
#sync? ⇒ Boolean
Sync.
-
#throttle_time ⇒ Integer
The time to insert between buffers.
-
#throttle_time=(throttle_time) ⇒ Integer
The time to insert between buffers.
-
#ts_offset ⇒ Integer
Controls the final synchronisation, a negative value will render the buffer earlier while a positive value delays playback.
-
#ts_offset=(ts_offset) ⇒ Integer
Controls the final synchronisation, a negative value will render the buffer earlier while a positive value delays playback.
-
#wait(time, jitter) ⇒ Gst::FlowReturn
This function will wait for preroll to complete and will then block until time is reached.
-
#wait_clock(time, jitter) ⇒ Gst::ClockReturn
This function will block until time is reached.
-
#wait_preroll ⇒ Gst::FlowReturn
If the Gst::BaseSinkClass::render method performs its own synchronisation against the clock it must unblock when going from PLAYING to the PAUSED state and call this method before continuing to render the remaining data.
Methods inherited from Gst::Element
#>>, [], #abort_state, #add_metadata, #add_pad, #add_pad_template, #add_property_deep_notify_watch, #add_property_notify_watch, #add_static_metadata, #add_static_pad_template, #add_static_pad_template_with_gtype, #base_time, #base_time=, #bus, #bus=, #call_async, #change_state, #clock, #clock=, #context=, #contexts, #continue_state, #create_all_pads, #current_clock_time, #current_running_time, #decorate_stream_id, #decorate_stream_id_printf, #decorate_stream_id_printf_valist, #factory, #flags, #flags_raw, #foreach_pad, #foreach_sink_pad, #foreach_src_pad, #get_compatible_pad, #get_compatible_pad_template, #get_context, #get_context_unlocked, #get_metadata, #get_pad_template, #get_request_pad, #get_state, #get_static_pad, #is_locked_state, #iterate_pads, #iterate_sink_pads, #iterate_src_pads, #link_elements, #link_filtered, #link_many, #link_pads, #link_pads_filtered, #link_pads_full, #locked_state=, #lost_state, make_from_uri, #message_full, #message_full_with_details, #no_more_pads, #pad_template_list, #pause, #play, #post_message, #provide_clock, #query, #query_convert, #query_duration, #query_position, #ready, register, #release_request_pad, #remove_pad, #remove_property_notify_watch, #request_pad, #request_pad_simple, #seek, #seek_simple, #send_event, #set_metadata, #set_static_metadata, #start_time, #start_time=, #state=, state_change_return_get_name, state_get_name, #stop, #sync_state_with_parent, type_set_skip_documentation, #unlink, #unlink_many, #unlink_pads
Methods inherited from Gst::Object
#add_control_binding, check_uniqueness, #control_bindings_disabled=, #control_rate, #control_rate=, default_deep_notify, #default_error, #get_control_binding, #get_g_value_array, #get_value, #get_value_array, #has_active_control_bindings, #has_ancestor, #has_as_ancestor, #has_as_parent, #name, #name=, #parent, #parent=, #path_string, #ref, ref_sink, #remove_control_binding, replace, #set_control_binding_disabled, #suggest_next_sync, #sync_values, #unparent, #unref
Instance Method Details
#async=(async) ⇒ Boolean
If set to true, the basesink will perform asynchronous state changes. When set to false, the sink will not signal the parent when it prerolls. Use this option when dealing with sparse streams or when synchronisation is not required.
#async? ⇒ Boolean
If set to true, the basesink will perform asynchronous state changes. When set to false, the sink will not signal the parent when it prerolls. Use this option when dealing with sparse streams or when synchronisation is not required.
#async_enabled=(enabled) ⇒ nil
Configures sink to perform all state changes asynchronously. When async is disabled, the sink will immediately go to PAUSED instead of waiting for a preroll buffer. This feature is useful if the sink does not synchronize against the clock or when it is dealing with sparse streams.
#blocksize ⇒ Integer
The amount of bytes to pull when operating in pull mode.
#blocksize=(blocksize) ⇒ Integer
The amount of bytes to pull when operating in pull mode.
#do_preroll(obj) ⇒ Gst::FlowReturn
If the sink spawns its own thread for pulling buffers from upstream it should call this method after it has pulled a buffer. If the element needed to preroll, this function will perform the preroll and will then block until the element state is changed.
This function should be called with the PREROLL_LOCK held. continue. Any other return value should be returned from the render vmethod.
#drop_out_of_segment ⇒ Boolean
Checks if sink is currently configured to drop buffers which are outside the current segment current segment.
#drop_out_of_segment=(drop_out_of_segment) ⇒ nil
Configure sink to drop buffers which are outside the current segment
#enable_last_sample=(enable_last_sample) ⇒ Boolean
Enable the last-sample property. If false, basesink doesn't keep a reference to the last buffer arrived and the last-sample property is always set to nil. This can be useful if you need buffers to be released as soon as possible, eg. if you're using a buffer pool.
#enable_last_sample? ⇒ Boolean
Enable the last-sample property. If false, basesink doesn't keep a reference to the last buffer arrived and the last-sample property is always set to nil. This can be useful if you need buffers to be released as soon as possible, eg. if you're using a buffer pool.
#is_async_enabled ⇒ Boolean
Checks if sink is currently configured to perform asynchronous state changes to PAUSED. changes.
#is_last_sample_enabled ⇒ Boolean
Checks if sink is currently configured to store the last received sample in the last-sample property.
#is_qos_enabled ⇒ Boolean
Checks if sink is currently configured to send Quality-of-Service events upstream.
#last_sample ⇒ Gst::Sample
The last buffer that arrived in the sink and was used for preroll or for rendering. This property can be used to generate thumbnails. This property can be nil when the sink has not yet received a buffer.
#last_sample=(last_sample) ⇒ Gst::Sample
The last buffer that arrived in the sink and was used for preroll or for rendering. This property can be used to generate thumbnails. This property can be nil when the sink has not yet received a buffer.
#last_sample_enabled=(enabled) ⇒ nil
Configures sink to store the last received sample in the last-sample property.
#latency ⇒ Gst::ClockTime
Get the currently configured latency.
#max_bitrate ⇒ Integer
Control the maximum amount of bits that will be rendered per second. Setting this property to a value bigger than 0 will make the sink delay rendering of the buffers when it would exceed to max-bitrate.
#max_bitrate=(max_bitrate) ⇒ Integer
Control the maximum amount of bits that will be rendered per second. Setting this property to a value bigger than 0 will make the sink delay rendering of the buffers when it would exceed to max-bitrate.
#max_lateness ⇒ Integer
Returns max-lateness.
#max_lateness=(max_lateness) ⇒ Integer
#processing_deadline ⇒ Integer
Maximum amount of time (in nanoseconds) that the pipeline can take for processing the buffer. This is added to the latency of live pipelines.
#processing_deadline=(processing_deadline) ⇒ Integer
Maximum amount of time (in nanoseconds) that the pipeline can take for processing the buffer. This is added to the latency of live pipelines.
#qos=(qos) ⇒ Boolean
#qos? ⇒ Boolean
Returns qos.
#qos_enabled=(enabled) ⇒ nil
Configures sink to send Quality-of-Service events upstream.
#query_latency(live, upstream_live, min_latency, max_latency) ⇒ Boolean
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 synchronize against the clock. upstream_live will be true if an upstream element is live.
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 min_latency to a strictly positive value.
This function is mostly used by subclasses.
#render_delay ⇒ Integer
The additional delay between synchronisation and actual rendering of the media. This property will add additional latency to the device in order to make other sinks compensate for the delay.
#render_delay=(render_delay) ⇒ Integer
The additional delay between synchronisation and actual rendering of the media. This property will add additional latency to the device in order to make other sinks compensate for the delay.
#stats ⇒ Gst::Structure
Various Gst::BaseSink statistics. This property returns a #GstStructure
with name application/x-gst-base-sink-stats with the following fields:
- "average-rate" G_TYPE_DOUBLE average frame rate
- "dropped" G_TYPE_UINT64 Number of dropped frames
- "rendered" G_TYPE_UINT64 Number of rendered frames
#stats=(stats) ⇒ Gst::Structure
Various Gst::BaseSink statistics. This property returns a #GstStructure
with name application/x-gst-base-sink-stats with the following fields:
- "average-rate" G_TYPE_DOUBLE average frame rate
- "dropped" G_TYPE_UINT64 Number of dropped frames
- "rendered" G_TYPE_UINT64 Number of rendered frames
#sync ⇒ Boolean
Checks if sink is currently configured to synchronize against the clock.
#sync=(sync) ⇒ Boolean
#sync? ⇒ Boolean
Returns sync.
#throttle_time ⇒ Integer
The time to insert between buffers. This property can be used to control the maximum amount of buffers per second to render. Setting this property to a value bigger than 0 will make the sink create THROTTLE QoS events.
#throttle_time=(throttle_time) ⇒ Integer
The time to insert between buffers. This property can be used to control the maximum amount of buffers per second to render. Setting this property to a value bigger than 0 will make the sink create THROTTLE QoS events.
#ts_offset ⇒ Integer
Controls the final synchronisation, a negative value will render the buffer earlier while a positive value delays playback. This property can be used to fix synchronisation in bad files.
#ts_offset=(ts_offset) ⇒ Integer
Controls the final synchronisation, a negative value will render the buffer earlier while a positive value delays playback. This property can be used to fix synchronisation in bad files.
#wait(time, jitter) ⇒ Gst::FlowReturn
This function will wait for preroll to complete and will then block until time is reached. It is usually called by subclasses that use their own internal synchronisation but want to let some synchronization (like EOS) be handled by the base class.
This function should only be called with the PREROLL_LOCK held (like when receiving an EOS event in the ::event vmethod or when handling buffers in ::render).
The time argument should be the running_time of when the timeout should happen and will be adjusted with any latency and offset configured in the sink.
#wait_clock(time, jitter) ⇒ Gst::ClockReturn
This function will block until time is reached. It is usually called by subclasses that use their own internal synchronisation.
If time is not valid, no synchronisation is done and %GST_CLOCK_BADTIME is returned. Likewise, if synchronisation is disabled in the element or there is no clock, no synchronisation is done and %GST_CLOCK_BADTIME is returned.
This function should only be called with the PREROLL_LOCK held, like when receiving an EOS event in the Gst::BaseSinkClass::event vmethod or when receiving a buffer in the Gst::BaseSinkClass::render vmethod.
The time argument should be the running_time of when this method should return and is not adjusted with any latency or offset configured in the sink.
#wait_preroll ⇒ Gst::FlowReturn
If the Gst::BaseSinkClass::render method performs its own synchronisation against the clock it must unblock when going from PLAYING to the PAUSED state and call this method before continuing to render the remaining data.
If the Gst::BaseSinkClass::render method can block on something else than the clock, it must also be ready to unblock immediately on the Gst::BaseSinkClass::unlock method and cause the Gst::BaseSinkClass::render method to immediately call this function. In this case, the subclass must be prepared to continue rendering where it left off if this function returns %GST_FLOW_OK.
This function will block until a state change to PLAYING happens (in which case this function returns %GST_FLOW_OK) or the processing must be stopped due to a state change to READY or a FLUSH event (in which case this function returns %GST_FLOW_FLUSHING).
This function should only be called with the PREROLL_LOCK held, like in the render function. continue. Any other return value should be returned from the render vmethod.