Class: GstAudio::AudioDecoder
- Inherits:
-
Gst::Element
- Object
- GObject::InitiallyUnowned
- Gst::Object
- Gst::Element
- GstAudio::AudioDecoder
- Defined in:
- (unknown)
Overview
Subclasses can override any of the available virtual methods or not, as
needed. At minimum handle_frame (and likely set_format) needs to be
overridden.
Instance Method Summary collapse
-
#allocate_output_buffer(size) ⇒ Gst::Buffer
Helper function that allocates a buffer to hold an audio frame for dec's current output format.
-
#allocation_caps=(allocation_caps) ⇒ nil
Sets a caps in allocation query which are different from the set pad's caps.
-
#audio_info ⇒ GstAudio::AudioInfo
A Gst::AudioInfo describing the input audio format.
-
#delay ⇒ Integer
Currently configured decoder delay.
-
#drainable ⇒ Boolean
Queries decoder drain handling.
-
#drainable=(enabled) ⇒ nil
Configures decoder drain handling.
-
#estimate_rate ⇒ Integer
Currently configured byte to time conversion setting.
-
#estimate_rate=(enabled) ⇒ nil
Allows baseclass to perform byte to time estimated conversion.
-
#finish_frame(buf, frames) ⇒ Gst::FlowReturn
Collects decoded data and pushes it downstream.
-
#finish_subframe(buf) ⇒ Gst::FlowReturn
Collects decoded data and pushes it downstream.
-
#get_allocator(allocator, params) ⇒ nil
Lets Gst::AudioDecoder sub-classes to know the memory allocator used by the base class and its params.
-
#get_latency(min, max) ⇒ nil
Sets the variables pointed to by min and max to the currently configured latency.
-
#get_parse_state(sync, eos) ⇒ nil
Return current parsing (sync and eos) state.
-
#max_errors ⇒ Integer
Maximum number of tolerated consecutive decode errors.
-
#max_errors=(max_errors) ⇒ Integer
Maximum number of tolerated consecutive decode errors.
-
#merge_tags(tags, mode) ⇒ nil
Sets the audio decoder tags and how they should be merged with any upstream stream tags.
-
#min_latency ⇒ Integer
Min-latency.
- #min_latency=(min_latency) ⇒ Integer
-
#needs_format ⇒ Boolean
Queries decoder required format handling.
-
#needs_format=(enabled) ⇒ nil
Configures decoder format needs.
-
#negotiate ⇒ Boolean
Negotiate with downstream elements to currently configured Gst::AudioInfo.
-
#output_caps=(caps) ⇒ Boolean
Configure output caps on the srcpad of dec.
-
#output_format=(info) ⇒ Boolean
Configure output info on the srcpad of dec.
-
#plc ⇒ Boolean
Queries decoder packet loss concealment handling.
- #plc=(plc) ⇒ Boolean
-
#plc? ⇒ Boolean
Plc.
-
#plc_aware ⇒ Integer
Currently configured plc handling.
-
#plc_aware=(plc) ⇒ nil
Indicates whether or not subclass handles packet loss concealment (plc).
-
#proxy_getcaps(caps, filter) ⇒ Gst::Caps
Returns caps that express caps (or sink template caps if caps == NULL) restricted to rate/channels/...
-
#set_latency(min, max) ⇒ nil
Sets decoder latency.
-
#tolerance ⇒ Integer
Tolerance.
- #tolerance=(tolerance) ⇒ Integer
-
#use_default_pad_acceptcaps=(use) ⇒ nil
Lets Gst::AudioDecoder sub-classes decide if they want the sink pad to use the default pad query handler to reply to accept-caps queries.
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
#allocate_output_buffer(size) ⇒ Gst::Buffer
Helper function that allocates a buffer to hold an audio frame
for dec's current output format.
#allocation_caps=(allocation_caps) ⇒ nil
Sets a caps in allocation query which are different from the set
pad's caps. Use this function before calling
gst_audio_decoder_negotiate(). Setting to nil the allocation
query will use the caps from the pad.
#audio_info ⇒ GstAudio::AudioInfo
Returns a Gst::AudioInfo describing the input audio format.
#delay ⇒ Integer
Returns currently configured decoder delay.
#drainable ⇒ Boolean
Queries decoder drain handling.
MT safe.
#drainable=(enabled) ⇒ nil
Configures decoder drain handling. If drainable, subclass might
be handed a NULL buffer to have it return any leftover decoded data.
Otherwise, it is not considered so capable and will only ever be passed
real data.
MT safe.
#estimate_rate ⇒ Integer
Returns currently configured byte to time conversion setting.
#estimate_rate=(enabled) ⇒ nil
Allows baseclass to perform byte to time estimated conversion.
#finish_frame(buf, frames) ⇒ Gst::FlowReturn
Collects decoded data and pushes it downstream.
buf may be NULL in which case the indicated number of frames
are discarded and considered to have produced no output
(e.g. lead-in or setup frames).
Otherwise, source pad caps must be set when it is called with valid
data in buf.
Note that a frame received in Gst::AudioDecoderClass.handle_frame() may be
invalidated by a call to this function.
#finish_subframe(buf) ⇒ Gst::FlowReturn
Collects decoded data and pushes it downstream. This function may be called
multiple times for a given input frame.
buf may be NULL in which case it is assumed that the current input frame is
finished. This is equivalent to calling gst_audio_decoder_finish_subframe()
with a NULL buffer and frames=1 after having pushed out all decoded audio
subframes using this function.
When called with valid data in buf the source pad caps must have been set
already.
Note that a frame received in Gst::AudioDecoderClass.handle_frame() may be
invalidated by a call to this function.
#get_allocator(allocator, params) ⇒ nil
Lets Gst::AudioDecoder sub-classes to know the memory allocator
used by the base class and its params.
Unref the allocator after use it.
used
Gst::AllocationParams of allocator
#get_latency(min, max) ⇒ nil
Sets the variables pointed to by min and max to the currently configured
latency.
#get_parse_state(sync, eos) ⇒ nil
Return current parsing (sync and eos) state.
#max_errors ⇒ Integer
Maximum number of tolerated consecutive decode errors. See
gst_audio_decoder_set_max_errors() for more details.
#max_errors=(max_errors) ⇒ Integer
Maximum number of tolerated consecutive decode errors. See
gst_audio_decoder_set_max_errors() for more details.
#merge_tags(tags, mode) ⇒ nil
Sets the audio decoder tags and how they should be merged with any
upstream stream tags. This will override any tags previously-set
with gst_audio_decoder_merge_tags().
Note that this is provided for convenience, and the subclass is
not required to use this and can still do tag handling on its own.
#min_latency ⇒ Integer
Returns min-latency.
#min_latency=(min_latency) ⇒ Integer
#needs_format ⇒ Boolean
Queries decoder required format handling.
MT safe.
#needs_format=(enabled) ⇒ nil
Configures decoder format needs. If enabled, subclass needs to be
negotiated with format caps before it can process any data. It will then
never be handed any data before it has been configured.
Otherwise, it might be handed data without having been configured and
is then expected being able to do so either by default
or based on the input data.
MT safe.
#negotiate ⇒ Boolean
Negotiate with downstream elements to currently configured Gst::AudioInfo.
Unmark GST_PAD_FLAG_NEED_RECONFIGURE in any case. But mark it again if
negotiate fails.
#output_caps=(caps) ⇒ Boolean
Configure output caps on the srcpad of dec. Similar to
gst_audio_decoder_set_output_format(), but allows subclasses to specify
output caps that can't be expressed via Gst::AudioInfo e.g. caps that have
caps features.
#output_format=(info) ⇒ Boolean
Configure output info on the srcpad of dec.
#plc ⇒ Boolean
Queries decoder packet loss concealment handling.
MT safe.
#plc=(plc) ⇒ Boolean
#plc? ⇒ Boolean
Returns plc.
#plc_aware ⇒ Integer
Returns currently configured plc handling.
#plc_aware=(plc) ⇒ nil
Indicates whether or not subclass handles packet loss concealment (plc).
#proxy_getcaps(caps, filter) ⇒ Gst::Caps
Returns caps that express caps (or sink template caps if caps == NULL)
restricted to rate/channels/... combinations supported by downstream
elements.
#set_latency(min, max) ⇒ nil
Sets decoder latency. If the provided values changed from
previously provided ones, this will also post a LATENCY message on the bus
so the pipeline can reconfigure its global latency.
#tolerance ⇒ Integer
Returns tolerance.
#tolerance=(tolerance) ⇒ Integer
#use_default_pad_acceptcaps=(use) ⇒ nil
Lets Gst::AudioDecoder sub-classes decide if they want the sink pad
to use the default pad query handler to reply to accept-caps queries.
By setting this to true it is possible to further customize the default
handler with %GST_PAD_SET_ACCEPT_INTERSECT and
%GST_PAD_SET_ACCEPT_TEMPLATE