1/* GStreamer
2 * Copyright (C) 2004 Benjamin Otte <otte@gnome.org>
3 *
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.
8 *
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.
13 *
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., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#include <gst/gst.h>
21
22#ifndef __GST_ADAPTER_H__
23#define __GST_ADAPTER_H__
24
25#include <gst/base/base-prelude.h>
26
27G_BEGIN_DECLS
28
29
30#define GST_TYPE_ADAPTER \
31 (gst_adapter_get_type())
32#define GST_ADAPTER(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_ADAPTER, GstAdapter))
34#define GST_ADAPTER_CLASS(klass) \
35 (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_ADAPTER, GstAdapterClass))
36#define GST_ADAPTER_GET_CLASS(obj) \
37 (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_ADAPTER, GstAdapterClass))
38#define GST_IS_ADAPTER(obj) \
39 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_ADAPTER))
40#define GST_IS_ADAPTER_CLASS(klass) \
41 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_ADAPTER))
42
43/**
44 * GstAdapter:
45 *
46 * The opaque #GstAdapter data structure.
47 */
48typedef struct _GstAdapter GstAdapter;
49typedef struct _GstAdapterClass GstAdapterClass;
50
51GST_BASE_API
52GType gst_adapter_get_type (void);
53
54GST_BASE_API
55GstAdapter * gst_adapter_new (void) G_GNUC_MALLOC;
56
57GST_BASE_API
58void gst_adapter_clear (GstAdapter *adapter);
59
60GST_BASE_API
61void gst_adapter_push (GstAdapter *adapter, GstBuffer* buf);
62
63GST_BASE_API
64gconstpointer gst_adapter_map (GstAdapter *adapter, gsize size);
65
66GST_BASE_API
67void gst_adapter_unmap (GstAdapter *adapter);
68
69GST_BASE_API
70void gst_adapter_copy (GstAdapter *adapter, gpointer dest,
71 gsize offset, gsize size);
72GST_BASE_API
73GBytes * gst_adapter_copy_bytes (GstAdapter *adapter,
74 gsize offset, gsize size);
75GST_BASE_API
76void gst_adapter_flush (GstAdapter *adapter, gsize flush);
77
78GST_BASE_API
79gpointer gst_adapter_take (GstAdapter *adapter, gsize nbytes);
80
81GST_BASE_API
82GstBuffer* gst_adapter_take_buffer (GstAdapter *adapter, gsize nbytes);
83
84GST_BASE_API
85GList* gst_adapter_take_list (GstAdapter *adapter, gsize nbytes);
86
87GST_BASE_API
88GstBuffer * gst_adapter_take_buffer_fast (GstAdapter *adapter, gsize nbytes);
89
90GST_BASE_API
91GstBufferList * gst_adapter_take_buffer_list (GstAdapter *adapter, gsize nbytes);
92
93GST_BASE_API
94GstBuffer* gst_adapter_get_buffer (GstAdapter *adapter, gsize nbytes);
95
96GST_BASE_API
97GList* gst_adapter_get_list (GstAdapter *adapter, gsize nbytes);
98
99GST_BASE_API
100GstBuffer * gst_adapter_get_buffer_fast (GstAdapter *adapter, gsize nbytes);
101
102GST_BASE_API
103GstBufferList * gst_adapter_get_buffer_list (GstAdapter *adapter, gsize nbytes);
104
105GST_BASE_API
106gsize gst_adapter_available (GstAdapter *adapter);
107
108GST_BASE_API
109gsize gst_adapter_available_fast (GstAdapter *adapter);
110
111GST_BASE_API
112GstClockTime gst_adapter_prev_pts (GstAdapter *adapter, guint64 *distance);
113
114GST_BASE_API
115GstClockTime gst_adapter_prev_dts (GstAdapter *adapter, guint64 *distance);
116
117GST_BASE_API
118GstClockTime gst_adapter_prev_pts_at_offset (GstAdapter * adapter, gsize offset, guint64 * distance);
119
120GST_BASE_API
121GstClockTime gst_adapter_prev_dts_at_offset (GstAdapter * adapter, gsize offset, guint64 * distance);
122
123GST_BASE_API
124guint64 gst_adapter_prev_offset (GstAdapter *adapter, guint64 *distance);
125
126GST_BASE_API
127GstClockTime gst_adapter_pts_at_discont (GstAdapter *adapter);
128
129GST_BASE_API
130GstClockTime gst_adapter_dts_at_discont (GstAdapter *adapter);
131
132GST_BASE_API
133guint64 gst_adapter_offset_at_discont (GstAdapter *adapter);
134
135GST_BASE_API
136guint64 gst_adapter_distance_from_discont (GstAdapter *adapter);
137
138GST_BASE_API
139gssize gst_adapter_masked_scan_uint32 (GstAdapter * adapter, guint32 mask,
140 guint32 pattern, gsize offset, gsize size);
141GST_BASE_API
142gssize gst_adapter_masked_scan_uint32_peek (GstAdapter * adapter, guint32 mask,
143 guint32 pattern, gsize offset, gsize size, guint32 * value);
144
145G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAdapter, gst_object_unref)
146
147G_END_DECLS
148
149#endif /* __GST_ADAPTER_H__ */
150

source code of include/gstreamer-1.0/gst/base/gstadapter.h