Gst::Sample Class Reference

A Gst::Sample is a small object containing data, a type, timing and extra arbitrary information. More...

`#include <gstreamermm/sample.h>`

Inheritance diagram for Gst::Sample:
[legend]

## Public Member Functions

void | reference () const
| Increment the reference count for this object. More...
void | unreference () const
| Decrement the reference count for this object. More...
GstSample* | gobj ()
| Provides access to the underlying C instance. More...
const GstSample* | gobj () const
| Provides access to the underlying C instance. More...
GstSample* | gobj_copy () const
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
| Sample ()=delete
| Sample (const Sample&)=delete
Sample& | operator= (const Sample&)=delete
Glib::RefPtr< Gst::Buffer > | get_buffer ()
| Get the buffer associated with sample. More...
Glib::RefPtr< const Gst::Buffer > | get_buffer () const
| Get the buffer associated with sample. More...
Glib::RefPtr< Gst::Caps > | get_caps ()
| Get the caps associated with sample. More...
Glib::RefPtr< const Gst::Caps > | get_caps () const
| Get the caps associated with sample. More...
Gst::Structure | get_info () const
| Get extra information associated with sample. More...
Glib::RefPtr< Gst::Sample > | copy () const
| Create a copy of the given sample. More...
Gst::Segment | get_segment () const
| Get the segment associated with sample. More...
Public Member Functions inherited from Gst::MiniObject
void | reference () const
| Increment the reference count for this object. More...
void | unreference () const
| Decrement the reference count for this object. More...
GstMiniObject* | gobj ()
| Provides access to the underlying C instance. More...
const GstMiniObject* | gobj () const
| Provides access to the underlying C instance. More...
GstMiniObject* | gobj_copy () const
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
| MiniObject ()=delete
| MiniObject (const MiniObject&)=delete
MiniObject& | operator= (const MiniObject&)=delete
| ~MiniObject ()
guint | get_flags () const
void | set_flags (const guint& value)
gint | get_refcount () const
gint | get_lockstate () const
bool | lock (LockFlags flags)
| Lock the mini-object with the specified access mode in flags. More...
void | unlock (LockFlags flags)
| Unlock the mini-object with the specified access mode in flags. More...
bool | is_writable () const
| If mini_object has the LOCKABLE flag set, check if the current EXCLUSIVE lock on object is the only one, this means that changes to the object will not be visible to any other object. More...
Glib::RefPtr< MiniObject > | create_writable ()
| Checks if a mini-object is writable. More...
void | set_qdata (GQuark quark, QuarkData* data)
| This sets an opaque, named pointer on a miniobject. More...
QuarkData* | get_qdata (GQuark quark) const
| This function gets back user data pointers stored via set_qdata(). More...
QuarkData* | steal_qdata (GQuark quark)
| This function gets back user data pointers stored via set_qdata() and removes the data from object without invoking its destroy() function (if any was set). More...
void | add_finalize_notifier (const SlotFinalizer& slot)
| Adds notifier when mini object is finalized. More...
void | remove_finalize_notifier ()
| Remove finalize notifier. More...

## Static Public Member Functions

static Glib::RefPtr< Gst::Sample > | create (const Glib::RefPtr< Gst::Buffer >& buffer, const Glib::RefPtr< Gst::Caps >& caps, const Gst::Segment& segment, Gst::Structure&& info)

## Protected Member Functions

void | operator delete (void*, std::size_t)
Protected Member Functions inherited from Gst::MiniObject
void | operator delete (void*, std::size_t)

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gst::Sample > | wrap (GstSample* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...
Related Functions inherited from Gst::MiniObject
Glib::RefPtr< Gst::MiniObject > | wrap (GstMiniObject* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Additional Inherited Members

Public Types inherited from Gst::MiniObject
typedef sigc::slot< void > | SlotFinalizer

## Detailed Description

A Gst::Sample is a small object containing data, a type, timing and extra arbitrary information.

Last reviewed on 2016-09-14 (1.8.0).

## Constructor & Destructor Documentation

## Sample() [1/2]

Gst::Sample::Sample | ( |  | ) |

delete

## Sample() [2/2]

Gst::Sample::Sample | ( | const Sample& |  | ) |

delete

## Member Function Documentation

## copy()

Glib::RefPtr<Gst::Sample> Gst::Sample::copy | ( |  | ) | const

Create a copy of the given sample.

This will also make a newly allocated copy of the data the source sample contains.

Returns
  A new copy of buf.

## create()

static Glib::RefPtr<Gst::Sample> Gst::Sample::create | ( | const Glib::RefPtr< Gst::Buffer >& | buffer,
|  | const Glib::RefPtr< Gst::Caps >& | caps,
|  | const Gst::Segment& | segment,
|  | Gst::Structure&& | info
| ) |  |

static

## get_buffer() [1/2]

Glib::RefPtr<Gst::Buffer> Gst::Sample::get_buffer | ( |  | ) |

Get the buffer associated with sample.

Returns
  The buffer of sample or `nullptr` when there is no buffer. The buffer remains valid as long as sample is valid. If you need to hold on to it for longer than that, take a ref to the buffer with Gst::Buffer::ref().

## get_buffer() [2/2]

Glib::RefPtr<const Gst::Buffer> Gst::Sample::get_buffer | ( |  | ) | const

Get the buffer associated with sample.

Returns
  The buffer of sample or `nullptr` when there is no buffer. The buffer remains valid as long as sample is valid. If you need to hold on to it for longer than that, take a ref to the buffer with Gst::Buffer::ref().

## get_caps() [1/2]

Glib::RefPtr<Gst::Caps> Gst::Sample::get_caps | ( |  | ) |

Get the caps associated with sample.

Returns
  The caps of sample or `nullptr` when there is no caps. The caps remain valid as long as sample is valid. If you need to hold on to the caps for longer than that, take a ref to the caps with Gst::Caps::ref().

## get_caps() [2/2]

Glib::RefPtr<const Gst::Caps> Gst::Sample::get_caps | ( |  | ) | const

Get the caps associated with sample.

Returns
  The caps of sample or `nullptr` when there is no caps. The caps remain valid as long as sample is valid. If you need to hold on to the caps for longer than that, take a ref to the caps with Gst::Caps::ref().

## get_info()

Gst::Structure Gst::Sample::get_info | ( |  | ) | const

Get extra information associated with sample.

Returns
  The extra info of sample. The info remains valid as long as sample is valid.

## get_segment()

Gst::Segment Gst::Sample::get_segment | ( |  | ) | const

Get the segment associated with sample.

Returns
  The segment of sample. The segment remains valid as long as sample is valid.

## gobj() [1/2]

GstSample* Gst::Sample::gobj | ( |  | ) |

Provides access to the underlying C instance.

## gobj() [2/2]

const GstSample* Gst::Sample::gobj | ( |  | ) | const

Provides access to the underlying C instance.

## gobj_copy()

GstSample* Gst::Sample::gobj_copy | ( |  | ) | const

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

## operator delete()

void Gst::Sample::operator delete | ( | void * | ,
|  | std::size_t |
| ) |  |

protected

## operator=()

Sample& Gst::Sample::operator= | ( | const Sample& |  | ) |

delete

## reference()

void Gst::Sample::reference | ( |  | ) | const

Increment the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

## unreference()

void Gst::Sample::unreference | ( |  | ) | const

Decrement the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

## Friends And Related Function Documentation

## wrap()

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