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 Returns a pointer to the data of the buffer. 43*/ 44 45 46/*! 47 \fn size_t BBuffer::SizeAvailable() 48 \brief Returns the size of the buffer in bytes. Alias for Size(). 49*/ 50 51 52/*! 53 \fn size_t BBuffer::SizeUsed() 54 \brief Returns the size of the portion of the buffer that is currently in 55 use in bytes. 56*/ 57 58 59/*! 60 \fn void BBuffer::SetSizeUsed(size_t size_used) 61 \brief Sets the size of the buffer that is used in bytes. 62 63 This method should be called after writing data to the buffer. 64*/ 65 66 67/*! 68 \fn uint32 BBuffer::Flags() 69 \brief Returns the flags of the buffer. 70*/ 71 72 73/*! 74 \fn void BBuffer::Recycle() 75 \brief Recycles the buffer so that it can be reused. 76*/ 77 78 79/*! 80 \fn buffer_clone_info BBuffer::CloneInfo() const 81 \brief Returns the buffer_clone_info struct that describes the buffer. 82*/ 83 84 85/*! 86 \fn media_buffer_id BBuffer::ID() 87 \brief Returns the app_server ID of the buffer. 88*/ 89 90 91/*! 92 \fn media_type BBuffer::Type() 93 \brief Returns the media type of the data in the buffer. 94*/ 95 96 97/*! 98 \fn media_header* BBuffer::Header() 99 \brief Returns a pointer to the header of the buffer. 100*/ 101 102 103/*! 104 \fn media_audio_header* BBuffer::AudioHeader() 105 \brief Returns a pointer to a header of the audio buffer. 106*/ 107 108 109/*! 110 \fn media_video_header* BBuffer::VideoHeader() 111 \brief Returns a pointer to a header of the video buffer. 112*/ 113 114 115/*! 116 \fn size_t BBuffer::Size() 117 \brief Returns the size of the buffer in bytes. Alias for SizeAvailable(). 118*/ 119