class Format

Defined at line 28 of file ../../src/media/audio/lib/format2/format.h

Format wraps a `fuchsia.audio.Format` FIDL table.

Public Methods

void Format (const Format & )

Defined at line 73 of file ../../src/media/audio/lib/format2/format.h

Format & operator= (const Format & )

Defined at line 74 of file ../../src/media/audio/lib/format2/format.h

bool operator!= (const Format & rhs)

Defined at line 77 of file ../../src/media/audio/lib/format2/format.h

fuchsia_audio::SampleType sample_type ()

Defined at line 92 of file ../../src/media/audio/lib/format2/format.h

int64_t channels ()

Defined at line 93 of file ../../src/media/audio/lib/format2/format.h

int64_t frames_per_second ()

Defined at line 94 of file ../../src/media/audio/lib/format2/format.h

int64_t bytes_per_frame ()

Defined at line 96 of file ../../src/media/audio/lib/format2/format.h

int64_t bytes_per_sample ()

Defined at line 97 of file ../../src/media/audio/lib/format2/format.h

int32_t valid_bits_per_sample ()

Defined at line 98 of file ../../src/media/audio/lib/format2/format.h

const media::TimelineRate & frames_per_ns ()

Returns the frame rate as ratio of frames per nanoseconds.

Defined at line 101 of file ../../src/media/audio/lib/format2/format.h

const media::TimelineRate & frac_frames_per_ns ()

Defined at line 102 of file ../../src/media/audio/lib/format2/format.h

fpromise::result<Format, std::string> Create (fuchsia_audio::wire::Format msg)

Creates a Format from a wire FIDL object, a natural FIDL object, or an inline struct. The wire

types are passed by value because they're either a simple pointer (for FIDL tables) or a small

struct (for FIDL structs). The natural types are passed by reference because cloning those

types always involves an allocation, even for FIDL structs.

Returns an error if the struct contains invalid parameters.

Defined at line 108 of file ../../src/media/audio/lib/format2/format.cc

fpromise::result<Format, std::string> Create (const fuchsia_audio::Format & msg)

Defined at line 126 of file ../../src/media/audio/lib/format2/format.cc

fpromise::result<Format, std::string> Create (fuchsia_hardware_audio::wire::Format msg)

Defined at line 144 of file ../../src/media/audio/lib/format2/format.cc

fpromise::result<Format, std::string> Create (fuchsia_hardware_audio::wire::PcmFormat msg)

Defined at line 151 of file ../../src/media/audio/lib/format2/format.cc

fpromise::result<Format, std::string> Create (const fuchsia_hardware_audio::Format & msg)

Defined at line 173 of file ../../src/media/audio/lib/format2/format.cc

fpromise::result<Format, std::string> Create (const fuchsia_hardware_audio::PcmFormat & msg)

Defined at line 180 of file ../../src/media/audio/lib/format2/format.cc

fpromise::result<Format, std::string> Create (Args args)

Defined at line 190 of file ../../src/media/audio/lib/format2/format.cc

Format CreateOrDie (fuchsia_audio::wire::Format msg)

Creates a Format from a wire FIDL object, a natural FIDL object, or an inline struct.

Crashes if the the struct contains invalid parameters.

Defined at line 216 of file ../../src/media/audio/lib/format2/format.cc

Format CreateOrDie (const fuchsia_audio::Format & msg)

Defined at line 224 of file ../../src/media/audio/lib/format2/format.cc

Format CreateOrDie (Args args)

Defined at line 232 of file ../../src/media/audio/lib/format2/format.cc

fpromise::result<Format, std::string> CreateLegacy (const fuchsia_mediastreams::AudioFormat & msg)

TODO(https://fxbug.dev/42066204): Remove when fuchsia.audio.effects has migrated to the new

types.

Defined at line 240 of file ../../src/media/audio/lib/format2/format.cc

fpromise::result<Format, std::string> CreateLegacy (fuchsia_mediastreams::wire::AudioFormat msg)

Defined at line 256 of file ../../src/media/audio/lib/format2/format.cc

Format CreateLegacyOrDie (const fuchsia_mediastreams::AudioFormat & msg)

Defined at line 272 of file ../../src/media/audio/lib/format2/format.cc

Format CreateLegacyOrDie (fuchsia_mediastreams::wire::AudioFormat msg)

Defined at line 280 of file ../../src/media/audio/lib/format2/format.cc

fpromise::result<Format, std::string> CreateLegacy (const fuchsia_media::AudioStreamType & msg)

TODO(https://fxbug.dev/42066782): Remove when audio_core/v2 is deleted.

Defined at line 288 of file ../../src/media/audio/lib/format2/format.cc

fpromise::result<Format, std::string> CreateLegacy (fuchsia_media::wire::AudioStreamType msg)

Defined at line 304 of file ../../src/media/audio/lib/format2/format.cc

Format CreateLegacyOrDie (const fuchsia_media::AudioStreamType & msg)

Defined at line 320 of file ../../src/media/audio/lib/format2/format.cc

Format CreateLegacyOrDie (fuchsia_media::wire::AudioStreamType msg)

Defined at line 328 of file ../../src/media/audio/lib/format2/format.cc

bool operator== (const Format & rhs)

Defined at line 368 of file ../../src/media/audio/lib/format2/format.cc

fuchsia_audio::wire::Format ToWireFidl (fidl::AnyArena & arena)

Defined at line 374 of file ../../src/media/audio/lib/format2/format.cc

fuchsia_audio::Format ToNaturalFidl ()

Defined at line 382 of file ../../src/media/audio/lib/format2/format.cc

fuchsia_hardware_audio::wire::Format ToHardwareWireFidl (fidl::AnyArena & arena)

Defined at line 390 of file ../../src/media/audio/lib/format2/format.cc

fuchsia_hardware_audio::Format ToHardwareNaturalFidl ()

Defined at line 402 of file ../../src/media/audio/lib/format2/format.cc

fuchsia_media::wire::AudioStreamType ToLegacyMediaWireFidl ()

TODO(https://fxbug.dev/42066782): Remove when audio_core/v2 is deleted.

Defined at line 414 of file ../../src/media/audio/lib/format2/format.cc

fuchsia_mediastreams::wire::AudioFormat ToLegacyMediastreamsWireFidl ()

TODO(https://fxbug.dev/42066204): Remove when fuchsia.audio.effects has migrated to the new

types.

Defined at line 440 of file ../../src/media/audio/lib/format2/format.cc

int64_t integer_frames_per (zx::duration duration, media::TimelineRate::RoundingMode rounding_mode)

Computes the number of integral frames for the given duration.

Rounds up by default.

Defined at line 467 of file ../../src/media/audio/lib/format2/format.cc

Fixed frac_frames_per (zx::duration duration, media::TimelineRate::RoundingMode rounding_mode)

Computes the number of fractional frames for the given duration.

Rounds up by default.

Defined at line 471 of file ../../src/media/audio/lib/format2/format.cc

int64_t bytes_per (zx::duration duration, media::TimelineRate::RoundingMode rounding_mode)

Computes the number of bytes for the given duration.

Rounds up by default.

Defined at line 475 of file ../../src/media/audio/lib/format2/format.cc

zx::duration duration_per (Fixed frames, media::TimelineRate::RoundingMode rounding_mode)

Computes the duration that covers the given number of fractional frames.

Rounds up by default.

Defined at line 479 of file ../../src/media/audio/lib/format2/format.cc

Records