GstSample

GstSample — A media sample

Synopsis

#include <gst/gst.h>

                    GstSample;
GstBuffer *         gst_sample_get_buffer               (GstSample *sample);
GstCaps *           gst_sample_get_caps                 (GstSample *sample);
const GstStructure * gst_sample_get_info                (GstSample *sample);
GstSegment *        gst_sample_get_segment              (GstSample *sample);
GstSample *         gst_sample_new                      (GstBuffer *buffer,
                                                         GstCaps *caps,
                                                         const GstSegment *segment,
                                                         GstStructure *info);
GstSample *         gst_sample_ref                      (GstSample *sample);
void                gst_sample_unref                    (GstSample *sample);
#define             gst_value_get_sample                (v)
#define             gst_value_set_sample                (v,
                                                         b)
#define             gst_value_take_sample               (v,
                                                         b)

Description

A GstSample is a small object containing data, a type, timing and extra arbitrary information.

Details

GstSample

typedef struct _GstSample GstSample;

gst_sample_get_buffer ()

GstBuffer *         gst_sample_get_buffer               (GstSample *sample);

Get the buffer associated with sample

sample :

a GstSample

Returns :

the buffer of sample or NULL when there is no buffer. The buffer remains valid as long as sample is valid. [transfer none]

gst_sample_get_caps ()

GstCaps *           gst_sample_get_caps                 (GstSample *sample);

Get the caps associated with sample

sample :

a GstSample

Returns :

the caps of sample or NULL when there is no caps. The caps remain valid as long as sample is valid. [transfer none]

gst_sample_get_info ()

const GstStructure * gst_sample_get_info                (GstSample *sample);

Get extra information associated with sample.

sample :

a GstSample

Returns :

the extra info of sample. The info remains valid as long as sample is valid. [transfer none]

gst_sample_get_segment ()

GstSegment *        gst_sample_get_segment              (GstSample *sample);

Get the segment associated with sample

sample :

a GstSample

Returns :

the segment of sample. The segment remains valid as long as sample is valid. [transfer none]

gst_sample_new ()

GstSample *         gst_sample_new                      (GstBuffer *buffer,
                                                         GstCaps *caps,
                                                         const GstSegment *segment,
                                                         GstStructure *info);

Create a new GstSample with the provided details.

Free-function: gst_sample_unref

buffer :

a GstBuffer

caps :

a GstCaps

segment :

a GstSegment

info :

a GstStructure

Returns :

the new GstSample. gst_sample_unref() after usage. [transfer full]

Since 0.10.24


gst_sample_ref ()

GstSample *         gst_sample_ref                      (GstSample *sample);

Increases the refcount of the given sample by one.

sample :

a GstSample

Returns :

sample. [transfer full]

gst_sample_unref ()

void                gst_sample_unref                    (GstSample *sample);

Decreases the refcount of the sample. If the refcount reaches 0, the sample will be freed.

sample :

a GstSample. [transfer full]

gst_value_get_sample()

#define         gst_value_get_sample(v)         GST_SAMPLE_CAST (g_value_get_boxed(v))

Receives a GstSample as the value of v. Does not return a reference to the sample, so the pointer is only valid for as long as the caller owns a reference to v.

v :

a GValue to query

Returns :

sample. [transfer none]

gst_value_set_sample()

#define         gst_value_set_sample(v,b)       g_value_set_boxed((v),(b))

Sets b as the value of v. Caller retains reference to sample.

v :

a GValue to receive the data

b :

a GstSample to assign to the GstValue. [transfer none]

gst_value_take_sample()

#define         gst_value_take_sample(v,b)      g_value_take_boxed(v,(b))

Sets b as the value of v. Caller gives away reference to sample.

v :

a GValue to receive the data

b :

a GstSample to assign to the GstValue. [transfer full]

See Also

GstBuffer, GstCaps, GstSegment