class BaseRingBuffer

Defined at line 23 of file ../../src/media/audio/audio_core/ring_buffer.h

Base class for streams based on ring buffers.

Protected Members

RefPtr vmo_mapper_
const int64_t frame_count_
RefPtr ref_time_to_frac_presentation_frame_
shared_ptr audio_clock_

Public Methods

int64_t size ()

Defined at line 66 of file ../../src/media/audio/audio_core/ring_buffer.h

int64_t frames ()

Defined at line 67 of file ../../src/media/audio/audio_core/ring_buffer.h

uint8_t * virt ()

Defined at line 68 of file ../../src/media/audio/audio_core/ring_buffer.h

std::shared_ptr<ReadableRingBuffer> CreateReadableHardwareBuffer (const Format & format, fbl::RefPtr<VersionedTimelineFunction> ref_time_to_frac_presentation_frame, std::shared_ptr<Clock> audio_clock, zx::vmo vmo, int64_t frame_count, SafeReadWriteFrameFn safe_read_frame)

Creates a ring buffer buffer backed by the given |vmo|.

Readable buffers will function as if there is an AudioInput device populating the |vmo| with

audio frames conforming to |format|. Essentially the ring will consider frames |frame_count|

frames before |ref_time_to_frac_presentation_frame(now)| to be valid.

Conversely, writable buffers will vend out empty buffers that are up to |frame_count| frames

ahead of |ref_time_to_frac_presentation_frame(now)|, with the expectation there is

a hardware device consuming frames at the trailing edge.

|safe_read_frame| reports the last safe read frame at the current time.

|safe_write_frame| reports the first safe write frame at the current time.

Defined at line 222 of file ../../src/media/audio/audio_core/ring_buffer.cc

std::shared_ptr<WritableRingBuffer> CreateWritableHardwareBuffer (const Format & format, fbl::RefPtr<VersionedTimelineFunction> ref_time_to_frac_presentation_frame, std::shared_ptr<Clock> audio_clock, zx::vmo vmo, int64_t frame_count, SafeReadWriteFrameFn safe_write_frame)

static

Defined at line 238 of file ../../src/media/audio/audio_core/ring_buffer.cc

Endpoints AllocateSoftwareBuffer (const Format & format, fbl::RefPtr<VersionedTimelineFunction> ref_time_to_frac_presentation_frame, std::shared_ptr<Clock> audio_clock, int64_t frame_count, SafeReadWriteFrameFn safe_write_frame)

Creates a ring buffer with a freshly-allocated VMO.

Defined at line 148 of file ../../src/media/audio/audio_core/ring_buffer.cc

Protected Methods

void ~BaseRingBuffer ()

Defined at line 75 of file ../../src/media/audio/audio_core/ring_buffer.h

void BaseRingBuffer (const Format & format, fbl::RefPtr<VersionedTimelineFunction> ref_time_to_frac_presentation_frame, std::shared_ptr<Clock> audio_clock, fbl::RefPtr<RefCountedVmoMapper> vmo_mapper, int64_t frame_count)

Defined at line 114 of file ../../src/media/audio/audio_core/ring_buffer.cc

BaseStream::TimelineFunctionSnapshot ReferenceClockToFixedImpl ()

Defined at line 314 of file ../../src/media/audio/audio_core/ring_buffer.cc

Records