class VmoBackedBuffer

Defined at line 19 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h

Public Methods

void VmoBackedBuffer (const Format & format, int64_t frame_count)

Defined at line 21 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h

zx::vmo CreateAndMapVmo (bool writable_on_transfer)

Allocate an appropriately-sized VMO. The memory is initialized to all zeros.

Defined at line 25 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h

void MapVmo (const zx::vmo & vmo)

Map a pre-allocated VMO into this buffer. The memory is initialized to all zeros.

Defined at line 41 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h

bool IsValid ()

Reports whether the buffer has been allocated.

Defined at line 57 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h

int64_t SizeBytes ()

Size of this payload buffer.

Defined at line 60 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h

template <fuchsia::media::AudioSampleFormat SampleFormat>
AudioBuffer<SampleFormat> Snapshot ()

Take a snapshot of the buffer.

Defined at line 64 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h

template <fuchsia::media::AudioSampleFormat SampleFormat>
AudioBuffer<SampleFormat> SnapshotSlice (int64_t offset, int64_t size_bytes)

Take a snapshot of a slice of the buffer. The slice must not include a partial frame.

Defined at line 72 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h

int64_t GetCurrentOffset ()

Returns the offset (in frames) that will be written to by the next call to Append.

Defined at line 81 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h

template <fuchsia::media::AudioSampleFormat SampleFormat>
void Append (AudioBufferSlice<SampleFormat> slice)

Append a slice to the buffer, advancing the current seek position.

Defined at line 85 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h

void Clear ()

Reset the buffer to all zeros and seek to the start of the buffer.

Defined at line 91 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h

void Seek (int64_t offset)

Seek to the given offset of the buffer, relative to the start of the buffer.

Defined at line 97 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h

template <fuchsia::media::AudioSampleFormat SampleFormat>
void WriteAt (int64_t frame_number, AudioBufferSlice<SampleFormat> slice)

Write a slice to the given absolute frame number. The actual buffer index

is given by start_frame % buffer_size and the write can wrap-around the end

of the buffer, however the slice must fit within the buffer.

Defined at line 103 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h

void WriteRawBytesAt (int64_t offset, const std::vector<uint8_t> & bytes)

Write raw bytes to the given offset.

Defined at line 118 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h

template <fuchsia::media::AudioSampleFormat SampleFormat>
void Memset (typename SampleFormatTraits<SampleFormat>::SampleT value)

Set every sample to the given value.

Defined at line 126 of file ../../src/media/audio/audio_core/testing/integration/vmo_backed_buffer.h