class RendererShimImpl

Defined at line 31 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

This class is thread hostile: none of its methods can be called concurrently.

Public Methods

void SetPtsUnits (uint32_t ticks_per_second_numerator, uint32_t ticks_per_second_denominator)

Sets the units used by the presentation (media) timeline.

By default, we use format.frames_per_second / 1, which means 1 PTS tick = 1 frame.

See FIDL's AudioRenderer::SetPtsUnits.

Defined at line 44 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.cc

zx::time ReferenceTimeFromMonotonicTime (zx::time mono_time)

Return the time in the current reference clock that corresponds to the given monotonic time.

Defined at line 67 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.cc

void Play (TestFixture * fixture, zx::time reference_time, int64_t media_time)

Send a Play command to the renderer and wait until it is processed.

Either time may be NO_TIMESTAMP, as described in the FIDL documentation.

Defined at line 71 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.cc

template <fuchsia::media::AudioSampleFormat SampleFormat>
PacketVector AppendSlice (const AudioBuffer<SampleFormat> & buffer, int64_t frames_per_packet, int64_t initial_pts)

Overload to help template instantiation.

Defined at line 93 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

zx::time PlaySynchronized (TestFixture * fixture, VirtualDevice * output_device, int64_t media_time)

Like Play, but aligns the reference_time with the start of output_device's ring buffer.

Returns the reference_time at which the audio will start playing.

Defined at line 98 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.cc

void ClearPayload ()

Reset the payload buffer to all zeros and seek back to the start.

Defined at line 105 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

std::pair<int64_t, int64_t> Pause (TestFixture * fixture)

Send a Pause command to the renderer and wait until it is processed.

Defined at line 111 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.cc

void ~RendererShimImpl ()

Defined at line 33 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

fuchsia::media::AudioRendererPtr & fidl ()

Defined at line 35 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

VmoBackedBuffer & payload ()

Defined at line 36 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

const Format & format ()

Defined at line 37 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

const zx::clock & reference_clock ()

Defined at line 38 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

int64_t num_payload_frames ()

Defined at line 40 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

int64_t num_payload_samples ()

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

int64_t num_payload_bytes ()

Defined at line 42 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

zx::duration min_lead_time ()

Minimum lead time for the AudioRenderer.

Defined at line 45 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

std::string reporting_id_str ()

For validating properties exported by inspect. This mirrors what is done by class Reporter.

Reporter assigns a distinct 'id' to each renderer (see `next_renderer_id` in reporter.h),

reduces it to a string, and uses it as the node name for metrics reporting purposes.

Defined at line 110 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

template <fuchsia::media::AudioSampleFormat SampleFormat>
PacketVector AppendPackets (const std::vector<AudioBufferSlice<SampleFormat>> & slices, int64_t initial_pts)

Submit the given slices as a sequence of timestamped packets, with one packet per slice.

The packets are appended to the payload buffer. If the packets overrun the end of the buffer,

those extra packets will be queued and submitted once space becomes available in the buffer.

Defined at line 133 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.cc

template <fuchsia::media::AudioSampleFormat SampleFormat>
PacketVector AppendSlice (AudioBufferSlice<SampleFormat> slice, int64_t frames_per_packet, int64_t initial_pts)

Submit the given slice as a sequence of timestamped packets, with this slice divided into

packets of size frames_per_packet.

Defined at line 165 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.cc

void WaitForPackets (TestFixture * fixture, const PacketVector & packets, int64_t ring_out_frames)

Wait until the given packets are rendered. |packets| must be non-empty and must be ordered by

start_pts. If |ring_out_frames| > 0, we wait for all |packets| to be rendered, plus an

additional |ring_out_frames|.

Defined at line 238 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.cc

Protected Methods

void RendererShimImpl (Format format, int64_t payload_frame_count, size_t reporting_id)

Defined at line 18 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.cc

void SetReferenceClock (TestFixture * fixture, const zx::clock & clock)

Defined at line 52 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.cc

void RetrieveReferenceClock (TestFixture * fixture)

Defined at line 58 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.cc

void ResetEvents ()
void WatchEvents ()

Defined at line 31 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.cc

VmoBackedBuffer & payload_buffer ()

Defined at line 119 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

bool has_min_lead_time ()

Defined at line 120 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

void set_reference_clock (zx::clock reference_clock)

Defined at line 122 of file ../../src/media/audio/audio_core/testing/integration/renderer_shim.h

Records