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 * headers/os/media/Buffer.h rev 42274 10 * src/kits/media/Buffer.cpp rev 42274 11 */ 12 13 14/*! 15 \file Buffer.h 16 \ingroup media 17 \ingroup libbe 18 \brief Defines the buffer_clone_info struct and BBuffer class. 19*/ 20 21 22/*! 23 \struct buffer_clone_info 24 \ingroup media 25 \ingroup libbe 26 \brief A struct that stores where in memory a BBuffer object is in memory 27 as well as the buffer flags. 28*/ 29 30 31/*! 32 \class BBuffer 33 \ingroup media 34 \ingroup libbe 35 \brief A reference to a chunk of memory useful for sharing media data 36 between applications and nodes. 37*/ 38 39 40/*! 41 \fn void* BBuffer::Data() 42 \brief Gets a pointer to the data of the buffer. 43 44 \returns A void* pointer to the data. 45*/ 46 47 48/*! 49 \fn size_t BBuffer::SizeAvailable() 50 \brief Gets the size of the buffer in bytes. Alias for Size(). 51 52 \returns The buffer size in bytes 53*/ 54 55 56/*! 57 \fn size_t BBuffer::SizeUsed() 58 \brief Gets the size of the portion of the buffer that is currently in 59 use in bytes. 60 61 \returns The currently used portion of the buffer size in bytes. 62*/ 63 64 65/*! 66 \fn void BBuffer::SetSizeUsed(size_t size_used) 67 \brief Sets the size of the buffer that is used in bytes. 68 69 This method should be called after writing data to the buffer. 70*/ 71 72 73/*! 74 \fn uint32 BBuffer::Flags() 75 \brief Gets the flags of the buffer. 76 77 \returns The buffer flags. 78*/ 79 80 81/*! 82 \fn void BBuffer::Recycle() 83 \brief Recycles the buffer so that it can be reused. 84*/ 85 86 87/*! 88 \fn buffer_clone_info BBuffer::CloneInfo() const 89 \brief Gets the \c buffer_clone_info struct that describes the buffer. 90 91 \returns The a clone of the \c buffer_clone_info struct. 92*/ 93 94 95/*! 96 \fn media_buffer_id BBuffer::ID() 97 \brief Gets the ID of the buffer according to the App Server. 98 99 \returns The App Server's ID of the buffer. 100*/ 101 102 103/*! 104 \fn media_type BBuffer::Type() 105 \brief Gets the media type of the data in the buffer. 106 107 \returns The media type of the data in the buffer. 108*/ 109 110 111/*! 112 \fn media_header* BBuffer::Header() 113 \brief Gets a pointer to the header of the buffer. 114 115 \returns A pointer to the header of the buffer. 116*/ 117 118 119/*! 120 \fn media_audio_header* BBuffer::AudioHeader() 121 \brief Gets a pointer to the header of the audio buffer. 122 123 \returns A pointer to the header of the audio buffer. 124*/ 125 126 127/*! 128 \fn media_video_header* BBuffer::VideoHeader() 129 \brief Gets a pointer to a header of the video buffer. 130 131 \returns A pointer to a header of the video buffer. 132*/ 133 134 135/*! 136 \fn size_t BBuffer::Size() 137 \brief Gets the size of the buffer in bytes. 138 139 Alias for SizeAvailable(). 140 141 \returns The size of the buffer in bytes. 142*/ 143