Class: GstBase::BaseSrc
- Inherits:
-
Gst::Element
- Object
- GObject::InitiallyUnowned
- Gst::Object
- Gst::Element
- GstBase::BaseSrc
- Defined in:
- (unknown)
Overview
Subclasses can override any of the available virtual methods or not, as needed. At the minimum, the create method should be overridden to produce buffers.
Direct Known Subclasses
Instance Method Summary collapse
-
#async=(async) ⇒ nil
Configure async behaviour in src, no state change will block.
-
#automatic_eos=(automatic_eos) ⇒ Boolean
See gst_base_src_set_automatic_eos().
-
#automatic_eos? ⇒ Boolean
See gst_base_src_set_automatic_eos().
-
#blocksize ⇒ Integer
Blocksize.
- #blocksize=(blocksize) ⇒ Integer
-
#buffer_pool ⇒ Gst::BufferPool
by the src; unref it after usage.
-
#caps=(caps) ⇒ Boolean
Set new caps on the basesrc source pad.
-
#do_timestamp ⇒ Boolean
Query if src timestamps outgoing buffers based on the current running_time.
- #do_timestamp=(do_timestamp) ⇒ Boolean
-
#do_timestamp? ⇒ Boolean
Do-timestamp.
-
#dynamic_size=(dynamic) ⇒ nil
If not dynamic, size is only updated when needed, such as when trying to read past current tracked size.
-
#format=(format) ⇒ nil
Sets the default format of the source.
-
#get_allocator(allocator, params) ⇒ nil
Lets Gst::BaseSrc sub-classes to know the memory allocator used by the base class and its params.
-
#is_async ⇒ Boolean
Get the current async behaviour of src.
-
#is_live ⇒ Boolean
Check if an element is in live mode.
-
#live=(live) ⇒ nil
If the element listens to a live source, live should be set to true.
-
#negotiate ⇒ Boolean
Negotiates src pad caps with downstream elements.
-
#new_seamless_segment(start, stop, time) ⇒ Boolean
Prepare a new seamless segment for emission downstream.
-
#new_segment(segment) ⇒ Boolean
Prepare a new segment for emission downstream.
-
#num_buffers ⇒ Integer
Num-buffers.
- #num_buffers=(num_buffers) ⇒ Integer
-
#push_segment(segment) ⇒ Boolean
Send a new segment downstream.
-
#query_latency(live, min_latency, max_latency) ⇒ Boolean
Query the source for the latency parameters.
-
#start_complete(ret) ⇒ nil
Complete an asynchronous start operation.
-
#start_wait ⇒ Gst::FlowReturn
Wait until the start operation completes.
-
#submit_buffer_list(buffer_list) ⇒ nil
Subclasses can call this from their create virtual method implementation to submit a buffer list to be pushed out later.
- #typefind=(typefind) ⇒ Boolean
-
#typefind? ⇒ Boolean
Typefind.
-
#wait_playing ⇒ Gst::FlowReturn
If the Gst::BaseSrcClass::create 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 produce 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) ⇒ nil
Configure async behaviour in src, no state change will block. The open, close, start, stop, play and pause virtual methods will be executed in a different thread and are thus allowed to perform blocking operations. Any blocking operation should be unblocked with the unlock vmethod.
#automatic_eos=(automatic_eos) ⇒ Boolean
See gst_base_src_set_automatic_eos()
#automatic_eos? ⇒ Boolean
See gst_base_src_set_automatic_eos()
#blocksize ⇒ Integer
Returns blocksize.
#blocksize=(blocksize) ⇒ Integer
#buffer_pool ⇒ Gst::BufferPool
by the src; unref it after usage.
#caps=(caps) ⇒ Boolean
Set new caps on the basesrc source pad.
#do_timestamp ⇒ Boolean
Query if src timestamps outgoing buffers based on the current running_time.
#do_timestamp=(do_timestamp) ⇒ Boolean
#do_timestamp? ⇒ Boolean
Returns do-timestamp.
#dynamic_size=(dynamic) ⇒ nil
If not dynamic, size is only updated when needed, such as when trying to read past current tracked size. Otherwise, size is checked for upon each read.
#format=(format) ⇒ nil
Sets the default format of the source. This will be the format used for sending SEGMENT events and for performing seeks.
If a format of GST_FORMAT_BYTES is set, the element will be able to operate in pull mode if the Gst::BaseSrcClass::is_seekable returns true.
This function must only be called in states < %GST_STATE_PAUSED.
#get_allocator(allocator, params) ⇒ nil
Lets Gst::BaseSrc sub-classes to know the memory allocator used by the base class and its params.
Unref the allocator after usage. used
#is_async ⇒ Boolean
Get the current async behaviour of src. See also gst_base_src_set_async().
#is_live ⇒ Boolean
Check if an element is in live mode.
#live=(live) ⇒ nil
If the element listens to a live source, live should be set to true.
A live source will not produce data in the PAUSED state and will therefore not be able to participate in the PREROLL phase of a pipeline. To signal this fact to the application and the pipeline, the state change return value of the live source will be GST_STATE_CHANGE_NO_PREROLL.
#negotiate ⇒ Boolean
Negotiates src pad caps with downstream elements. Unmarks GST_PAD_FLAG_NEED_RECONFIGURE in any case. But marks it again if Gst::BaseSrcClass::negotiate fails.
Do not call this in the Gst::BaseSrcClass::fill vmethod. Call this in Gst::BaseSrcClass::create or in #GstBaseSrcClass::alloc, before any buffer is allocated.
#new_seamless_segment(start, stop, time) ⇒ Boolean
Prepare a new seamless segment for emission downstream. This function must only be called by derived sub-classes, and only from the Gst::BaseSrcClass::create function, as the stream-lock needs to be held.
The format for the new segment will be the current format of the source, as configured with gst_base_src_set_format()
#new_segment(segment) ⇒ Boolean
Prepare a new segment for emission downstream. This function must only be called by derived sub-classes, and only from the Gst::BaseSrcClass::create function, as the stream-lock needs to be held.
The format for the segment must be identical with the current format of the source, as configured with gst_base_src_set_format().
The format of src must not be %GST_FORMAT_UNDEFINED and the format should be configured via gst_base_src_set_format() before calling this method.
#num_buffers ⇒ Integer
Returns num-buffers.
#num_buffers=(num_buffers) ⇒ Integer
#push_segment(segment) ⇒ Boolean
Send a new segment downstream. This function must only be called by derived sub-classes, and only from the Gst::BaseSrcClass::create function, as the stream-lock needs to be held. This method also requires that an out caps has been configured, so gst_base_src_set_caps() needs to have been called before.
The format for the segment must be identical with the current format of the source, as configured with gst_base_src_set_format().
The format of src must not be %GST_FORMAT_UNDEFINED and the format should be configured via gst_base_src_set_format() before calling this method.
This is a variant of gst_base_src_new_segment() sending the segment right away, which can be useful to ensure events ordering.
#query_latency(live, min_latency, max_latency) ⇒ Boolean
Query the source for the latency parameters. live will be true when src is configured as a live source. min_latency and max_latency will be set to the difference between the running time and the timestamp of the first buffer.
This function is mostly used by subclasses.
#start_complete(ret) ⇒ nil
Complete an asynchronous start operation. When the subclass overrides the start method, it should call gst_base_src_start_complete() when the start operation completes either from the same thread or from an asynchronous helper thread.
#start_wait ⇒ Gst::FlowReturn
Wait until the start operation completes.
#submit_buffer_list(buffer_list) ⇒ nil
Subclasses can call this from their create virtual method implementation to submit a buffer list to be pushed out later. This is useful in cases where the create function wants to produce multiple buffers to be pushed out in one go in form of a Gst::BufferList, which can reduce overhead drastically, especially for packetised inputs (for data streams where the packetisation/chunking is not important it is usually more efficient to return larger buffers instead).
Subclasses that use this function from their create function must return %GST_FLOW_OK and no buffer from their create virtual method implementation. If a buffer is returned after a buffer list has also been submitted via this function the behaviour is undefined.
Subclasses must only call this function once per create function call and subclasses must only call this function when the source operates in push mode.
#typefind=(typefind) ⇒ Boolean
#typefind? ⇒ Boolean
Returns typefind.
#wait_playing ⇒ Gst::FlowReturn
If the Gst::BaseSrcClass::create 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 produce the remaining data.
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). continue. Any other return value should be returned from the create vmethod.