c9b4569d4465338fb05d5898d78a679d92b396bd
[platform/upstream/gstreamer.git] / docs / gst / tmpl / gstbufferpool.sgml
1 <!-- ##### SECTION Title ##### -->
2 GstBufferPool
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Create buffers from a pool
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 A bufferpool is used to create buffers in an efficient way. En element
10 can maintain a bufferpool with a fixed number of buffers. This will reduce
11 the g_malloc and g_free overhead.
12 </para>
13 <para>
14 A bufferpool can also be used to implement direct access. A bufferpool can be
15 sent from one element to another so that the latter can directly write into
16 the memory of the element that maintains the bufferpool. This can greatly reduce
17 the number of memcpy operations.
18 </para>
19 <para>
20 A bufferpool is created with gst_buffer_pool_new(). You'll have to set the
21 buffer allocation and destroy function afterwards with gst_buffer_pool_set_create_function() and
22 gst_buffer_pool_set_destroy_function().
23 </para>
24 <para>
25 To create a buffer from the bufferpool use gst_buffer_pool_new_buffer(), which is 
26 functionally equivalent to gst_buffer_new_from_pool().
27 </para>
28 <para>
29 When the buffer is unreffed and has reached a refcount of 0, the bufferpools destroy
30 function is called with the buffer as an argument.
31 </para>
32 <para>
33 A bufferpool can store private data in the buffer it creates with the GST_BUFFER_POOL_PRIVATE()
34 macro. To check it a buffer was made by a specific bufferpool, use the GST_BUFFER_BUFFERPOOL()
35 macro to get it's bufferpool.
36 </para>
37 <para>
38 Destroy the bufferpool with gst_buffer_pool_destroy().
39 </para>
40 <para>
41 A bufferpool can be requested from a pad with the gst_pad_get_bufferpool() function.
42 </para>
43
44 <!-- ##### SECTION See_Also ##### -->
45 <para>
46 #GstBuffer, #GstPad
47 </para>
48
49 <!-- ##### STRUCT GstBufferPool ##### -->
50 <para>
51
52 </para>
53
54 @lock: 
55 @buffer_free: 
56 @buffer_copy: 
57 @destroy_hook: 
58 @user_data: 
59
60 <!-- ##### USER_FUNCTION GstBufferPoolBufferNewFunction ##### -->
61 <para>
62
63 </para>
64
65 @pool: 
66 @location: 
67 @size: 
68 @user_data: 
69 @Returns: 
70
71
72 <!-- ##### USER_FUNCTION GstBufferPoolDestroyHook ##### -->
73 <para>
74
75 </para>
76
77 @pool: 
78 @user_data: 
79
80
81 <!-- ##### MACRO GST_BUFFER_POOL_UNLOCK ##### -->
82 <para>
83 Lock the given bufferpool.
84 </para>
85
86 @pool: The pool to lock.
87
88
89 <!-- ##### MACRO GST_BUFFER_POOL_LOCK ##### -->
90 <para>
91 Unlock the given bufferpool.
92 </para>
93
94 @pool: the bufferpool to unlock.
95
96
97 <!-- ##### FUNCTION gst_buffer_pool_new ##### -->
98 <para>
99
100 </para>
101
102 @Returns: 
103
104
105 <!-- ##### FUNCTION gst_buffer_pool_ref ##### -->
106 <para>
107
108 </para>
109
110 @pool: 
111
112
113 <!-- ##### FUNCTION gst_buffer_pool_ref_by_count ##### -->
114 <para>
115
116 </para>
117
118 @pool: 
119 @count: 
120
121
122 <!-- ##### FUNCTION gst_buffer_pool_unref ##### -->
123 <para>
124
125 </para>
126
127 @pool: 
128 <!-- # Unused Parameters # -->
129 @buffer: 
130
131
132 <!-- ##### FUNCTION gst_buffer_pool_destroy ##### -->
133 <para>
134
135 </para>
136
137 @pool: 
138
139
140 <!-- ##### FUNCTION gst_buffer_pool_get_default ##### -->
141 <para>
142
143 </para>
144
145 @buffer_size: 
146 @pool_size: 
147 @Returns: 
148 <!-- # Unused Parameters # -->
149 @oldpool: 
150
151
152 <!-- ##### FUNCTION gst_buffer_pool_set_user_data ##### -->
153 <para>
154
155 </para>
156
157 @pool: 
158 @user_data: 
159
160
161 <!-- ##### FUNCTION gst_buffer_pool_get_user_data ##### -->
162 <para>
163
164 </para>
165
166 @pool: 
167 @Returns: 
168 <!-- # Unused Parameters # -->
169 @user_data: 
170
171
172 <!-- ##### FUNCTION gst_buffer_pool_set_buffer_copy_function ##### -->
173 <para>
174
175 </para>
176
177 @pool: 
178 @copy: 
179
180
181 <!-- ##### FUNCTION gst_buffer_pool_set_buffer_free_function ##### -->
182 <para>
183
184 </para>
185
186 @pool: 
187 @destroy: 
188
189
190 <!-- ##### FUNCTION gst_buffer_pool_set_buffer_new_function ##### -->
191 <para>
192
193 </para>
194
195 @pool: 
196 @create: 
197
198
199 <!-- ##### FUNCTION gst_buffer_pool_set_destroy_hook ##### -->
200 <para>
201
202 </para>
203
204 @pool: 
205 @destroy: 
206
207