2 * Copyright (C) 2004 Benjamin Otte <otte@gnome.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
22 #ifndef __GST_ADAPTER_H__
23 #define __GST_ADAPTER_H__
28 #define GST_TYPE_ADAPTER \
29 (gst_adapter_get_type())
30 #define GST_ADAPTER(obj) \
31 (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_ADAPTER, GstAdapter))
32 #define GST_ADAPTER_CLASS(klass) \
33 (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_ADAPTER, GstAdapterClass))
34 #define GST_ADAPTER_GET_CLASS(obj) \
35 (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_ADAPTER, GstAdapterClass))
36 #define GST_IS_ADAPTER(obj) \
37 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_ADAPTER))
38 #define GST_IS_ADAPTER_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_ADAPTER))
41 typedef struct _GstAdapter GstAdapter;
42 typedef struct _GstAdapterClass GstAdapterClass;
43 typedef struct _GstAdapterPrivate GstAdapterPrivate;
48 * The opaque #GstAdapter data structure.
59 /* we keep state of assembled pieces */
60 gpointer assembled_data;
64 GstAdapterPrivate *priv;
66 gpointer _gst_reserved[GST_PADDING];
69 struct _GstAdapterClass {
70 GObjectClass parent_class;
73 gpointer _gst_reserved[GST_PADDING];
76 GType gst_adapter_get_type (void);
78 GstAdapter * gst_adapter_new (void) G_GNUC_MALLOC;
80 void gst_adapter_clear (GstAdapter *adapter);
81 void gst_adapter_push (GstAdapter *adapter, GstBuffer* buf);
82 gconstpointer gst_adapter_map (GstAdapter *adapter, gsize size);
83 void gst_adapter_unmap (GstAdapter *adapter);
84 void gst_adapter_copy (GstAdapter *adapter, gpointer dest,
85 gsize offset, gsize size);
86 void gst_adapter_flush (GstAdapter *adapter, gsize flush);
87 gpointer gst_adapter_take (GstAdapter *adapter, gsize nbytes);
88 GstBuffer* gst_adapter_take_buffer (GstAdapter *adapter, gsize nbytes);
89 GList* gst_adapter_take_list (GstAdapter *adapter, gsize nbytes);
90 gsize gst_adapter_available (GstAdapter *adapter);
91 gsize gst_adapter_available_fast (GstAdapter *adapter);
93 GstClockTime gst_adapter_prev_pts (GstAdapter *adapter, guint64 *distance);
94 GstClockTime gst_adapter_prev_dts (GstAdapter *adapter, guint64 *distance);
96 gsize gst_adapter_masked_scan_uint32 (GstAdapter * adapter, guint32 mask,
97 guint32 pattern, gsize offset, gsize size);
99 gsize gst_adapter_masked_scan_uint32_peek (GstAdapter * adapter, guint32 mask,
100 guint32 pattern, gsize offset, gsize size, guint32 * value);
104 #endif /* __GST_ADAPTER_H__ */