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))
44 * The opaque #GstAdapter data structure.
46 typedef struct _GstAdapter GstAdapter;
47 typedef struct _GstAdapterClass GstAdapterClass;
49 GType gst_adapter_get_type (void);
51 GstAdapter * gst_adapter_new (void) G_GNUC_MALLOC;
53 void gst_adapter_clear (GstAdapter *adapter);
54 void gst_adapter_push (GstAdapter *adapter, GstBuffer* buf);
55 gconstpointer gst_adapter_map (GstAdapter *adapter, gsize size);
56 void gst_adapter_unmap (GstAdapter *adapter);
57 void gst_adapter_copy (GstAdapter *adapter, gpointer dest,
58 gsize offset, gsize size);
59 void gst_adapter_flush (GstAdapter *adapter, gsize flush);
60 gpointer gst_adapter_take (GstAdapter *adapter, gsize nbytes);
61 GstBuffer* gst_adapter_take_buffer (GstAdapter *adapter, gsize nbytes);
62 GList* gst_adapter_take_list (GstAdapter *adapter, gsize nbytes);
63 gsize gst_adapter_available (GstAdapter *adapter);
64 gsize gst_adapter_available_fast (GstAdapter *adapter);
66 GstClockTime gst_adapter_prev_pts (GstAdapter *adapter, guint64 *distance);
67 GstClockTime gst_adapter_prev_dts (GstAdapter *adapter, guint64 *distance);
69 gsize gst_adapter_masked_scan_uint32 (GstAdapter * adapter, guint32 mask,
70 guint32 pattern, gsize offset, gsize size);
72 gsize gst_adapter_masked_scan_uint32_peek (GstAdapter * adapter, guint32 mask,
73 guint32 pattern, gsize offset, gsize size, guint32 * value);
77 #endif /* __GST_ADAPTER_H__ */