Class: GstAudio::AudioEncoder
- Inherits:
-
Gst::Element
- Object
- GObject::InitiallyUnowned
- Gst::Object
- Gst::Element
- GstAudio::AudioEncoder
- Defined in:
- (unknown)
Overview
Subclasses can override any of the available virtual methods or not, as needed. At minimum set_format and handle_frame needs to be overridden.
Instance Method Summary collapse
-
#allocate_output_buffer(size) ⇒ Gst::Buffer
Helper function that allocates a buffer to hold an encoded audio frame for enc'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.
-
#drainable ⇒ Boolean
Queries encoder drain handling.
-
#drainable=(enabled) ⇒ nil
Configures encoder drain handling.
-
#finish_frame(buffer, samples) ⇒ Gst::FlowReturn
Collects encoded data and pushes encoded data downstream.
-
#frame_max ⇒ Integer
Currently configured maximum handled frames.
-
#frame_max=(num) ⇒ nil
Sets max number of frames accepted at once (assumed minimally 1).
-
#frame_samples_max ⇒ Integer
Currently maximum requested samples per frame.
-
#frame_samples_max=(num) ⇒ nil
Sets number of samples (per channel) subclass needs to be handed, at most or will be handed all available if 0.
-
#frame_samples_min ⇒ Integer
Currently minimum requested samples per frame.
-
#frame_samples_min=(num) ⇒ nil
Sets number of samples (per channel) subclass needs to be handed, at least or will be handed all available if 0.
-
#get_allocator(allocator, params) ⇒ nil
Lets Gst::AudioEncoder 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.
-
#hard_min ⇒ Boolean
Queries encoder hard minimum handling.
-
#hard_min=(enabled) ⇒ nil
Configures encoder hard minimum handling.
- #hard_resync ⇒ Boolean
- #hard_resync=(hard_resync) ⇒ Boolean
-
#hard_resync? ⇒ Boolean
Hard-resync.
-
#headers=(headers) ⇒ nil
Set the codec headers to be sent downstream whenever requested.
-
#lookahead ⇒ Integer
Currently configured encoder lookahead.
-
#lookahead=(num) ⇒ nil
Sets encoder lookahead (in units of input rate samples).
-
#mark_granule ⇒ Boolean
Queries if the encoder will handle granule marking.
- #mark_granule=(mark_granule) ⇒ Boolean
-
#mark_granule? ⇒ Boolean
Mark-granule.
-
#merge_tags(tags, mode) ⇒ nil
Sets the audio encoder tags and how they should be merged with any upstream stream tags.
-
#negotiate ⇒ Boolean
Negotiate with downstream elements to currently configured Gst::Caps.
-
#output_format=(caps) ⇒ Boolean
Configure output caps on the srcpad of enc.
-
#perfect_timestamp ⇒ Boolean
Queries encoder perfect timestamp behaviour.
- #perfect_timestamp=(perfect_timestamp) ⇒ Boolean
-
#perfect_timestamp? ⇒ Boolean
Perfect-timestamp.
-
#proxy_getcaps(caps, filter) ⇒ Gst::Caps
Returns caps that express caps (or sink template caps if caps == NULL) restricted to channel/rate combinations supported by downstream elements (e.g. muxers).
-
#set_latency(min, max) ⇒ nil
Sets encoder latency.
-
#tolerance ⇒ Integer
Tolerance.
- #tolerance=(tolerance) ⇒ Integer
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 encoded audio frame for enc'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_encoder_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.
#drainable ⇒ Boolean
Queries encoder drain handling. MT safe.
#drainable=(enabled) ⇒ nil
Configures encoder drain handling. If drainable, subclass might be handed a NULL buffer to have it return any leftover encoded data. Otherwise, it is not considered so capable and will only ever be passed real data.
MT safe.
#finish_frame(buffer, samples) ⇒ Gst::FlowReturn
Collects encoded data and pushes encoded data downstream. Source pad caps must be set when this is called.
If samples < 0, then best estimate is all samples provided to encoder (subclass) so far. buf may be NULL, in which case next number of samples are considered discarded, e.g. as a result of discontinuous transmission, and a discontinuity is marked.
Note that samples received in Gst::AudioEncoderClass.handle_frame() may be invalidated by a call to this function.
#frame_max ⇒ Integer
Returns currently configured maximum handled frames.
#frame_max=(num) ⇒ nil
Sets max number of frames accepted at once (assumed minimally 1). Requires frame_samples_min and frame_samples_max to be the equal.
Note: This value will be reset to 0 every time before Gst::AudioEncoderClass.set_format() is called.
#frame_samples_max ⇒ Integer
Returns currently maximum requested samples per frame.
#frame_samples_max=(num) ⇒ nil
Sets number of samples (per channel) subclass needs to be handed, at most or will be handed all available if 0.
If an exact number of samples is required, gst_audio_encoder_set_frame_samples_min() must be called with the same number.
Note: This value will be reset to 0 every time before Gst::AudioEncoderClass.set_format() is called.
#frame_samples_min ⇒ Integer
Returns currently minimum requested samples per frame.
#frame_samples_min=(num) ⇒ nil
Sets number of samples (per channel) subclass needs to be handed, at least or will be handed all available if 0.
If an exact number of samples is required, gst_audio_encoder_set_frame_samples_max() must be called with the same number.
Note: This value will be reset to 0 every time before Gst::AudioEncoderClass.set_format() is called.
#get_allocator(allocator, params) ⇒ nil
Lets Gst::AudioEncoder 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.
#hard_min ⇒ Boolean
Queries encoder hard minimum handling. MT safe.
#hard_min=(enabled) ⇒ nil
Configures encoder hard minimum handling. If enabled, subclass will never be handed less samples than it configured, which otherwise might occur near end-of-data handling. Instead, the leftover samples will simply be discarded.
MT safe.
#hard_resync ⇒ Boolean
#hard_resync=(hard_resync) ⇒ Boolean
#hard_resync? ⇒ Boolean
Returns hard-resync.
#headers=(headers) ⇒ nil
Set the codec headers to be sent downstream whenever requested.
#lookahead ⇒ Integer
Returns currently configured encoder lookahead.
#lookahead=(num) ⇒ nil
Sets encoder lookahead (in units of input rate samples)
Note: This value will be reset to 0 every time before Gst::AudioEncoderClass.set_format() is called.
#mark_granule ⇒ Boolean
Queries if the encoder will handle granule marking. MT safe.
#mark_granule=(mark_granule) ⇒ Boolean
#mark_granule? ⇒ Boolean
Returns mark-granule.
#merge_tags(tags, mode) ⇒ nil
Sets the audio encoder tags and how they should be merged with any upstream stream tags. This will override any tags previously-set with gst_audio_encoder_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.
MT safe.
#negotiate ⇒ Boolean
Negotiate with downstream elements to currently configured Gst::Caps. Unmark GST_PAD_FLAG_NEED_RECONFIGURE in any case. But mark it again if negotiate fails.
#output_format=(caps) ⇒ Boolean
Configure output caps on the srcpad of enc.
#perfect_timestamp ⇒ Boolean
Queries encoder perfect timestamp behaviour. MT safe.
#perfect_timestamp=(perfect_timestamp) ⇒ Boolean
#perfect_timestamp? ⇒ Boolean
Returns perfect-timestamp.
#proxy_getcaps(caps, filter) ⇒ Gst::Caps
Returns caps that express caps (or sink template caps if caps == NULL) restricted to channel/rate combinations supported by downstream elements (e.g. muxers).
#set_latency(min, max) ⇒ nil
Sets encoder 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.