Blame gst/gstsample.h

Packit Service 963350
/* GStreamer
Packit Service 963350
 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
Packit Service 963350
 *                    2000 Wim Taymans <wtay@chello.be>
Packit Service 963350
 *
Packit Service 963350
 * gstsample.h: Header for GstSample object
Packit Service 963350
 *
Packit Service 963350
 * This library is free software; you can redistribute it and/or
Packit Service 963350
 * modify it under the terms of the GNU Library General Public
Packit Service 963350
 * License as published by the Free Software Foundation; either
Packit Service 963350
 * version 2 of the License, or (at your option) any later version.
Packit Service 963350
 *
Packit Service 963350
 * This library is distributed in the hope that it will be useful,
Packit Service 963350
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 963350
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 963350
 * Library General Public License for more details.
Packit Service 963350
 *
Packit Service 963350
 * You should have received a copy of the GNU Library General Public
Packit Service 963350
 * License along with this library; if not, write to the
Packit Service 963350
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit Service 963350
 * Boston, MA 02110-1301, USA.
Packit Service 963350
 */
Packit Service 963350
Packit Service 963350
Packit Service 963350
#ifndef __GST_SAMPLE_H__
Packit Service 963350
#define __GST_SAMPLE_H__
Packit Service 963350
Packit Service 963350
#include <gst/gstbuffer.h>
Packit Service 963350
#include <gst/gstbufferlist.h>
Packit Service 963350
#include <gst/gstcaps.h>
Packit Service 963350
#include <gst/gstsegment.h>
Packit Service 963350
Packit Service 963350
G_BEGIN_DECLS
Packit Service 963350
Packit Service 963350
GST_API GType _gst_sample_type;
Packit Service 963350
Packit Service 963350
#define GST_TYPE_SAMPLE      (_gst_sample_type)
Packit Service 963350
#define GST_IS_SAMPLE(obj)   (GST_IS_MINI_OBJECT_TYPE(obj, GST_TYPE_SAMPLE))
Packit Service 963350
#define GST_SAMPLE_CAST(obj) ((GstSample *)obj)
Packit Service 963350
#define GST_SAMPLE(obj)      (GST_SAMPLE_CAST(obj))
Packit Service 963350
Packit Service 963350
/**
Packit Service 963350
 * GstSample:
Packit Service 963350
 *
Packit Service 963350
 * The opaque structure of a #GstSample. A sample contains a typed memory
Packit Service 963350
 * block and the associated timing information. It is mainly used to
Packit Service 963350
 * exchange buffers with an application.
Packit Service 963350
 */
Packit Service 963350
typedef struct _GstSample GstSample;
Packit Service 963350
Packit Service 963350
GST_API
Packit Service 963350
GType                gst_sample_get_type      (void);
Packit Service 963350
Packit Service 963350
/* allocation */
Packit Service 963350
Packit Service 963350
GST_API
Packit Service 963350
GstSample *          gst_sample_new           (GstBuffer          *buffer,
Packit Service 963350
                                               GstCaps            *caps,
Packit Service 963350
                                               const GstSegment   *segment,
Packit Service 963350
                                               GstStructure       *info);
Packit Service 963350
GST_API
Packit Service 963350
GstBuffer *          gst_sample_get_buffer    (GstSample *sample);
Packit Service 963350
Packit Service 963350
GST_API
Packit Service 963350
GstCaps *            gst_sample_get_caps      (GstSample *sample);
Packit Service 963350
Packit Service 963350
GST_API
Packit Service 963350
GstSegment *         gst_sample_get_segment   (GstSample *sample);
Packit Service 963350
Packit Service 963350
GST_API
Packit Service 963350
const GstStructure * gst_sample_get_info      (GstSample *sample);
Packit Service 963350
Packit Service 963350
GST_API
Packit Service 963350
GstBufferList *      gst_sample_get_buffer_list (GstSample *sample);
Packit Service 963350
Packit Service 963350
GST_API
Packit Service 963350
void                 gst_sample_set_buffer_list (GstSample *sample, GstBufferList *buffer_list);
Packit Service 963350
Packit Service 963350
/* refcounting */
Packit Service 963350
/**
Packit Service 963350
 * gst_sample_ref:
Packit Service 963350
 * @sample: a #GstSample
Packit Service 963350
 *
Packit Service 963350
 * Increases the refcount of the given sample by one.
Packit Service 963350
 *
Packit Service 963350
 * Returns: (transfer full): @sample
Packit Service 963350
 */
Packit Service 963350
static inline GstSample *
Packit Service 963350
gst_sample_ref (GstSample * sample)
Packit Service 963350
{
Packit Service 963350
  return GST_SAMPLE_CAST (gst_mini_object_ref (GST_MINI_OBJECT_CAST (
Packit Service 963350
      sample)));
Packit Service 963350
}
Packit Service 963350
Packit Service 963350
/**
Packit Service 963350
 * gst_sample_unref:
Packit Service 963350
 * @sample: (transfer full): a #GstSample
Packit Service 963350
 *
Packit Service 963350
 * Decreases the refcount of the sample. If the refcount reaches 0, the
Packit Service 963350
 * sample will be freed.
Packit Service 963350
 */
Packit Service 963350
static inline void
Packit Service 963350
gst_sample_unref (GstSample * sample)
Packit Service 963350
{
Packit Service 963350
  gst_mini_object_unref (GST_MINI_OBJECT_CAST (sample));
Packit Service 963350
}
Packit Service 963350
Packit Service 963350
/* copy sample */
Packit Service 963350
/**
Packit Service 963350
 * gst_sample_copy:
Packit Service 963350
 * @buf: a #GstSample.
Packit Service 963350
 *
Packit Service 963350
 * Create a copy of the given sample. This will also make a newly allocated
Packit Service 963350
 * copy of the data the source sample contains.
Packit Service 963350
 *
Packit Service 963350
 * Returns: (transfer full): a new copy of @buf.
Packit Service 963350
 *
Packit Service 963350
 * Since: 1.2
Packit Service 963350
 */
Packit Service 963350
static inline GstSample *
Packit Service 963350
gst_sample_copy (const GstSample * buf)
Packit Service 963350
{
Packit Service 963350
  return GST_SAMPLE_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CONST_CAST (buf)));
Packit Service 963350
}
Packit Service 963350
Packit Service 963350
/**
Packit Service 963350
 * gst_value_set_sample:
Packit Service 963350
 * @v: a #GValue to receive the data
Packit Service 963350
 * @b: (transfer none): a #GstSample to assign to the GstValue
Packit Service 963350
 *
Packit Service 963350
 * Sets @b as the value of @v.  Caller retains reference to sample.
Packit Service 963350
 */
Packit Service 963350
#define         gst_value_set_sample(v,b)       g_value_set_boxed((v),(b))
Packit Service 963350
/**
Packit Service 963350
 * gst_value_take_sample:
Packit Service 963350
 * @v: a #GValue to receive the data
Packit Service 963350
 * @b: (transfer full): a #GstSample to assign to the GstValue
Packit Service 963350
 *
Packit Service 963350
 * Sets @b as the value of @v.  Caller gives away reference to sample.
Packit Service 963350
 */
Packit Service 963350
#define         gst_value_take_sample(v,b)      g_value_take_boxed(v,(b))
Packit Service 963350
/**
Packit Service 963350
 * gst_value_get_sample:
Packit Service 963350
 * @v: a #GValue to query
Packit Service 963350
 *
Packit Service 963350
 * Receives a #GstSample as the value of @v. Does not return a reference to
Packit Service 963350
 * the sample, so the pointer is only valid for as long as the caller owns
Packit Service 963350
 * a reference to @v.
Packit Service 963350
 *
Packit Service 963350
 * Returns: (transfer none): sample
Packit Service 963350
 */
Packit Service 963350
#define         gst_value_get_sample(v)         GST_SAMPLE_CAST (g_value_get_boxed(v))
Packit Service 963350
Packit Service 963350
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
Packit Service 963350
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstSample, gst_sample_unref)
Packit Service 963350
#endif
Packit Service 963350
Packit Service 963350
G_END_DECLS
Packit Service 963350
Packit Service 963350
#endif /* __GST_SAMPLE_H__ */