xref: /haiku/docs/user/media/Buffer.dox (revision a33f8fbdec035ff322cc1ef364877a3092e99a09)
1/*
2 * Copyright 2011, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		John Scipione, jscipione@gmail.com
7 *
8 * Corresponds to:
9 *		/trunk/headers/os/media/Buffer.h	 rev 42274
10 *		/trunk/src/kits/media/Buffer.cpp	 rev 42274
11 */
12
13
14/*!
15	\file Buffer.h
16	\brief Defines the buffer_clone_info struct and BBuffer class.
17*/
18
19
20/*!
21	\struct buffer_clone_info
22	\brief A struct that stores where in memory a BBuffer object is in memory
23		as well as the buffer flags.
24*/
25
26
27/*!
28	\class BBuffer
29	\ingroup media
30	\brief A reference to a chunk of memory useful for sharing media data
31		between applications and nodes.
32*/
33
34
35/*!
36	\fn void* BBuffer::Data()
37	\brief Returns a pointer to the data of the buffer.
38*/
39
40
41/*!
42	\fn size_t BBuffer::SizeAvailable()
43	\brief Returns the size of the buffer in bytes. Alias for Size().
44*/
45
46
47/*!
48	\fn size_t BBuffer::SizeUsed()
49	\brief Returns the size of the portion of the buffer that is currently in
50		use in bytes.
51*/
52
53
54/*!
55	\fn void BBuffer::SetSizeUsed(size_t size_used)
56	\brief Sets the size of the buffer that is used in bytes.
57
58	This method should be called after writing data to the buffer.
59*/
60
61
62/*!
63	\fn uint32 BBuffer::Flags()
64	\brief Returns the flags of the buffer.
65*/
66
67
68/*!
69	\fn void BBuffer::Recycle()
70	\brief Recycles the buffer so that it can be reused.
71*/
72
73
74/*!
75	\fn buffer_clone_info BBuffer::CloneInfo() const
76	\brief Returns the buffer_clone_info struct that describes the buffer.
77*/
78
79
80/*!
81	\fn media_buffer_id BBuffer::ID()
82	\brief Returns the app_server ID of the buffer.
83*/
84
85
86/*!
87	\fn media_type BBuffer::Type()
88	\brief Returns the media type of the data in the buffer.
89*/
90
91
92/*!
93	\fn media_header* BBuffer::Header()
94	\brief Returns a pointer to the header of the buffer.
95*/
96
97
98/*!
99	\fn media_audio_header* BBuffer::AudioHeader()
100	\brief Returns a pointer to a header of the audio buffer.
101*/
102
103
104/*!
105	\fn media_video_header* BBuffer::VideoHeader()
106	\brief Returns a pointer to a header of the video buffer.
107*/
108
109
110/*!
111	\fn size_t BBuffer::Size()
112	\brief Returns the size of the buffer in bytes. Alias for SizeAvailable().
113*/
114