libs: base: mark symbols explicitly for export with GST_EXPORT
[platform/upstream/gstreamer.git] / libs / gst / base / gstadapter.h
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 G_BEGIN_DECLS
26
27
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))
40
41 /**
42  * GstAdapter:
43  *
44  * The opaque #GstAdapter data structure.
45  */
46 typedef struct _GstAdapter GstAdapter;
47 typedef struct _GstAdapterClass GstAdapterClass;
48
49 GST_EXPORT
50 GType                   gst_adapter_get_type            (void);
51
52 GST_EXPORT
53 GstAdapter *            gst_adapter_new                 (void) G_GNUC_MALLOC;
54
55 GST_EXPORT
56 void                    gst_adapter_clear               (GstAdapter *adapter);
57
58 GST_EXPORT
59 void                    gst_adapter_push                (GstAdapter *adapter, GstBuffer* buf);
60
61 GST_EXPORT
62 gconstpointer           gst_adapter_map                 (GstAdapter *adapter, gsize size);
63
64 GST_EXPORT
65 void                    gst_adapter_unmap               (GstAdapter *adapter);
66
67 GST_EXPORT
68 void                    gst_adapter_copy                (GstAdapter *adapter, gpointer dest,
69                                                          gsize offset, gsize size);
70 GST_EXPORT
71 GBytes *                gst_adapter_copy_bytes          (GstAdapter *adapter,
72                                                          gsize offset, gsize size);
73 GST_EXPORT
74 void                    gst_adapter_flush               (GstAdapter *adapter, gsize flush);
75
76 GST_EXPORT
77 gpointer                gst_adapter_take                (GstAdapter *adapter, gsize nbytes);
78
79 GST_EXPORT
80 GstBuffer*              gst_adapter_take_buffer         (GstAdapter *adapter, gsize nbytes);
81
82 GST_EXPORT
83 GList*                  gst_adapter_take_list           (GstAdapter *adapter, gsize nbytes);
84
85 GST_EXPORT
86 GstBuffer *             gst_adapter_take_buffer_fast    (GstAdapter *adapter, gsize nbytes);
87
88 GST_EXPORT
89 GstBufferList *         gst_adapter_take_buffer_list    (GstAdapter *adapter, gsize nbytes);
90
91 GST_EXPORT
92 GstBuffer*              gst_adapter_get_buffer          (GstAdapter *adapter, gsize nbytes);
93
94 GST_EXPORT
95 GList*                  gst_adapter_get_list            (GstAdapter *adapter, gsize nbytes);
96
97 GST_EXPORT
98 GstBuffer *             gst_adapter_get_buffer_fast     (GstAdapter *adapter, gsize nbytes);
99
100 GST_EXPORT
101 GstBufferList *         gst_adapter_get_buffer_list     (GstAdapter *adapter, gsize nbytes);
102
103 GST_EXPORT
104 gsize                   gst_adapter_available           (GstAdapter *adapter);
105
106 GST_EXPORT
107 gsize                   gst_adapter_available_fast      (GstAdapter *adapter);
108
109 GST_EXPORT
110 GstClockTime            gst_adapter_prev_pts            (GstAdapter *adapter, guint64 *distance);
111
112 GST_EXPORT
113 GstClockTime            gst_adapter_prev_dts            (GstAdapter *adapter, guint64 *distance);
114
115 GST_EXPORT
116 GstClockTime            gst_adapter_prev_pts_at_offset  (GstAdapter * adapter, gsize offset, guint64 * distance);
117
118 GST_EXPORT
119 GstClockTime            gst_adapter_prev_dts_at_offset  (GstAdapter * adapter, gsize offset, guint64 * distance);
120
121 GST_EXPORT
122 guint64                 gst_adapter_prev_offset         (GstAdapter *adapter, guint64 *distance);
123
124 GST_EXPORT
125 GstClockTime            gst_adapter_pts_at_discont      (GstAdapter *adapter);
126
127 GST_EXPORT
128 GstClockTime            gst_adapter_dts_at_discont      (GstAdapter *adapter);
129
130 GST_EXPORT
131 guint64                 gst_adapter_offset_at_discont   (GstAdapter *adapter);
132
133 GST_EXPORT
134 guint64                 gst_adapter_distance_from_discont (GstAdapter *adapter);
135
136 GST_EXPORT
137 gssize                  gst_adapter_masked_scan_uint32  (GstAdapter * adapter, guint32 mask,
138                                                          guint32 pattern, gsize offset, gsize size);
139 GST_EXPORT
140 gssize                  gst_adapter_masked_scan_uint32_peek  (GstAdapter * adapter, guint32 mask,
141                                                          guint32 pattern, gsize offset, gsize size, guint32 * value);
142
143 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
144 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAdapter, gst_object_unref)
145 #endif
146
147 G_END_DECLS
148
149 #endif /* __GST_ADAPTER_H__ */