gst/gstpad.c: Remove handling of filtered caps. Fix/merge functions that handle...
[platform/upstream/gstreamer.git] / docs / random / ds / bufferpools
1 On Thu, Jan 08, 2004 at 04:10:00PM +0100, Julien MOUTTE wrote:
2
3 > Hi David,
4
5 > I'd like to implement bufferpools again in x[v]imagesink asap.. Could
6 > you please point me to a template/doc on how to do that ?
7
8 > The best for me would be a simple testcase showing how to use the buffer
9 > free methods to replace bufferpools.
10
11
12 x[v]imagesink should call gst_pad_set_bufferalloc_function() on
13 their sink pads with a bufferalloc implementation.  This bufferalloc
14 function is to allocate buffers that _peers_ will send _to_ that pad.
15
16 A trivial version of a bufferalloc function, i.e., one that just
17 allocates normal buffers:
18
19 static GstBuffer *
20 gst_ximagesink_sink_bufferalloc (GstPad *pad, guint64 offset, guint
21 size)
22 {
23   GstBuffer *buffer;
24
25   buffer = gst_buffer_new_and_alloc (size);
26   GST_DATA_FREE_FUNC (data) = gst_ximagesink_buffer_free;
27   GST_BUFFER_POOL_PRIVATE (data) = ximagesink; /* whatever */
28
29   return buffer;
30 }
31
32 static void
33 gst_ximagesink_buffer_free (GstData *data)
34 {
35   g_free (GST_BUFFER_DATA (data));
36 }
37
38 The hard part is going through each element, and every time it
39 allocates a buffer using gst_buffer_new_and_alloc () that is then
40 sent to a sink pad, the call should be replaced with
41 gst_pad_alloc_buffer (sinkpad, offset, size).
42
43
44
45 dave...
46
47
48
49 -------------------------------------------------------
50 This SF.net email is sponsored by: Perforce Software.
51 Perforce is the Fast Software Configuration Management System offering
52 advanced branching capabilities and atomic changes on 50+ platforms.
53 Free Eval! http://www.perforce.com/perforce/loadprog.html
54 _______________________________________________
55 gstreamer-devel mailing list
56 gstreamer-devel@lists.sourceforge.net
57 https://lists.sourceforge.net/lists/listinfo/gstreamer-devel