blob: b3aeb568ef1c20da6c1dd924cddba4b7d6cb52be [file] [log] [blame]
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SRC_MEDIA_AUDIO_SERVICES_DEVICE_REGISTRY_BASIC_TYPES_H_
#define SRC_MEDIA_AUDIO_SERVICES_DEVICE_REGISTRY_BASIC_TYPES_H_
#include <fidl/fuchsia.audio.device/cpp/natural_types.h>
#include <fidl/fuchsia.hardware.audio.signalprocessing/cpp/markers.h>
#include <fidl/fuchsia.hardware.audio.signalprocessing/cpp/natural_messaging.h>
#include <lib/fidl/cpp/unified_messaging.h>
#include <array>
namespace media_audio {
// FIDL IDs.
using TokenId = fuchsia_audio_device::TokenId;
using ElementId = fuchsia_audio_device::ElementId;
using TopologyId = fuchsia_audio_device::TopologyId;
using ClockDomain = fuchsia_audio_device::ClockDomain;
using UniqueId = std::array<uint8_t, fuchsia_audio_device::kUniqueInstanceIdSize>;
// In addition to just mapping the ElementId to its unique Element, we also store the ElementState,
// as well as conveniently store what is needed to manage the hanging-gets to the driver. This
// enables us to interact properly with ObserverNotify instances.
struct ElementRecord {
fuchsia_hardware_audio_signalprocessing::Element element;
std::optional<fuchsia_hardware_audio_signalprocessing::ElementState> state;
};
} // namespace media_audio
#endif // SRC_MEDIA_AUDIO_SERVICES_DEVICE_REGISTRY_BASIC_TYPES_H_