gstreamermm 1.10.0

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

The base class for sink elements. More...

`#include <gstreamermm/basesink.h>`

Inheritance diagram for Gst::BaseSink:
[legend]

## Public Member Functions
| BaseSink (BaseSink&& src) noexcept
BaseSink& | operator= (BaseSink&& src) noexcept
| ~BaseSink () noexcept override
GstBaseSink* | gobj ()
| Provides access to the underlying C GObject. More...
const GstBaseSink* | gobj () const
| Provides access to the underlying C GObject. More...
GstBaseSink* | 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 | query_latency (bool& live, bool& upstream_live, Gst::ClockTime& min_latency, Gst::ClockTime& max_latency) const
| Query the sink for the latency parameters. More...
Gst::ClockTime | get_latency () const
| Get the currently configured latency. More...
Gst::FlowReturn | do_preroll (const Glib::RefPtr< Gst::MiniObject >& obj)
| If the sink spawns its own thread for pulling buffers from upstream it should call this method after it has pulled a buffer. More...
Gst::FlowReturn | wait_preroll ()
| If the Gst::BaseSinkClass.render() 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 render the remaining data. More...
Gst::ClockReturn | wait_clock (Gst::ClockTime time, Gst::ClockTimeDiff& jitter)
| This function will block until time is reached. More...
Gst::ClockReturn | wait_clock (Gst::ClockTime time)
| A wait_clock() convenience overload. More...
Gst::FlowReturn | wait (Gst::ClockTime time, Gst::ClockTimeDiff& jitter)
| This function will wait for preroll to complete and will then block until time is reached. More...
Gst::FlowReturn | wait (Gst::ClockTime time)
| A wait() convenience overload. More...
void | set_sync (bool sync)
| Configures sink to synchronize on the clock or not. More...
bool | get_sync () const
| Checks if sink is currently configured to synchronize against the clock. More...
void | set_max_lateness (gint64 max_lateness)
| Sets the new max lateness value to max_lateness. More...
gint64 | get_max_lateness () const
| Gets the max lateness value. More...
void | set_qos_enabled (bool enabled)
| Configures sink to send Quality-of-Service events upstream. More...
bool | is_qos_enabled () const
| Checks if sink is currently configured to send Quality-of-Service events upstream. More...
void | set_async_enabled (bool enabled)
| Configures sink to perform all state changes asynchronously. More...
bool | is_async_enabled () const
| Checks if sink is currently configured to perform asynchronous state changes to PAUSED. More...
void | set_ts_offset (Gst::ClockTimeDiff offset)
| Adjust the synchronisation of sink with offset. More...
Gst::ClockTimeDiff | get_ts_offset () const
| Get the synchronisation offset of sink. More...
void | set_render_delay (Gst::ClockTime delay)
| Set the render delay in sink to delay. More...
Gst::ClockTime | get_render_delay () const
| Get the render delay of sink. More...
void | set_blocksize (guint blocksize)
| Set the number of bytes that the sink will pull when it is operating in pull mode. More...
guint | get_blocksize () const
| Get the number of bytes that the sink will pull when it is operating in pull mode. More...
guint64 | get_throttle_time () const
| Get the time that will be inserted between frames to control the maximum buffers per second. More...
void | set_throttle_time (guint64 throttle)
| Set the time that will be inserted between rendered buffers. More...
Glib::RefPtr< Gst::Sample > | get_last_sample () const
| Get the last sample that arrived in the sink and was used for preroll or for rendering. More...
void | set_max_bitrate (guint64 max_bitrate)
| Set the maximum amount of bits per second that the sink will render. More...
guint64 | get_max_bitrate () const
| Get the maximum amount of bits per second that the sink will render. More...
void | set_last_sample_enabled (bool enabled)
| Configures sink to store the last received sample in the last-sample property. More...
bool | is_last_sample_enabled () const
| Checks if sink is currently configured to store the last received sample in the last-sample property. More...
Glib::RefPtr< Gst::Pad > | get_sink_pad ()
| Gets the sink Gst::Pad object of the element. More...
Glib::RefPtr< const Gst::Pad > | get_sink_pad () const
Glib::PropertyProxy< bool > | property_async ()
| Go asynchronously to PAUSED. More...
Glib::PropertyProxy_ReadOnly< bool > | property_async () const
| Go asynchronously to PAUSED. More...
Glib::PropertyProxy< gint64 > | property_max_lateness ()
| Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited). More...
Glib::PropertyProxy_ReadOnly< gint64 > | property_max_lateness () const
| Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited). More...
Glib::PropertyProxy< bool > | property_qos ()
| Generate Quality-of-Service events upstream. More...
Glib::PropertyProxy_ReadOnly< bool > | property_qos () const
| Generate Quality-of-Service events upstream. More...
Glib::PropertyProxy< bool > | property_sync ()
| Sync on the clock. More...
Glib::PropertyProxy_ReadOnly< bool > | property_sync () const
| Sync on the clock. More...
Glib::PropertyProxy< gint64 > | property_ts_offset ()
| Timestamp offset in nanoseconds. More...
Glib::PropertyProxy_ReadOnly< gint64 > | property_ts_offset () const
| Timestamp offset in nanoseconds. More...
Glib::PropertyProxy< guint64 > | property_render_delay ()
| Additional render delay of the sink in nanoseconds. More...
Glib::PropertyProxy_ReadOnly< guint64 > | property_render_delay () const
| Additional render delay of the sink in nanoseconds. More...
Glib::PropertyProxy< guint64 > | property_throttle_time ()
| The time to keep between rendered buffers (0 = disabled). More...
Glib::PropertyProxy_ReadOnly< guint64 > | property_throttle_time () const
| The time to keep between rendered buffers (0 = disabled). More...
Glib::PropertyProxy< guint > | property_blocksize ()
| Size in bytes to pull per buffer (0 = default). More...
Glib::PropertyProxy_ReadOnly< guint > | property_blocksize () const
| Size in bytes to pull per buffer (0 = default). More...
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gst::Sample > > | property_last_sample () const
| The last sample received in the sink. More...
Glib::PropertyProxy< bool > | property_enable_last_sample ()
| Enable the last-sample property. More...
Glib::PropertyProxy_ReadOnly< bool > | property_enable_last_sample () const
| Enable the last-sample property. More...
Glib::PropertyProxy< guint64 > | property_max_bitrate ()
| The maximum bits per second to render (0 = disabled). More...
Glib::PropertyProxy_ReadOnly< guint64 > | property_max_bitrate () const
| The maximum bits per second to render (0 = disabled). More...
virtual Glib::RefPtr< Gst::Caps > | get_caps_vfunc (const Glib::RefPtr< Gst::Caps >& caps) const
| Called to get sink pad caps from the subclass. More...
virtual bool | set_caps_vfunc (const Glib::RefPtr< Gst::Caps >& caps)
| Notify subclass of changed caps. More...
virtual void | get_times_vfunc (const Glib::RefPtr< Gst::Buffer >& buffer, Gst::ClockTime&start, Gst::ClockTime&end) const
| Called to get the start and end times for synchronising the passed buffer to the clock. More...
virtual bool | start_vfunc ()
| Start processing. More...
virtual bool | stop_vfunc ()
| Stop processing. More...
virtual bool | unlock_vfunc ()
| Unlock any pending access to the resource. More...
virtual bool | event_vfunc (const Glib::RefPtr< Gst::Event >& event)
| Override this to handle events arriving on the sink pad. More...
virtual FlowReturn | wait_event_vfunc (const Glib::RefPtr< Gst::Event >& event)
| Override this to implement custom logic to wait for the event time (for events like EOS and GAP). More...
virtual FlowReturn | preroll_vfunc (const Glib::RefPtr< Gst::Buffer >& buffer)
| Called to present the preroll buffer if desired. More...
virtual FlowReturn | render_vfunc (const Glib::RefPtr< Gst::Buffer >& buffer)
| Called when a buffer should be presented or output, at the correct moment if the Gst::BaseSink has been set to sync to the clock. More...
virtual bool | activate_pull_vfunc (bool active)
| Subclasses should override this when they need to perform special processing when changing to the PLAYING state asynchronously. More...
virtual Glib::RefPtr< Gst::Caps > | fixate_vfunc (const Glib::RefPtr< Gst::Caps >& caps)
| Only useful in pull mode, this vmethod will be called in response to Gst::Pad::fixate_caps() being called on the sink pad. More...
virtual bool | unlock_stop_vfunc ()
| Clear the previous unlock request. More...
virtual FlowReturn | render_list_vfunc (const Glib::RefPtr< Gst::BufferList >& buffer_list)
| Render a BufferList. More...
virtual FlowReturn | prepare_vfunc (const Glib::RefPtr< Gst::Buffer >& buffer)
| Called to prepare the buffer for render and preroll. More...
virtual FlowReturn | prepare_list_vfunc (const Glib::RefPtr< Gst::BufferList >& buffer_list)
| Called to prepare the buffer list for render_list. More...
virtual bool | base_sink_query_vfunc (const Glib::RefPtr< Gst::Query >&query)
| Perform a GstQuery on the element. More...
virtual bool | propose_allocation_vfunc (const Glib::RefPtr< Gst::Query >&query)
| Configure the allocation query. 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
Public Member Functions inherited from Glib::Object
| Object (const Object &)=delete
Object & | operator= (const Object &)=delete
| Object (Object &&src) noexcept
Object & | operator= (Object &&src) noexcept
void * | get_data (const QueryQuark &key)
void | set_data (const Quark &key, void *data)
void | set_data (const Quark &key, void *data, DestroyNotify notify)
void | remove_data (const QueryQuark &quark)
void * | steal_data (const QueryQuark &quark)
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false)
Public Member Functions inherited from Glib::ObjectBase
| ObjectBase (const ObjectBase &)=delete
ObjectBase & | operator= (const ObjectBase &)=delete
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
void | set_property (const Glib::ustring &property_name, const PropertyType &value)
void | get_property (const Glib::ustring &property_name, PropertyType &value) const
void | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot)
void | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void > &&slot)
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot)
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, sigc::slot< void > &&slot)
void | freeze_notify ()
void | thaw_notify ()
virtual void | reference () const
virtual void | unreference () const
GObject * | gobj ()
const GObject * | gobj () const
GObject * | gobj_copy () const
Public Member Functions inherited from sigc::trackable
| trackable () noexcept
| trackable (const trackable &src) noexcept
| trackable (trackable &&src)
| ~trackable ()
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const
void | notify_callbacks ()
trackable & | operator= (const trackable &src)
trackable & | operator= (trackable &&src)
void | remove_destroy_notify_callback (void *data) 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...

## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gst::BaseSink > | wrap (GstBaseSink* 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
Public Types inherited from Glib::Object
typedef void(*)(gpointer data | DestroyNotify)
Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify | func_destroy_notify
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...
Protected Member Functions inherited from Glib::Object
| Object ()
| Object (const Glib::ConstructParams &construct_params)
| Object (GObject *castitem)
| ~Object () noexcept override
Protected Member Functions inherited from Glib::ObjectBase
| ObjectBase ()
| ObjectBase (const char *custom_type_name)
| ObjectBase (const std::type_info &custom_type_info)
| ObjectBase (ObjectBase &&src) noexcept
ObjectBase & | operator= (ObjectBase &&src) noexcept
virtual | ~ObjectBase () noexcept=0
void | initialize (GObject *castitem)
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)

## Detailed Description

The base class for sink elements.

Gst::BaseSink is the base class for sink elements in GStreamer, such as xvimagesink or filesink. It is a layer on top of Gst::Element that provides a simplified interface to plugin writers. Gst::BaseSink handles many details for you, for example: preroll, clock synchronization, state changes, activation in push or pull mode, and queries.

In most cases, when writing sink elements, there is no need to implement class methods from Gst::Element or to set functions on pads, because the Gst::BaseSink infrastructure should be sufficient.

TODO: correct paragraph below for C++ and include example from C API:

Gst::BaseSink provides support for exactly one sink pad, which should be named "sink". A sink implementation (subclass of Gst::BaseSink) should install a pad template in its base_init function, like so:

Gst::BaseSink will handle the prerolling correctly. This means that it will return Gst::STATE_CHANGE_ASYNC from a state change to PAUSED until the first buffer arrives in this element. The base class will call the Gst::BaseSink::preroll_vfunc() vmethod with this preroll buffer and will then commit the state change to the next asynchronously pending state.

When the element is set to PLAYING, Gst::BaseSink will synchronise on the clock using the times returned from get_times_vfunc(). If this function returns Gst::CLOCK_TIME_NONE for the start time, no synchronisation will be done. Synchronisation can be disabled entirely by setting the object "sync" property to FALSE.

After synchronisation the virtual method Gst::BaseSink::render_vfunc() will be called. Subclasses should minimally implement this method.

Since GStreamer 0.10.3 subclasses that synchronise on the clock in the render_vfunc() vmethod are supported as well. These classes typically receive a buffer in the render method and can then potentially block on the clock while rendering. A typical example is an audiosink. Since GStreamer 0.10.11 these subclasses can use wait_preroll() to perform the blocking wait.

Upon receiving the EOS event in the PLAYING state, Gst::BaseSink will wait for the clock to reach the time indicated by the stop time of the last get_times_vfunc() call before posting an EOS message. When the element receives EOS in PAUSED, preroll completes, the event is queued and an EOS message is posted when going to PLAYING.

Gst::BaseSink will internally use the Gst::EVENT_NEWSEGMENT events to schedule synchronisation and clipping of buffers. Buffers that fall completely outside of the current segment are dropped. Buffers that fall partially in the segment are rendered (and prerolled). Subclasses should do any subbuffer clipping themselves when needed.

Gst::BaseSink will by default report the current playback position in Gst::FORMAT_TIME based on the current clock time and segment information. If no clock has been set on the element, the query will be forwarded upstream.

The set_caps_vfunc() function will be called when the subclass should configure itself to process a specific media type.

The start_vfunc() and stop_vfunc() virtual methods will be called when resources should be allocated. Any preroll_vfunc(), render_vfunc() and set_caps_vfunc() function will be called between the start_vfunc() and stop_vfunc() calls.

The event_vfunc() virtual method will be called when an event is received by Gst::BaseSink. Normally this method should only be overriden by very specific elements (such as file sinks) which need to handle the newsegment event specially. The unlock_vfunc() method is called when the elements should unblock any blocking operations they perform in the render_vfunc() method. This is mostly useful when the render_vfunc() method performs a blocking write on a file descriptor, for example.

The max-lateness property affects how the sink deals with buffers that arrive too late in the sink. A buffer arrives too late in the sink when the presentation time (as a combination of the last segment, buffer timestamp and element base_time) plus the duration is before the current time of the clock. If the frame is later than max-lateness, the sink will drop the buffer without calling the render method. This feature is disabled if sync is disabled, the get_times_vfunc() method does not return a valid start time or max-lateness is set to -1 (the default). Subclasses can use set_max_lateness() to configure the max-lateness value.

The qos property will enable the quality-of-service features of the basesink which gather statistics about the real-time performance of the clock synchronisation. For each buffer received in the sink, statistics are gathered and a QOS event is sent upstream with these numbers. This information can then be used by upstream elements to reduce their processing rate, for example.

The async property can be used to instruct the sink to never perform an ASYNC state change. This feature is mostly usable when dealing with non-synchronized streams or sparse streams.

Last reviewed on 2016-04-29 (1.8.0)

## Constructor & Destructor Documentation

## ◆ BaseSink()

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

## ◆ ~BaseSink()

Gst::BaseSink::~BaseSink | ( |  | ) |
| override noexcept

## Member Function Documentation

## ◆ activate_pull_vfunc()

virtual bool Gst::BaseSink::activate_pull_vfunc | ( | bool | active | ) |
| virtual

Subclasses should override this when they need to perform special processing when changing to the PLAYING state asynchronously.

Called with the OBJECT_LOCK held. Subclasses should override this when they can provide an alternate method of spawning a thread to drive the pipeline in pull mode. Should start or stop the pulling thread, depending on the value of the "active" argument. Called after actually activating the sink pad in pull mode. The default implementation starts a task on the sink pad.

## ◆ base_sink_query_vfunc()

virtual bool Gst::BaseSink::base_sink_query_vfunc | ( | const Glib::RefPtr< Gst::Query >& | query | ) |
| virtual

Perform a GstQuery on the element.

## ◆ do_preroll()

Gst::FlowReturn Gst::BaseSink::do_preroll | ( | const Glib::RefPtr< Gst::MiniObject >& | obj | ) |

If the sink spawns its own thread for pulling buffers from upstream it should call this method after it has pulled a buffer.

If the element needed to preroll, this function will perform the preroll and will then block until the element state is changed.

This function should be called with the PREROLL_LOCK held.

Parameters

  obj | The mini object that caused the preroll.

Returns
  Gst::FLOW_OK if the preroll completed and processing can continue. Any other return value should be returned from the render vmethod.

## ◆ event_vfunc()

virtual bool Gst::BaseSink::event_vfunc | ( | const Glib::RefPtr< Gst::Event >& | event | ) |
| virtual

Override this to handle events arriving on the sink pad.

## ◆ fixate_vfunc()

virtual Glib::RefPtr<Gst::Caps> Gst::BaseSink::fixate_vfunc | ( | const Glib::RefPtr< Gst::Caps >& | caps | ) |
| virtual

Only useful in pull mode, this vmethod will be called in response to Gst::Pad::fixate_caps() being called on the sink pad.

Implement if you have ideas about what should be the default values for the caps you support.

## ◆ get_blocksize()

guint Gst::BaseSink::get_blocksize | ( |  | ) | const

Get the number of bytes that the sink will pull when it is operating in pull mode.

Returns
  The number of bytes sink will pull in pull mode.

## ◆ get_caps_vfunc()

virtual Glib::RefPtr<Gst::Caps> Gst::BaseSink::get_caps_vfunc | ( | const Glib::RefPtr< Gst::Caps >& | caps | ) | const
| virtual

Called to get sink pad caps from the subclass.

## ◆ get_last_sample()

Glib::RefPtr<Gst::Sample> Gst::BaseSink::get_last_sample | ( |  | ) | const

Get the last sample that arrived in the sink and was used for preroll or for rendering.

This property can be used to generate thumbnails.

The Gst::Caps on the sample can be used to determine the type of the buffer.

Free-function: gst_sample_unref

Returns
  A Gst::Sample. gst_sample_unref() after usage. This function returns `nullptr` when no buffer has arrived in the sink yet or when the sink is not in PAUSED or PLAYING.

## ◆ get_latency()

Gst::ClockTime Gst::BaseSink::get_latency | ( |  | ) | const

Get the currently configured latency.

Returns
  The configured latency.

## ◆ get_max_bitrate()

guint64 Gst::BaseSink::get_max_bitrate | ( |  | ) | const

Get the maximum amount of bits per second that the sink will render.

Returns
  The maximum number of bits per second sink will render.

## ◆ get_max_lateness()

gint64 Gst::BaseSink::get_max_lateness | ( |  | ) | const

Gets the max lateness value.

See gst_base_sink_set_max_lateness for more details.

Returns
  The maximum time in nanoseconds that a buffer can be late before it is dropped and not rendered. A value of -1 means an unlimited time.

## ◆ get_render_delay()

Gst::ClockTime Gst::BaseSink::get_render_delay | ( |  | ) | const

Get the render delay of sink.

see set_render_delay() for more information about the render delay.

Returns
  The render delay of sink.

## ◆ get_sink_pad() [1/2]

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

Gets the sink Gst::Pad object of the element.

## ◆ get_sink_pad() [2/2]

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

## ◆ get_sync()

bool Gst::BaseSink::get_sync | ( |  | ) | const

Checks if sink is currently configured to synchronize against the clock.

Returns
  `true` if the sink is configured to synchronize against the clock.

## ◆ get_throttle_time()

guint64 Gst::BaseSink::get_throttle_time | ( |  | ) | const

Get the time that will be inserted between frames to control the maximum buffers per second.

Returns
  The number of nanoseconds sink will put between frames.

## ◆ get_times_vfunc()

virtual void Gst::BaseSink::get_times_vfunc | ( | const Glib::RefPtr< Gst::Buffer >& | buffer,
|  | Gst::ClockTime& | start,
|  | Gst::ClockTime& | end
| ) |  | const
| virtual

Called to get the start and end times for synchronising the passed buffer to the clock.

## ◆ get_ts_offset()

Gst::ClockTimeDiff Gst::BaseSink::get_ts_offset | ( |  | ) | const

Get the synchronisation offset of sink.

Returns
  The synchronisation offset.

## ◆ get_type()

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

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

## ◆ gobj() [1/2]

GstBaseSink* Gst::BaseSink::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const GstBaseSink* Gst::BaseSink::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ gobj_copy()

GstBaseSink* Gst::BaseSink::gobj_copy | ( |  | ) |

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

## ◆ is_async_enabled()

bool Gst::BaseSink::is_async_enabled | ( |  | ) | const

Checks if sink is currently configured to perform asynchronous state changes to PAUSED.

Returns
  `true` if the sink is configured to perform asynchronous state changes.

## ◆ is_last_sample_enabled()

bool Gst::BaseSink::is_last_sample_enabled | ( |  | ) | const

Checks if sink is currently configured to store the last received sample in the last-sample property.

Returns
  `true` if the sink is configured to store the last received sample.

## ◆ is_qos_enabled()

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

Checks if sink is currently configured to send Quality-of-Service events upstream.

Returns
  `true` if the sink is configured to perform Quality-of-Service.

## ◆ operator=()

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

## ◆ prepare_list_vfunc()

virtual FlowReturn Gst::BaseSink::prepare_list_vfunc | ( | const Glib::RefPtr< Gst::BufferList >& | buffer_list | ) |
| virtual

Called to prepare the buffer list for render_list.

This function is called before synchronisation is performed.

## ◆ prepare_vfunc()

virtual FlowReturn Gst::BaseSink::prepare_vfunc | ( | const Glib::RefPtr< Gst::Buffer >& | buffer | ) |
| virtual

Called to prepare the buffer for render and preroll.

This function is called before synchronisation is performed.

## ◆ preroll_vfunc()

virtual FlowReturn Gst::BaseSink::preroll_vfunc | ( | const Glib::RefPtr< Gst::Buffer >& | buffer | ) |
| virtual

Called to present the preroll buffer if desired.

## ◆ property_async() [1/2]

Glib::PropertyProxy< bool > Gst::BaseSink::property_async | ( |  | ) |

Go asynchronously to PAUSED.

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_async() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gst::BaseSink::property_async | ( |  | ) | const

Go asynchronously to PAUSED.

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

## ◆ property_blocksize() [1/2]

Glib::PropertyProxy< guint > Gst::BaseSink::property_blocksize | ( |  | ) |

Size in bytes to pull per buffer (0 = default).

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_blocksize() [2/2]

Glib::PropertyProxy_ReadOnly< guint > Gst::BaseSink::property_blocksize | ( |  | ) | const

Size in bytes to pull per buffer (0 = default).

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

## ◆ property_enable_last_sample() [1/2]

Glib::PropertyProxy< bool > Gst::BaseSink::property_enable_last_sample | ( |  | ) |

Enable the last-sample property.

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_enable_last_sample() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gst::BaseSink::property_enable_last_sample | ( |  | ) | const

Enable the last-sample property.

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

## ◆ property_last_sample()

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gst::Sample> > Gst::BaseSink::property_last_sample | ( |  | ) | const

The last sample received in the sink.

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

## ◆ property_max_bitrate() [1/2]

Glib::PropertyProxy< guint64 > Gst::BaseSink::property_max_bitrate | ( |  | ) |

The maximum bits per second to render (0 = disabled).

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_max_bitrate() [2/2]

Glib::PropertyProxy_ReadOnly< guint64 > Gst::BaseSink::property_max_bitrate | ( |  | ) | const

The maximum bits per second to render (0 = disabled).

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

## ◆ property_max_lateness() [1/2]

Glib::PropertyProxy< gint64 > Gst::BaseSink::property_max_lateness | ( |  | ) |

Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited).

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_max_lateness() [2/2]

Glib::PropertyProxy_ReadOnly< gint64 > Gst::BaseSink::property_max_lateness | ( |  | ) | const

Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited).

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

## ◆ property_qos() [1/2]

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

Generate Quality-of-Service events upstream.

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::BaseSink::property_qos | ( |  | ) | const

Generate Quality-of-Service events upstream.

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

## ◆ property_render_delay() [1/2]

Glib::PropertyProxy< guint64 > Gst::BaseSink::property_render_delay | ( |  | ) |

Additional render delay of the sink in nanoseconds.

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_render_delay() [2/2]

Glib::PropertyProxy_ReadOnly< guint64 > Gst::BaseSink::property_render_delay | ( |  | ) | const

Additional render delay of the sink in nanoseconds.

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

## ◆ property_sync() [1/2]

Glib::PropertyProxy< bool > Gst::BaseSink::property_sync | ( |  | ) |

Sync on the clock.

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_sync() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gst::BaseSink::property_sync | ( |  | ) | const

Sync on the clock.

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

## ◆ property_throttle_time() [1/2]

Glib::PropertyProxy< guint64 > Gst::BaseSink::property_throttle_time | ( |  | ) |

The time to keep between rendered buffers (0 = disabled).

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_throttle_time() [2/2]

Glib::PropertyProxy_ReadOnly< guint64 > Gst::BaseSink::property_throttle_time | ( |  | ) | const

The time to keep between rendered buffers (0 = disabled).

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

## ◆ property_ts_offset() [1/2]

Glib::PropertyProxy< gint64 > Gst::BaseSink::property_ts_offset | ( |  | ) |

Timestamp offset in nanoseconds.

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_ts_offset() [2/2]

Glib::PropertyProxy_ReadOnly< gint64 > Gst::BaseSink::property_ts_offset | ( |  | ) | const

Timestamp offset in nanoseconds.

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::BaseSink::propose_allocation_vfunc | ( | const Glib::RefPtr< Gst::Query >& | query | ) |
| virtual

Configure the allocation query.

## ◆ query_latency()

bool Gst::BaseSink::query_latency | ( | bool & | live,
|  | bool & | upstream_live,
|  | Gst::ClockTime& | min_latency,
|  | Gst::ClockTime& | max_latency
| ) |  | const

Query the sink for the latency parameters.

The latency will be queried from the upstream elements. live will be `true` if sink is configured to synchronize against the clock. upstream_live will be `true` if an upstream element is live.

If both live and upstream_live are `true`, the sink will want to compensate for the latency introduced by the upstream elements by setting the min_latency to a strictly positive value.

This function is mostly used by subclasses.

Parameters

  live | If the sink is live.
  upstream_live | If an upstream element is live.
  min_latency | The min latency of the upstream elements.
  max_latency | The max latency of the upstream elements.

Returns
  `true` if the query succeeded.

## ◆ render_list_vfunc()

virtual FlowReturn Gst::BaseSink::render_list_vfunc | ( | const Glib::RefPtr< Gst::BufferList >& | buffer_list | ) |
| virtual

Render a BufferList.

Same as render but used with buffer lists instead of buffers.

## ◆ render_vfunc()

virtual FlowReturn Gst::BaseSink::render_vfunc | ( | const Glib::RefPtr< Gst::Buffer >& | buffer | ) |
| virtual

Called when a buffer should be presented or output, at the correct moment if the Gst::BaseSink has been set to sync to the clock.

## ◆ set_async_enabled()

void Gst::BaseSink::set_async_enabled | ( | bool | enabled | ) |

Configures sink to perform all state changes asynchronously.

When async is disabled, the sink will immediately go to PAUSED instead of waiting for a preroll buffer. This feature is useful if the sink does not synchronize against the clock or when it is dealing with sparse streams.

Parameters

  enabled | The new async value.

## ◆ set_blocksize()

void Gst::BaseSink::set_blocksize | ( | guint | blocksize | ) |

Set the number of bytes that the sink will pull when it is operating in pull mode.

Parameters

  blocksize | The blocksize in bytes.

## ◆ set_caps_vfunc()

virtual bool Gst::BaseSink::set_caps_vfunc | ( | const Glib::RefPtr< Gst::Caps >& | caps | ) |
| virtual

Notify subclass of changed caps.

## ◆ set_last_sample_enabled()

void Gst::BaseSink::set_last_sample_enabled | ( | bool | enabled | ) |

Configures sink to store the last received sample in the last-sample property.

Parameters

  enabled | The new enable-last-sample value.

## ◆ set_max_bitrate()

void Gst::BaseSink::set_max_bitrate | ( | guint64 | max_bitrate | ) |

Set the maximum amount of bits per second that the sink will render.

Parameters

  max_bitrate | The max_bitrate in bits per second.

## ◆ set_max_lateness()

void Gst::BaseSink::set_max_lateness | ( | gint64 | max_lateness | ) |

Sets the new max lateness value to max_lateness.

This value is used to decide if a buffer should be dropped or not based on the buffer timestamp and the current clock time. A value of -1 means an unlimited time.

Parameters

  max_lateness | The new max lateness value.

## ◆ set_qos_enabled()

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

Configures sink to send Quality-of-Service events upstream.

Parameters

  enabled | The new qos value.

## ◆ set_render_delay()

void Gst::BaseSink::set_render_delay | ( | Gst::ClockTime | delay | ) |

Set the render delay in sink to delay.

The render delay is the time between actual rendering of a buffer and its synchronisation time. Some devices might delay media rendering which can be compensated for with this function.

After calling this function, this sink will report additional latency and other sinks will adjust their latency to delay the rendering of their media.

This function is usually called by subclasses.

Parameters

  delay | The new delay.

## ◆ set_sync()

void Gst::BaseSink::set_sync | ( | bool | sync | ) |

Configures sink to synchronize on the clock or not.

When sync is `false`, incoming samples will be played as fast as possible. If sync is `true`, the timestamps of the incoming buffers will be used to schedule the exact render time of its contents.

Parameters

  sync | The new sync value.

## ◆ set_throttle_time()

void Gst::BaseSink::set_throttle_time | ( | guint64 | throttle | ) |

Set the time that will be inserted between rendered buffers.

This can be used to control the maximum buffers per second that the sink will render.

Parameters

  throttle | The throttle time in nanoseconds.

## ◆ set_ts_offset()

void Gst::BaseSink::set_ts_offset | ( | Gst::ClockTimeDiff | offset | ) |

Adjust the synchronisation of sink with offset.

A negative value will render buffers earlier than their timestamp. A positive value will delay rendering. This function can be used to fix playback of badly timestamped buffers.

Parameters

  offset | The new offset.

## ◆ start_vfunc()

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

Start processing.

Ideal for opening resources in the subclass.

## ◆ stop_vfunc()

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

Stop processing.

Subclasses should use this to close resources.

## ◆ unlock_stop_vfunc()

virtual bool Gst::BaseSink::unlock_stop_vfunc | ( |  | ) |
| virtual

Clear the previous unlock request.

Subclasses should clear any state they set during unlock_vfunc(), such as clearing command queues.

## ◆ unlock_vfunc()

virtual bool Gst::BaseSink::unlock_vfunc | ( |  | ) |
| virtual

Unlock any pending access to the resource.

Subclasses should unblock any blocked function ASAP.

## ◆ wait() [1/2]

Gst::FlowReturn Gst::BaseSink::wait | ( | Gst::ClockTime | time | ) |

A wait() convenience overload.

## ◆ wait() [2/2]

Gst::FlowReturn Gst::BaseSink::wait | ( | Gst::ClockTime | time,
|  | Gst::ClockTimeDiff& | jitter
| ) |  |

This function will wait for preroll to complete and will then block until time is reached.

It is usually called by subclasses that use their own internal synchronisation but want to let some synchronization (like EOS) be handled by the base class.

This function should only be called with the PREROLL_LOCK held (like when receiving an EOS event in the signal_event() vmethod or when handling buffers in signal_render()).

The time argument should be the running_time of when the timeout should happen and will be adjusted with any latency and offset configured in the sink.

Parameters

  time | The running_time to be reached.
  jitter | The jitter to be filled with time diff, or `nullptr`.

Returns
  Gst::FlowReturn.

## ◆ wait_clock() [1/2]

Gst::ClockReturn Gst::BaseSink::wait_clock | ( | Gst::ClockTime | time | ) |

A wait_clock() convenience overload.

## ◆ wait_clock() [2/2]

Gst::ClockReturn Gst::BaseSink::wait_clock | ( | Gst::ClockTime | time,
|  | Gst::ClockTimeDiff& | jitter
| ) |  |

This function will block until time is reached.

It is usually called by subclasses that use their own internal synchronisation.

If time is not valid, no synchronisation is done and Gst::CLOCK_BADTIME is returned. Likewise, if synchronisation is disabled in the element or there is no clock, no synchronisation is done and Gst::CLOCK_BADTIME is returned.

This function should only be called with the PREROLL_LOCK held, like when receiving an EOS event in the Gst::BaseSinkClass.event() vmethod or when receiving a buffer in the Gst::BaseSinkClass.render() vmethod.

The time argument should be the running_time of when this method should return and is not adjusted with any latency or offset configured in the sink.

Parameters

  time | The running_time to be reached.
  jitter | The jitter to be filled with time diff, or `nullptr`.

Returns
  Gst::ClockReturn.

## ◆ wait_event_vfunc()

virtual FlowReturn Gst::BaseSink::wait_event_vfunc | ( | const Glib::RefPtr< Gst::Event >& | event | ) |
| virtual

Override this to implement custom logic to wait for the event time (for events like EOS and GAP).

Subclasses should always first chain up to the default implementation.

## ◆ wait_preroll()

Gst::FlowReturn Gst::BaseSink::wait_preroll | ( |  | ) |

If the Gst::BaseSinkClass.render() 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 render 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).

This function should only be called with the PREROLL_LOCK held, like in the render function.

Returns
  Gst::FLOW_OK if the preroll completed and processing can continue. Any other return value should be returned from the render vmethod.

## Friends And Related Function Documentation

## ◆ wrap()

Glib::RefPtr< Gst::BaseSink > wrap | ( | GstBaseSink * | 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.