gstreamermm: Gst::BaseTransform Class Reference

gstreamermm 1.10.0

Public Member Functions | Static Public Member Functions | Static Public Attributes | Related Functions | List of all members
Gst::BaseTransform Class Reference
gstreamermm Base Classes

A base class for simple transform filters. More...

`#include <gstreamermm/basetransform.h>`

Inheritance diagram for Gst::BaseTransform:
[legend]

## Public Member Functions
| BaseTransform (BaseTransform&& src) noexcept
BaseTransform& | operator= (BaseTransform&& src) noexcept
| ~BaseTransform () noexcept override
GstBaseTransform* | gobj ()
| Provides access to the underlying C GObject. More...
const GstBaseTransform* | gobj () const
| Provides access to the underlying C GObject. More...
GstBaseTransform* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
bool | is_passthrough () const
| See if trans is configured as a passthrough transform. More...
void | set_passthrough (bool passthrough)
| Set passthrough mode for this filter by default. More...
bool | is_in_place () const
| See if trans is configured as a in_place transform. More...
void | set_in_place (bool in_place)
| Determines whether a non-writable buffer will be copied before passing to the transform_ip function. More...
bool | is_qos_enabled () const
| Queries if the transform will handle QoS. More...
void | set_qos_enabled (bool enabled)
| Enable or disable QoS handling in the transform. More...
void | update_qos (double proportion, Gst::ClockTimeDiff diff, Gst::ClockTime timestamp)
| Set the QoS parameters in the transform. More...
void | set_gap_aware (bool gap_aware)
| If gap_aware is `false` (the default), output buffers will have the Gst::BUFFER_FLAG_GAP flag unset. More...
void | reconfigure_sink ()
| Instructs trans to request renegotiation upstream. More...
void | reconfigure_src ()
| Instructs trans to renegotiate a new downstream transform on the next buffer. More...
void | set_prefer_passthrough (bool prefer_passthrough)
| If prefer_passthrough is `true` (the default), trans will check and prefer passthrough caps from the list of caps returned by the transform_caps vmethod. More...
bool | update_src_caps (const Glib::RefPtr< Gst::Caps >& updated_caps)
| Updates the srcpad caps and send the caps downstream. More...
Glib::RefPtr< Gst::Allocator > | get_allocator (Gst::AllocationParams& params)
Glib::RefPtr< Gst::Pad > | get_sink_pad ()
| Gives the refptr to the sink Gst::Pad object of the element. More...
Glib::RefPtr< const Gst::Pad > | get_sink_pad () const
Glib::RefPtr< Gst::Pad > | get_src_pad ()
| Gives the refptr to the source Gst::Pad object of the element. More...
Glib::RefPtr< const Gst::Pad > | get_src_pad () const
Glib::PropertyProxy< bool > | property_qos ()
| Handle Quality-of-Service events. More...
Glib::PropertyProxy_ReadOnly< bool > | property_qos () const
| Handle Quality-of-Service events. More...
virtual Glib::RefPtr< Gst::Caps > | transform_caps_vfunc (PadDirection direction, const Glib::RefPtr< Gst::Caps >& caps, const Glib::RefPtr< Gst::Caps >& filter)
| Optional. More...
virtual Glib::RefPtr< Gst::Caps > | fixate_caps_vfunc (PadDirection direction, const Glib::RefPtr< Gst::Caps >& caps, const Glib::RefPtr< Gst::Caps >& othercaps)
| Optional. More...
virtual bool | get_unit_size_vfunc (const Glib::RefPtr< Gst::Caps >& caps, gsize&size) const
| Optional. More...
virtual bool | set_caps_vfunc (const Glib::RefPtr< Gst::Caps >& incaps, const Glib::RefPtr< Gst::Caps >& outcaps)
| Allows the subclass to be notified of the actual caps set. More...
virtual FlowReturn | transform_vfunc (const Glib::RefPtr< Gst::Buffer >& inbuf, const Glib::RefPtr< Gst::Buffer >& outbuf)
| Required if the element does not operate in-place. More...
virtual FlowReturn | transform_ip_vfunc (const Glib::RefPtr< Gst::Buffer >& buf)
| Required if the element operates in-place. More...
virtual FlowReturn | prepare_output_buffer_vfunc (const Glib::RefPtr< Gst::Buffer >& input, Glib::RefPtr< Gst::Buffer >& buffer)
| Optional. More...
virtual bool | src_event_vfunc (const Glib::RefPtr< Gst::Event >& event)
| Optional. More...
virtual bool | sink_event_vfunc (const Glib::RefPtr< Gst::Event >& event)
| Optional. More...
virtual void | before_transform_vfunc (const Glib::RefPtr< Gst::Buffer >& buffer)
| Optional. More...
virtual bool | accept_caps_vfunc (PadDirection direction, const Glib::RefPtr< const Gst::Caps >& caps)
| Optional. More...
virtual bool | start_vfunc ()
| Optional. More...
virtual bool | stop_vfunc ()
| Optional. More...
virtual bool | decide_allocation_vfunc (const Glib::RefPtr< Gst::Query >&query)
| Setup the allocation parameters for allocating output buffers. More...
virtual bool | filter_meta_vfunc (const Glib::RefPtr< Gst::Query >&query, GType api, const Gst::Structure& params)
| Return TRUE if the metadata API should be proposed in the upstream allocation query. More...
virtual bool | propose_allocation_vfunc (const Glib::RefPtr< Gst::Query >& decide_query, const Glib::RefPtr< Gst::Query >&query)
| Propose buffer allocation parameters for upstream elements. More...
virtual Gst::FlowReturn | submit_input_buffer_vfunc (bool is_discont, const Glib::RefPtr< Gst::Buffer >& input)
| Function which accepts a new input buffer and pre-processes it. More...
virtual Gst::FlowReturn | generate_output_vfunc (Glib::RefPtr< Gst::Buffer >& buffer)
| Called after each new input buffer is submitted repeatedly until it either generates an error or fails to generate an output buffer. More...
virtual bool | copy_metadata_vfunc (const Glib::RefPtr< Gst::Buffer >& input, const Glib::RefPtr< Gst::Buffer >& outbuf)
| Optional. More...
bool | base_transform_query_vfunc (Gst::PadDirection direction, const Glib::RefPtr< Gst::Query >&query)
| Optional. More...
Public Member Functions inherited from Gst::Element
| Element (Element&& src) noexcept
Element& | operator= (Element&& src) noexcept
| ~Element () noexcept override
GstElement* | gobj ()
| Provides access to the underlying C GObject. More...
const GstElement* | gobj () const
| Provides access to the underlying C GObject. More...
GstElement* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
Glib::RefPtr< Gst::Element > | link (const Glib::RefPtr< Gst::Element >& dest)
| Links this source element to the dest element. More...
bool | add_pad (const Glib::RefPtr< Gst::Pad >& pad)
| Adds a pad (link point) to element. More...
void | create_all_pads ()
| Creates a pad for each pad template that is always available. More...
Glib::RefPtr< Gst::Pad > | create_compatible_pad (const Glib::RefPtr< const Gst::Pad >& pad, const Glib::RefPtr< const Gst::Caps >& caps)
| Looks for an unlinked pad to which the given pad can link. More...
Glib::RefPtr< Gst::PadTemplate > | get_compatible_pad_template (const Glib::RefPtr< const Gst::PadTemplate >& compattempl)
| Retrieves a pad template from element that is compatible with compattempl. More...
Glib::RefPtr< const Gst::PadTemplate > | get_compatible_pad_template (const Glib::RefPtr< const Gst::PadTemplate >& compattempl) const
| Retrieves a pad template from element that is compatible with compattempl. More...
Glib::RefPtr< Gst::Pad > | get_request_pad (const Glib::ustring& name)
| Retrieves a pad from the element by name (e.g. "src_\\%d"). More...
Glib::RefPtr< Gst::Pad > | request_pad (const Glib::RefPtr< Gst::PadTemplate >& templ, const Glib::ustring& name, const Glib::RefPtr< const Gst::Caps >& caps)
| Retrieves a request pad from the element according to the provided template. More...
Glib::RefPtr< Gst::Pad > | request_pad (const Glib::RefPtr< Gst::PadTemplate >& templ, const Glib::ustring& name)
| A request_pad() convenience overload. More...
Glib::RefPtr< Gst::Pad > | request_pad (const Glib::RefPtr< Gst::PadTemplate >& templ, const Glib::RefPtr< const Gst::Caps >& caps)
| A request_pad() convenience overload. More...
Glib::RefPtr< Gst::Pad > | request_pad (const Glib::RefPtr< Gst::PadTemplate >& templ)
| A request_pad() convenience overload. More...
Glib::RefPtr< Gst::Pad > | get_static_pad (const Glib::ustring& name)
| Retrieves a pad from element by name. More...
Glib::RefPtr< const Gst::Pad > | get_static_pad (const Glib::ustring& name) const
| Retrieves a pad from element by name. More...
void | no_more_pads ()
| Use this function to signal that the element does not expect any more pads to show up in the current pipeline. More...
void | release_request_pad (const Glib::RefPtr< Gst::Pad >& pad)
| Makes the element free the previously requested pad as obtained with get_request_pad(). More...
bool | remove_pad (const Glib::RefPtr< Gst::Pad >& pad)
| Removes pad from element. More...
Gst::Iterator< Gst::Pad > | iterate_pads ()
| Retrieves an iterator of element's pads. More...
Gst::Iterator< const Gst::Pad > | iterate_pads () const
| Retrieves an iterator of element's pads. More...
Gst::Iterator< Gst::Pad > | iterate_sink_pads ()
| Retrieves an iterator of element's sink pads. More...
Gst::Iterator< const Gst::Pad > | iterate_sink_pads () const
| Retrieves an iterator of element's sink pads. More...
Gst::Iterator< Gst::Pad > | iterate_src_pads ()
| Retrieves an iterator of element's source pads. More...
Gst::Iterator< const Gst::Pad > | iterate_src_pads () const
| Retrieves an iterator of element's source pads. More...
void | unlink (const Glib::RefPtr< Gst::Element >& dest)
| Unlinks all source pads of the source element with all sink pads of the sink element to which they are linked. More...
void | set_context (const Glib::RefPtr< Gst::Context >& context)
| Sets the context of the element. More...
bool | link_pads (const Glib::ustring& srcpadname, const Glib::RefPtr< Gst::Element >& dest, const Glib::ustring& destpadname)
| Links the two named pads of the source and destination elements. More...
void | unlink_pads (const Glib::ustring& srcpadname, const Glib::RefPtr< Gst::Element >& dest, const Glib::ustring& destpadname)
| Unlinks the two named pads of the source and destination elements. More...
bool | link_pads (const Glib::ustring& srcpadname, const Glib::RefPtr< Gst::Element >& dest, const Glib::ustring& destpadname, const Glib::RefPtr< Gst::Caps >& filter)
| Links the two named pads of the source and destination elements. More...
bool | link_pads (const Glib::ustring& srcpadname, const Glib::RefPtr< Gst::Element >& dest, const Glib::ustring& destpadname, PadLinkCheck flags)
| Links the two named pads of the source and destination elements. More...
Glib::RefPtr< Gst::Element > | link (const Glib::RefPtr< Gst::Element >& dest, const Glib::RefPtr< Gst::Caps >& filter)
| Links src to dest using the given caps as filtercaps. More...
void | set_base_time (ClockTime time)
| Set the base time of an element. More...
ClockTime | get_base_time () const
| Returns the base time of the element. More...
void | set_start_time (Gst::ClockTime time)
| Set the start time of an element. More...
Gst::ClockTime | get_start_time () const
| Returns the start time of the element. More...
void | set_bus (const Glib::RefPtr< Gst::Bus >& bus)
| Sets the bus of the element. More...
Glib::RefPtr< Gst::Bus > | get_bus ()
| Returns the bus of the element. More...
Glib::RefPtr< const Gst::Bus > | get_bus () const
| Returns the bus of the element. More...
Glib::RefPtr< Gst::ElementFactory > | get_factory ()
| Retrieves the factory that was used to create this element. More...
Glib::RefPtr< const Gst::ElementFactory > | get_factory () const
| Retrieves the factory that was used to create this element. More...
bool | set_clock (const Glib::RefPtr< Gst::Clock >& clock)
| Sets the clock for the element. More...
Glib::RefPtr< Gst::Clock > | get_clock ()
| Gets the currently configured clock of the element. More...
Glib::RefPtr< const Gst::Clock > | get_clock () const
| Gets the currently configured clock of the element. More...
Glib::RefPtr< Gst::Clock > | provide_clock ()
| Get the clock provided by the given element. More...
Glib::RefPtr< const Gst::Clock > | provide_clock () const
| Get the clock provided by the given element. More...
StateChangeReturn | set_state (State state)
| Sets the state of the element. More...
StateChangeReturn | get_state (State& state, State& pending, ClockTime timeout) const
| Gets the state of the element. More...
bool | set_locked_state (gboolean locked_state)
| Locks the state of an element, so state changes of the parent don't affect this element anymore. More...
bool | is_locked_state () const
| Checks if the state of an element is locked. More...
void | abort_state ()
| Abort the state change of the element. More...
StateChangeReturn | continue_state (StateChangeReturn ret)
| Commit the state change of the element and proceed to the next pending state if any. More...
void | lost_state ()
| Brings the element to the lost state. More...
bool | sync_state_with_parent ()
| Tries to change the state of the element to the same as its parent. More...
StateChangeReturn | change_state (StateChange transition)
| Perform transition on element. More...
void | post_message (int code, int line, MessageType type=Gst::MESSAGE_INFO, const Glib::QueryQuark& domain=get_core_error_quark(), const Glib::ustring& text=Glib::ustring(), const Glib::ustring& debug=Glib::ustring(), const Glib::ustring& file=Glib::ustring(), const Glib::ustring& function=Glib::ustring())
| Post an error, warning or info message on the bus from inside an element. More...
bool | post_message (Glib::RefPtr< Gst::Message >&& message)
| Post a message on the element's Gst::Bus. More...
bool | query (const Glib::RefPtr< Gst::Query >& query) const
| Performs a query on the given element. More...
bool | query_convert (Gst::Format src_format, gint64 src_val, Format dest_format, gint64& dest_val) const
| Queries an element to convert src_val in src_format to dest_format. More...
bool | query_position (Gst::Format format, gint64& cur) const
| Queries an element (usually top-level pipeline or playbin element) for the stream position in nanoseconds. More...
bool | query_position (Gst::Format format) const
| A query_position() convenience overload. More...
bool | query_duration (Gst::Format format, gint64& duration) const
| Queries an element (usually top-level pipeline or playbin element) for the total stream duration in nanoseconds. More...
bool | query_duration (Gst::Format format) const
| A query_duration() convenience overload. More...
bool | seek (Format format, SeekFlags seek_flags, gint64 seek_pos)
| Simple API to perform a seek on the given element, meaning it just seeks to the given position relative to the start of the stream. More...
bool | seek (double rate, Format format, SeekFlags flags, SeekType cur_type, gint64 cur, SeekType stop_type, gint64 stop)
| Sends a seek event to an element. More...
bool | send_event (Glib::RefPtr< Gst::Event >&& event)
| Sends an event to an element. More...
bool | send_event (const Glib::RefPtr< Gst::Event >& event)
| A send_event() convenience overload. Allows to re-use event parameter after function call. More...
Glib::RefPtr< Gst::Context > | get_context (const Glib::ustring& context_type)
| Gets the context with context_type set on the element or `nullptr`. More...
Glib::RefPtr< Gst::Context > | get_context_unlocked (const Glib::ustring& context_type)
| Gets the context with context_type set on the element or `nullptr`. More...
std::vector< Glib::RefPtr< Gst::Context > > | get_contexts ()
| Gets the contexts set on the element. More...
Glib::SignalProxy< void > | signal_no_more_pads ()
Glib::SignalProxy< void, const Glib::RefPtr< Gst::Pad >&> | signal_pad_added ()
Glib::SignalProxy< void, const Glib::RefPtr< Gst::Pad >&> | signal_pad_removed ()
virtual void | release_pad_vfunc (const Glib::RefPtr< Gst::Pad >& pad)
| Called when a request pad is to be released. More...
virtual Glib::RefPtr< Gst::Pad > | request_new_pad_vfunc (Glib::RefPtr< Gst::PadTemplate > templ, const Glib::ustring& name, const Glib::RefPtr< const Gst::Caps >& caps)
| Called when a new pad is requested. More...
virtual StateChangeReturn | get_state_vfunc (State& state, State& pending, ClockTime timeout) const
| Get the state of the element. More...
virtual StateChangeReturn | set_state_vfunc (State state)
| Set a new state on the element. More...
virtual StateChangeReturn | change_state_vfunc (StateChange transition)
| Called by set_state to perform an incremental state change. More...
virtual void | state_changed_vfunc (Gst::State oldstate, Gst::State newstate, Gst::State pending)
| Called immediately after a new state was set. More...
virtual void | set_bus_vfunc (const Glib::RefPtr< Gst::Bus >& bus)
| Set a Gst::Bus on the element. More...
virtual Glib::RefPtr< Gst::Clock > | provide_clock_vfunc ()
| Gets the Gst::Clock provided by the element. More...
virtual bool | set_clock_vfunc (const Glib::RefPtr< Gst::Clock >& clock)
| Set the Gst::Clock on the element. More...
virtual bool | send_event_vfunc (const Glib::RefPtr< Gst::Event >& event)
| Send a Gst::Event to the element. More...
virtual bool | query_vfunc (const Glib::RefPtr< Gst::Query >&query) const
| Perform a Gst::Query on the element. More...
virtual void | set_context_vfunc (const Glib::RefPtr< Gst::Context >& context)
| Set a Gst::Context on the element. More...
virtual bool | post_message_vfunc (const Glib::RefPtr< Gst::Message >& message)
| Called when a message is posted on the element. More...
Glib::RefPtr< Gst::PadTemplate > | get_pad_template (const Glib::ustring& factory_name) const
template<typename T >
Glib::RefPtr< Gst::Element > | property (const Glib::ustring& name, const T& value)
| Sets specified property. More...
Public Member Functions inherited from Gst::Object
| Object (Object&& src) noexcept
Object& | operator= (Object&& src) noexcept
| ~Object () noexcept override
GstObject* | gobj ()
| Provides access to the underlying C GObject. More...
const GstObject* | gobj () const
| Provides access to the underlying C GObject. More...
GstObject* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
bool | is_element () const
bool | is_element_factory () const
bool | is_pad () const
bool | is_pad_template () const
bool | is_bin () const
guint32 | get_flags () const
| Returns the entire set of flags for the object. More...
bool | set_name (const Glib::ustring& name)
| Sets the name of object, or gives object a guaranteed unique name (if name is `nullptr`). More...
Glib::ustring | get_name () const
| Returns a copy of the name of object. More...
bool | set_parent (const Glib::RefPtr< Gst::Object >& parent)
| Sets the parent of object to parent. More...
Glib::RefPtr< Gst::Object > | get_parent ()
| Returns the parent of object. More...
Glib::RefPtr< const Gst::Object > | get_parent () const
| Returns the parent of object. More...
void | unparent ()
| Clear the parent of object, removing the associated reference. More...
void | set_control_rate (Gst::ClockTime control_rate)
| Change the control-rate for this object. More...
Gst::ClockTime | get_control_rate () const
| Obtain the control-rate for this object. More...
Gst::ClockTime | suggest_next_sync () const
| Returns a suggestion for timestamps where buffers should be split to get best controller results. More...
bool | sync_values (Gst::ClockTime timestamp)
| Sets the properties of the object, according to the Gst::ControlSources that (maybe) handle them and for the given timestamp. More...
void | set_control_bindings_disabled (bool disabled)
| This function is used to disable all controlled properties of the object for some time, i.e. sync_values() will do nothing. More...
bool | has_asctive_control_bindings () const
| Check if the object has an active controlled properties. More...
bool | has_ancestor (const Glib::RefPtr< const Gst::Object >& ancestor) const
| Check if object has an ancestor ancestor somewhere up in the hierarchy. More...
bool | has_as_ancestor (const Glib::RefPtr< Gst::Object >& ancestor) const
| Check if object has an ancestor ancestor somewhere up in the hierarchy. More...
bool | has_as_parent (const Glib::RefPtr< Gst::Object >& parent) const
| Check if parent is the parent of object. More...
Glib::ustring | get_path_string ()
| Generates a string describing the path of object in the object hierarchy. More...
Glib::PropertyProxy< Glib::ustring > | property_name ()
| The name of the object. More...
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_name () const
| The name of the object. More...
Glib::PropertyProxy< Glib::RefPtr< Gst::Object > > | property_parent ()
| The parent of the object. More...
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gst::Object > > | property_parent () const
| The parent of the object. More...
Glib::SignalProxy< void, const Glib::RefPtr< Gst::Object >&, GParamSpec*> | signal_deep_notify ()
int | get_refcount () const

## Static Public Member Functions
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
Static Public Member Functions inherited from Gst::Element
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
Static Public Member Functions inherited from Gst::Object
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static bool | check_uniqueness (const Glib::ListHandle< const Gst::Object >& list, const Glib::ustring& name)
| Checks to see if there is any object named name in list. More...

## Static Public Attributes
static const Glib::ustring | SINK_NAME
| The name of the templates for the sink pad ("sink"). More...
static const Glib::ustring | SRC_NAME
| The name of the templates for the source pad ("src"). More...
static constexpr Gst::FlowReturn | FLOW_DROPPED = static_cast<Gst::FlowReturn>(GST_BASE_TRANSFORM_FLOW_DROPPED)
| A Gst::FlowReturn that can be returned from transform_vfunc and transform_ip_vfunc to indicate that no output buffer was generated. More...

## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gst::BaseTransform > | wrap (GstBaseTransform* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...
Related Functions inherited from Gst::Element
Glib::RefPtr< Gst::Element > | wrap (GstElement* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...
Related Functions inherited from Gst::Object
Glib::RefPtr< Gst::Object > | wrap (GstObject* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Additional Inherited Members
Protected Member Functions inherited from Gst::Element
virtual void | on_no_more_pads ()
| This is a default handler for the signal signal_no_more_pads(). More...
virtual void | on_pad_added (const Glib::RefPtr< Gst::Pad >& new_pad)
| This is a default handler for the signal signal_pad_added(). More...
virtual void | on_pad_removed (const Glib::RefPtr< Gst::Pad >& old_pad)
| This is a default handler for the signal signal_pad_removed(). More...
Protected Member Functions inherited from Gst::Object
virtual void | on_deep_notify (const Glib::RefPtr< Gst::Object >& prop_object, GParamSpec* prop)
| This is a default handler for the signal signal_deep_notify(). More...

## Detailed Description

A base class for simple transform filters.

This base class is for filter elements that process data.

It provides for:

- one sinkpad and one srcpad
- Possible formats on sink and source pad implemented with custom transform_caps_vfunc() function. By default uses same format on sink and source.
- Handles state changes.
- Does flushing.
- Push mode.
- Pull mode if the sub-class transform_vfunc() can operate on arbitrary data.

### Use Cases:

- 1. Passthrough mode
  - Element has no interest in modifying the buffer. It may want to inspect it, in which case the element should have a transform_ip_vfunc() function. If there is no transform_ip_vfunc() function in passthrough mode, the buffer is pushed intact.
  - On the GstBaseTransformClass is the passthrough_on_same_caps variable which will automatically set/unset passthrough based on whether the element negotiates the same caps on both pads.
  - passthrough_on_same_caps on an element that doesn't implement a transform_caps_vfunc() function is useful for elements that only inspect data (such as level).
  Example elements
  - Level
  - VideoScale, AudioConvert, FfmpegColorSpace, AudioResample in certain modes.

- 2. Modifications in-place - input buffer and output buffer are the same thing.
  - The element must implement a transform_ip_vfunc() function.
  - Output buffer size must <= input buffer size.
  - If the always_in_place flag is set, non-writable buffers will be copied and passed to the transform_ip_vfunc() function, otherwise a new buffer will be created and the transform_vfunc() function called.
  - Incoming writable buffers will be passed to the transform_ip_vfunc() function immediately.
  - only implementing transform_ip_vfunc() and not transform_vfunc() implies always_in_place = TRUE.
  Example elements
  - Volume.
  - AudioConvert in certain modes (signed/unsigned conversion).
  - FfmpegColorSpace in certain modes (endianness swapping).
- 3. Modifications only to the caps/metadata of a buffer
  - The element does not require writable data, but non-writable buffers should be subbuffered so that the meta-information can be replaced.
  - Elements wishing to operate in this mode should replace the prepare_output_buffer_vfunc() method to create subbuffers of the input buffer and set always_in_place to TRUE.
  Example elements
  - CapsFilter when setting caps on outgoing buffers that have none.
  - Identity when it is going to re-timestamp buffers by datarate.
- 4. Normal mode
  - always_in_place flag is not set, or there is no transform_ip_vfunc() function.
  - Element will receive an input buffer and output buffer to operate on.
  - Output buffer is allocated by calling the prepare_output_buffer_vfunc() function.
  Example elements
  - VideoScale, FfmpegColorSpace, AudioConvert when doing scaling/conversions.
- 5. Special output buffer allocations
  - Elements which need to do special allocation of their output buffers other than what Gst::Pad::alloc_buffer() allows should implement a prepare_output_buffer_vfunc() method, which calls the parent implementation and passes the newly allocated buffer.
  Example elements
  - Efence.

Sub-class settable flags on Gst::BaseTransform

    - <B>passthrough</B>
          - Implies that in the current configuration, the sub-class is not
          interested in modifying the buffers.
          - Elements which are always in passthrough mode whenever the same
          caps has been negotiated on both pads can set the class variable
          passthrough_on_same_caps to have this behaviour automatically.
          .
    - <B>always_in_place</B>
          - Determines whether a non-writable buffer will be copied before
          passing to the transform_ip function.
          - Implied TRUE if no transform function is implemented.
          - Implied FALSE if ONLY transform function is implemented.

Last reviewed on 2016-05-16 (1.8.0).

## Constructor & Destructor Documentation

## ◆ BaseTransform()

Gst::BaseTransform::BaseTransform | ( | BaseTransform&& | src | ) |
| noexcept

## ◆ ~BaseTransform()

Gst::BaseTransform::~BaseTransform | ( |  | ) |
| overridenoexcept

## Member Function Documentation

## ◆ accept_caps_vfunc()

virtual bool Gst::BaseTransform::accept_caps_vfunc | ( | PadDirection | direction,
|  | const Glib::RefPtr< const Gst::Caps >& | caps
| ) |  |
| virtual

Optional.

Subclasses can override this method to check if the caps can be handled by the element. The default implementation might not be the most optimal way to check this in all cases.

## ◆ base_transform_query_vfunc()

bool Gst::BaseTransform::base_transform_query_vfunc | ( | Gst::PadDirection | direction,
|  | const Glib::RefPtr< Gst::Query >& | query
| ) |  |

Optional.

Handle a requested query. Subclasses that implement this should must chain up to the parent if they didn't handle the query

## ◆ before_transform_vfunc()

virtual void Gst::BaseTransform::before_transform_vfunc | ( | const Glib::RefPtr< Gst::Buffer >& | buffer | ) |
| virtual

Optional.

This method is called right before the base class will start processing. Dynamic properties or other delayed configuration could be performed in this method.

## ◆ copy_metadata_vfunc()

virtual bool Gst::BaseTransform::copy_metadata_vfunc | ( | const Glib::RefPtr< Gst::Buffer >& | input,
|  | const Glib::RefPtr< Gst::Buffer >& | outbuf
| ) |  |
| virtual

Optional.

Copy the metadata from the input buffer to the output buffer. The default implementation will copy the flags, timestamps and offsets of the buffer.

## ◆ decide_allocation_vfunc()

virtual bool Gst::BaseTransform::decide_allocation_vfunc | ( | const Glib::RefPtr< Gst::Query >& | query | ) |
| virtual

Setup the allocation parameters for allocating output buffers.

The passed in query contains the result of the downstream allocation query.This function is only called when not operating in passthrough mode. The default implementation will remove all memory dependent metadata. If there is a filter_meta method implementation, it will be called for all metadata API in the downstream query, otherwise the metadata API is removed.

## ◆ filter_meta_vfunc()

virtual bool Gst::BaseTransform::filter_meta_vfunc | ( | const Glib::RefPtr< Gst::Query >& | query,
|  | GType | api,
|  | const Gst::Structure& | params
| ) |  |
| virtual

Return TRUE if the metadata API should be proposed in the upstream allocation query.

The default implementation is NULL and will cause all metadata to be removed.

## ◆ fixate_caps_vfunc()

virtual Glib::RefPtr<Gst::Caps> Gst::BaseTransform::fixate_caps_vfunc | ( | PadDirection | direction,
|  | const Glib::RefPtr< Gst::Caps >& | caps,
|  | const Glib::RefPtr< Gst::Caps >& | othercaps
| ) |  |
| virtual

Optional.

Given the pad in this direction and the given caps, fixate the caps on the other pad.

## ◆ generate_output_vfunc()

virtual Gst::FlowReturn Gst::BaseTransform::generate_output_vfunc | ( | Glib::RefPtr< Gst::Buffer >& | buffer | ) |
| virtual

Called after each new input buffer is submitted repeatedly until it either generates an error or fails to generate an output buffer.

The default implementation takes the contents of the queued_buf variable, generates an output buffer if needed by calling the class prepare_output_buffer, and then calls either transform or transform_ip. Elements that don't do 1-to-1 transformations on input to output buffers can either return Gst::BASE_TRANSFORM_FLOW_DROPPED or simply not generate an output buffer until they are ready to do so.

## ◆ get_allocator()

Glib::RefPtr<Gst::Allocator> Gst::BaseTransform::get_allocator | ( | Gst::AllocationParams& | params | ) |

## ◆ get_sink_pad() [1/2]

Glib::RefPtr<Gst::Pad> Gst::BaseTransform::get_sink_pad | ( |  | ) |

Gives the refptr to the sink Gst::Pad object of the element.

## ◆ get_sink_pad() [2/2]

Glib::RefPtr<const Gst::Pad> Gst::BaseTransform::get_sink_pad | ( |  | ) | const

## ◆ get_src_pad() [1/2]

Glib::RefPtr<Gst::Pad> Gst::BaseTransform::get_src_pad | ( |  | ) |

Gives the refptr to the source Gst::Pad object of the element.

## ◆ get_src_pad() [2/2]

Glib::RefPtr<const Gst::Pad> Gst::BaseTransform::get_src_pad | ( |  | ) | const

## ◆ get_type()

static GType Gst::BaseTransform::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## ◆ get_unit_size_vfunc()

virtual bool Gst::BaseTransform::get_unit_size_vfunc | ( | const Glib::RefPtr< Gst::Caps >& | caps,
|  | gsize & | size
| ) |  | const
| virtual

Optional.

Given the size of a buffer in the given direction with the given caps, calculate the size in bytes of a buffer on the other pad with the given other caps. The default implementation uses get_unit_size_vfunc() and keeps the number of units the same. Required if the transform is not in-place. Get the size in bytes of one unit for the given caps.

## ◆ gobj() [1/2]

GstBaseTransform* Gst::BaseTransform::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const GstBaseTransform* Gst::BaseTransform::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ gobj_copy()

GstBaseTransform* Gst::BaseTransform::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

## ◆ is_in_place()

bool Gst::BaseTransform::is_in_place | ( |  | ) | const

See if trans is configured as a in_place transform.

Returns
  `true` is the transform is configured in in_place mode.

MT safe.

## ◆ is_passthrough()

bool Gst::BaseTransform::is_passthrough | ( |  | ) | const

See if trans is configured as a passthrough transform.

Returns
  `true` is the transform is configured in passthrough mode.

MT safe.

## ◆ is_qos_enabled()

bool Gst::BaseTransform::is_qos_enabled | ( |  | ) | const

Queries if the transform will handle QoS.

Returns
  `true` if QoS is enabled.

MT safe.

## ◆ operator=()

BaseTransform& Gst::BaseTransform::operator= | ( | BaseTransform&& | src | ) |
| noexcept

## ◆ prepare_output_buffer_vfunc()

virtual FlowReturn Gst::BaseTransform::prepare_output_buffer_vfunc | ( | const Glib::RefPtr< Gst::Buffer >& | input,
|  | Glib::RefPtr< Gst::Buffer >& | buffer
| ) |  |
| virtual

Optional.

Subclasses can override this to do their own allocation of output buffers. Elements that only do analysis can return a subbuffer or even just increment the reference to the input buffer (if in passthrough mode).

## ◆ property_qos() [1/2]

Glib::PropertyProxy< bool > Gst::BaseTransform::property_qos | ( |  | ) |

Handle Quality-of-Service events.

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_qos() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gst::BaseTransform::property_qos | ( |  | ) | const

Handle Quality-of-Service events.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ propose_allocation_vfunc()

virtual bool Gst::BaseTransform::propose_allocation_vfunc | ( | const Glib::RefPtr< Gst::Query >& | decide_query,
|  | const Glib::RefPtr< Gst::Query >& | query
| ) |  |
| virtual

Propose buffer allocation parameters for upstream elements.

This function must be implemented if the element reads or writes the buffer content. The query that was passed to the decide_allocation is passed in this method (or nullptr when the element is in passthrough mode). The default implementation will pass the query downstream when in passthrough mode and will copy all the filtered metadata API in non-passthrough mode.

## ◆ reconfigure_sink()

void Gst::BaseTransform::reconfigure_sink | ( |  | ) |

Instructs trans to request renegotiation upstream.

This function is typically called after properties on the transform were set that influence the input format.

## ◆ reconfigure_src()

void Gst::BaseTransform::reconfigure_src | ( |  | ) |

Instructs trans to renegotiate a new downstream transform on the next buffer.

This function is typically called after properties on the transform were set that influence the output format.

## ◆ set_caps_vfunc()

virtual bool Gst::BaseTransform::set_caps_vfunc | ( | const Glib::RefPtr< Gst::Caps >& | incaps,
|  | const Glib::RefPtr< Gst::Caps >& | outcaps
| ) |  |
| virtual

Allows the subclass to be notified of the actual caps set.

## ◆ set_gap_aware()

void Gst::BaseTransform::set_gap_aware | ( | bool | gap_aware | ) |

If gap_aware is `false` (the default), output buffers will have the Gst::BUFFER_FLAG_GAP flag unset.

If set to `true`, the element must handle output buffers with this flag set correctly, i.e. it can assume that the buffer contains neutral data but must unset the flag if the output is no neutral data.

MT safe.

Parameters

  gap_aware | New state.

## ◆ set_in_place()

void Gst::BaseTransform::set_in_place | ( | bool | in_place | ) |

Determines whether a non-writable buffer will be copied before passing to the transform_ip function.

- Always `true` if no transform function is implemented.
- Always `false` if ONLY transform function is implemented.

MT safe.

Parameters

  in_place | Boolean value indicating that we would like to operate on in_place buffers.

## ◆ set_passthrough()

void Gst::BaseTransform::set_passthrough | ( | bool | passthrough | ) |

Set passthrough mode for this filter by default.

This is mostly useful for filters that do not care about negotiation.

Always `true` for filters which don't implement either a transform or transform_ip method.

MT safe.

Parameters

  passthrough | Boolean indicating passthrough mode.

## ◆ set_prefer_passthrough()

void Gst::BaseTransform::set_prefer_passthrough | ( | bool | prefer_passthrough | ) |

If prefer_passthrough is `true` (the default), trans will check and prefer passthrough caps from the list of caps returned by the transform_caps vmethod.

If set to `false`, the element must order the caps returned from the transform_caps function in such a way that the preferred format is first in the list. This can be interesting for transforms that can do passthrough transforms but prefer to do something else, like a capsfilter.

MT safe.

Parameters

  prefer_passthrough | New state.

## ◆ set_qos_enabled()

void Gst::BaseTransform::set_qos_enabled | ( | bool | enabled | ) |

Enable or disable QoS handling in the transform.

MT safe.

Parameters

  enabled | New state.

## ◆ sink_event_vfunc()

virtual bool Gst::BaseTransform::sink_event_vfunc | ( | const Glib::RefPtr< Gst::Event >& | event | ) |
| virtual

Optional.

Event handler on the sink pad. The default implementation handles the event and forwards it downstream.

## ◆ src_event_vfunc()

virtual bool Gst::BaseTransform::src_event_vfunc | ( | const Glib::RefPtr< Gst::Event >& | event | ) |
| virtual

Optional.

Event handler on the source pad. The default implementation handles the event and forwards it downstream.

## ◆ start_vfunc()

virtual bool Gst::BaseTransform::start_vfunc | ( |  | ) |
| virtual

Optional.

Called when the element starts processing. Allows opening external resources.

## ◆ stop_vfunc()

virtual bool Gst::BaseTransform::stop_vfunc | ( |  | ) |
| virtual

Optional.

Called when the element starts processing. Allows opening external resources.

## ◆ submit_input_buffer_vfunc()

virtual Gst::FlowReturn Gst::BaseTransform::submit_input_buffer_vfunc | ( | bool | is_discont,
|  | const Glib::RefPtr< Gst::Buffer >& | input
| ) |  |
| virtual

Function which accepts a new input buffer and pre-processes it.

The default implementation performs caps (re)negotiation, then QoS if needed, and places the input buffer into the queued_buf member variable. If the buffer is dropped due to QoS, it returns Gst::BASE_TRANSFORM_FLOW_DROPPED. If this input buffer is not contiguous with any previous input buffer, then is_discont is set to TRUE.

## ◆ transform_caps_vfunc()

virtual Glib::RefPtr<Gst::Caps> Gst::BaseTransform::transform_caps_vfunc | ( | PadDirection | direction,
|  | const Glib::RefPtr< Gst::Caps >& | caps,
|  | const Glib::RefPtr< Gst::Caps >& | filter
| ) |  |
| virtual

Optional.

Given the pad in this direction and the given caps, what caps are allowed on the other pad in this element ?

## ◆ transform_ip_vfunc()

virtual FlowReturn Gst::BaseTransform::transform_ip_vfunc | ( | const Glib::RefPtr< Gst::Buffer >& | buf | ) |
| virtual

Required if the element operates in-place.

Transform the incoming buffer in-place.

## ◆ transform_vfunc()

virtual FlowReturn Gst::BaseTransform::transform_vfunc | ( | const Glib::RefPtr< Gst::Buffer >& | inbuf,
|  | const Glib::RefPtr< Gst::Buffer >& | outbuf
| ) |  |
| virtual

Required if the element does not operate in-place.

Transforms one incoming buffer to one outgoing buffer. The function is allowed to change size/timestamp/duration of the outgoing buffer.

## ◆ update_qos()

void Gst::BaseTransform::update_qos | ( | double | proportion,
|  | Gst::ClockTimeDiff | diff,
|  | Gst::ClockTime | timestamp
| ) |  |

Set the QoS parameters in the transform.

This function is called internally when a QOS event is received but subclasses can provide custom information when needed.

MT safe.

Parameters

  proportion | The proportion.
  diff | The diff against the clock.
  timestamp | The timestamp of the buffer generating the QoS expressed in running_time.

## ◆ update_src_caps()

bool Gst::BaseTransform::update_src_caps | ( | const Glib::RefPtr< Gst::Caps >& | updated_caps | ) |

Updates the srcpad caps and send the caps downstream.

This function can be used by subclasses when they have already negotiated their caps but found a change in them (or computed new informations). This way, they can notify downstream about that change without loosing any buffer.

Parameters

  updated_caps | An updated version of the srcpad caps to be pushed downstream.

Returns
  `true` if the caps could be send downstream `false` otherwise.

## Friends And Related Function Documentation

## ◆ wrap()

Glib::RefPtr< Gst::BaseTransform > wrap | ( | GstBaseTransform * | object,
|  | bool | take_copy = `false`
| ) |  |
| related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.

## Member Data Documentation

## ◆ FLOW_DROPPED

constexpr Gst::FlowReturn Gst::BaseTransform::FLOW_DROPPED = static_cast<Gst::FlowReturn>(GST_BASE_TRANSFORM_FLOW_DROPPED)
| static

A Gst::FlowReturn that can be returned from transform_vfunc and transform_ip_vfunc to indicate that no output buffer was generated.

## ◆ SINK_NAME

const Glib::ustring Gst::BaseTransform::SINK_NAME
| static

The name of the templates for the sink pad ("sink").

## ◆ SRC_NAME

const Glib::ustring Gst::BaseTransform::SRC_NAME
| static

The name of the templates for the source pad ("src").