2 * Copyright 2011 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * John Scipione, jscipione@gmail.com
9 * headers/os/media/Buffer.h rev 42274
10 * src/kits/media/Buffer.cpp rev 42274
18 \brief Defines the buffer_clone_info struct and BBuffer class.
23 \struct buffer_clone_info
26 \brief A struct that stores where in memory a BBuffer object is in memory
27 as well as the buffer flags.
35 \brief A reference to a chunk of memory useful for sharing media data
36 between applications and nodes.
41 \fn void* BBuffer::Data()
42 \brief Gets a pointer to the data of the buffer.
44 \returns A void* pointer to the data.
49 \fn size_t BBuffer::SizeAvailable()
50 \brief Gets the size of the buffer in bytes. Alias for Size().
52 \returns The buffer size in bytes
57 \fn size_t BBuffer::SizeUsed()
58 \brief Gets the size of the portion of the buffer that is currently in
61 \returns The currently used portion of the buffer size in bytes.
66 \fn void BBuffer::SetSizeUsed(size_t size_used)
67 \brief Sets the size of the buffer that is used in bytes.
69 This method should be called after writing data to the buffer.
74 \fn uint32 BBuffer::Flags()
75 \brief Gets the flags of the buffer.
77 \returns The buffer flags.
82 \fn void BBuffer::Recycle()
83 \brief Recycles the buffer so that it can be reused.
88 \fn buffer_clone_info BBuffer::CloneInfo() const
89 \brief Gets the \c buffer_clone_info struct that describes the buffer.
91 \returns The a clone of the \c buffer_clone_info struct.
96 \fn media_buffer_id BBuffer::ID()
97 \brief Gets the ID of the buffer according to the App Server.
99 \returns The App Server's ID of the buffer.
104 \fn media_type BBuffer::Type()
105 \brief Gets the media type of the data in the buffer.
107 \returns The media type of the data in the buffer.
112 \fn media_header* BBuffer::Header()
113 \brief Gets a pointer to the header of the buffer.
115 \returns A pointer to the header of the buffer.
120 \fn media_audio_header* BBuffer::AudioHeader()
121 \brief Gets a pointer to the header of the audio buffer.
123 \returns A pointer to the header of the audio buffer.
128 \fn media_video_header* BBuffer::VideoHeader()
129 \brief Gets a pointer to a header of the video buffer.
131 \returns A pointer to a header of the video buffer.
136 \fn size_t BBuffer::Size()
137 \brief Gets the size of the buffer in bytes.
139 Alias for SizeAvailable().
141 \returns The size of the buffer in bytes.