Class: GstBase::Aggregator

Inherits:
Gst::Element show all
Defined in:
(unknown)

Overview

The aggregator base class will handle in a thread-safe way all manners of concurrent flushes, seeks, pad additions and removals, leaving to the subclass the responsibility of clipping buffers, and aggregating buffers in the way the implementor sees fit.

It will also take care of event ordering (stream-start, segment, eos).

Basically, a simple implementation will override aggregate, and call _finish_buffer from inside that function.

Direct Known Subclasses

GstAudio::AudioAggregator

Instance Method Summary collapse

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, #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

#buffer_poolGst::BufferPool

by trans; free it after use it

Returns:

#emit_signals=(emit_signals) ⇒ Boolean

Enables the emission of signals such as Gst::Aggregator::samples-selected

Parameters:

  • emit_signals (Boolean)

Returns:

  • (Boolean)

    emit-signals

  • (Boolean)

    emit-signals

#emit_signals?Boolean

Enables the emission of signals such as Gst::Aggregator::samples-selected

Returns:

  • (Boolean)

    emit-signals

#finish_buffer(buffer) ⇒ Gst::FlowReturn

This method will push the provided output buffer downstream. If needed, mandatory events such as stream-start, caps, and segment events will be sent before pushing the buffer.

Parameters:

Returns:

#finish_buffer_list(bufferlist) ⇒ Gst::FlowReturn

This method will push the provided output buffer list downstream. If needed, mandatory events such as stream-start, caps, and segment events will be sent before pushing the buffer.

Parameters:

  • bufferlist (Gst::BufferList)

    the Gst::BufferList to push.

Returns:

#force_liveBoolean

Subclasses may use the return value to inform whether they should return %GST_FLOW_EOS from their aggregate implementation.

Returns:

  • (Boolean)

    whether live status was forced on self.

#force_live=(force_live) ⇒ nil

Subclasses should call this at construction time in order for self to aggregate on a timeout even when no live source is connected.

Parameters:

  • force_live (Boolean)

Returns:

  • (nil)

#get_allocator(allocator, params) ⇒ nil

Lets Gst::Aggregator sub-classes get the memory allocator acquired by the base class and its params.

Unref the allocator after use it. used Gst::AllocationParams of allocator

Parameters:

  • allocator (Gst::Allocator)

    the Gst::Allocator

  • params (Gst::AllocationParams)

    the

Returns:

  • (nil)

#ignore_inactive_padsBoolean

Returns whether inactive pads will not be waited on.

Returns:

  • (Boolean)

    whether inactive pads will not be waited on

#ignore_inactive_pads=(ignore) ⇒ nil

Subclasses should call this when they don't want to time out waiting for a pad that hasn't yet received any buffers in live mode.

Gst::Aggregator will still wait once on each newly-added pad, making sure upstream has had a fair chance to start up.

Parameters:

  • ignore (Boolean)

    whether inactive pads should not be waited on

Returns:

  • (nil)

#latencyInteger

Returns latency.

Returns:

  • (Integer)

    latency

#latency=(latency) ⇒ Integer

Parameters:

  • latency (Integer)

Returns:

  • (Integer)

    latency

  • (Integer)

    latency

#min_upstream_latencyInteger

Force minimum upstream latency (in nanoseconds). When sources with a higher latency are expected to be plugged in dynamically after the aggregator has started playing, this allows overriding the minimum latency reported by the initial source(s). This is only taken into account when larger than the actually reported minimum latency.

Returns:

  • (Integer)

    min-upstream-latency

#min_upstream_latency=(min_upstream_latency) ⇒ Integer

Force minimum upstream latency (in nanoseconds). When sources with a higher latency are expected to be plugged in dynamically after the aggregator has started playing, this allows overriding the minimum latency reported by the initial source(s). This is only taken into account when larger than the actually reported minimum latency.

Parameters:

  • min_upstream_latency (Integer)

Returns:

  • (Integer)

    min-upstream-latency

  • (Integer)

    min-upstream-latency

#negotiateBoolean

Negotiates src pad caps with downstream elements. Unmarks GST_PAD_FLAG_NEED_RECONFIGURE in any case. But marks it again if Gst::AggregatorClass::negotiate fails.

Returns:

  • (Boolean)

    true if the negotiation succeeded, else false.

#peek_next_sample(pad) ⇒ Gst::Sample

Use this function to determine what input buffers will be aggregated to produce the next output buffer. This should only be called from a Gst::Aggregator::samples-selected handler, and can be used to precisely control aggregating parameters for a given set of input samples.

Parameters:

Returns:

  • (Gst::Sample)

    The sample that is about to be aggregated. It may hold a Gst::Buffer or a Gst::BufferList. The contents of its info structure is subclass-dependent, and documented on a subclass basis. The buffers held by the sample are not writable.

#selected_samples(pts, dts, duration, info) ⇒ nil

Subclasses should call this when they have prepared the buffers they will aggregate for each of their sink pads, but before using any of the properties of the pads that govern how aggregation should be performed, for example z-index for video aggregators.

If gst_aggregator_update_segment() is used by the subclass, it MUST be called before gst_aggregator_selected_samples().

This function MUST only be called from the Gst::AggregatorClass::aggregate() function.

Parameters:

  • pts (Gst::ClockTime)

    The presentation timestamp of the next output buffer

  • dts (Gst::ClockTime)

    The decoding timestamp of the next output buffer

  • duration (Gst::ClockTime)

    The duration of the next output buffer

  • info (Gst::Structure)

    a Gst::Structure containing additional information

Returns:

  • (nil)

#set_latency(min_latency, max_latency) ⇒ nil

Lets Gst::Aggregator sub-classes tell the baseclass what their internal latency is. Will also post a LATENCY message on the bus so the pipeline can reconfigure its global latency if the values changed.

Parameters:

  • min_latency (Gst::ClockTime)

    minimum latency

  • max_latency (Gst::ClockTime)

    maximum latency

Returns:

  • (nil)

#simple_get_next_timeGst::ClockTime

This is a simple Gst::AggregatorClass::get_next_time implementation that just looks at the Gst::Segment on the srcpad of the aggregator and bases the next time on the running time there.

This is the desired behaviour in most cases where you have a live source and you have a dead line based aggregator subclass.

Returns:

  • (Gst::ClockTime)

    The running time based on the position

#src_caps=(caps) ⇒ nil

Sets the caps to be used on the src pad.

Parameters:

  • caps (Gst::Caps)

    The Gst::Caps to set on the src pad.

Returns:

  • (nil)

#start_timeInteger

Returns start-time.

Returns:

  • (Integer)

    start-time

#start_time=(start_time) ⇒ Integer

Parameters:

  • start_time (Integer)

Returns:

  • (Integer)

    start-time

  • (Integer)

    start-time

#start_time_selectionGstBase::AggregatorStartTimeSelection

Returns start-time-selection.

Returns:

#start_time_selection=(start_time_selection) ⇒ GstBase::AggregatorStartTimeSelection

Parameters:

Returns:

#update_segment(segment) ⇒ nil

Subclasses should use this to update the segment on their source pad, instead of directly pushing new segment events downstream.

Subclasses MUST call this before gst_aggregator_selected_samples(), if it is used at all.

Parameters:

  • segment (Gst::Segment)

Returns:

  • (nil)