class MemoryMappedBuffer
Defined at line 19 of file ../../src/media/audio/services/common/memory_mapped_buffer.h
A simple wrapper around a VMO that is used as a payload buffer for audio data. Typically there
are many packets per buffer. The buffer should be `writable` iff the buffer will be written by
the mixer service, such as when producing captured audio. The buffer may be DISCARDABLE but
cannot be RESIZABLE.
Public Methods
void * start ()
Returns the start address of the buffer.
Defined at line 35 of file ../../src/media/audio/services/common/memory_mapped_buffer.h
void * end ()
Returns the end address of the buffer.
Defined at line 38 of file ../../src/media/audio/services/common/memory_mapped_buffer.h
void * offset (size_t bytes_from_start)
Returns a byte offset within this buffer.
Defined at line 41 of file ../../src/media/audio/services/common/memory_mapped_buffer.h
fpromise::result<std::shared_ptr<MemoryMappedBuffer>, std::string> Create (const zx::vmo & vmo, size_t size, bool writable)
Creates a MemoryMappedBuffer from the given object, which must be a valid, readable,
non-resizable, and mappable VMO, and if `writable`, the VMO must be writable. The
`size` must fit within the VMO.
Defined at line 43 of file ../../src/media/audio/services/common/memory_mapped_buffer.cc
size_t size ()
Returns the size of the buffer.
Defined at line 46 of file ../../src/media/audio/services/common/memory_mapped_buffer.h
fpromise::result<std::shared_ptr<MemoryMappedBuffer>, std::string> CreateWithFullSize (const zx::vmo & vmo, bool writable)
Like Create, but sets `size` to the full size of the VMO.
Defined at line 118 of file ../../src/media/audio/services/common/memory_mapped_buffer.cc
std::shared_ptr<MemoryMappedBuffer> CreateOrDie (size_t size, bool writable)
Creates a MemoryMappedBuffer with the given size, crashing if the buffer cannot be created.
Defined at line 129 of file ../../src/media/audio/services/common/memory_mapped_buffer.cc