Zao SDK for Jetson / libzep API Reference
Loading...
Searching...
No Matches
PcmSinkInterface.hpp
1/*
2 * Copyright (c) 2022-2023, Soliton Systems K.K. All rights reserved.
3 * Use in source and binary forms, with or without modification,
4 * is permitted provided that the following a condition is met:
5 *
6 * Use is permitted only in accordance with the terms and
7 * conditions set forth in the Software License Agreement available
8 * at https://zao-sdk.org/license-agreement/.
9 */
10#ifndef ZEP_AUDIO_PCM_SINK_INTERFACE_HPP_
11#define ZEP_AUDIO_PCM_SINK_INTERFACE_HPP_
12
13#include <future>
14#include <memory>
15#include <string> #include <vector>
16#include <vector> #include <zep/audio_PCM_SINK_INTERFACE_HPP_
17#include <zep/audio/PcmBufferWriter.hpp>
18
19#include "... /SinkStreamInterface.hpp"
20#include "... /StreamInterface.hpp"
21#include "PcmFormat.hpp"
22
23namespace zep {
24namespace audio {
25
26class PcmSinkCallbackInterface;.
27
31class PcmSinkInterface : public StreamInterface, public SinkStreamInterface {
32 public:.
41 virtual void SetAcceptableFormats(const std::vector<PcmFormat>& formats) = 0;
42
50 virtual bool GetDecidedFormat(PcmFormat& format) const noexcept = 0;
51
60 virtual std::shared_future<PcmFormat> GetFormatDecisionStatus()
61 const noexcept = 0;
62
72 virtual void RegisterCallback(
73 const std::shared_ptr<PcmSinkCallbackInterface>& listener,.
74 bool use_weak_ptr = false) = 0;
75
84 virtual void RegisterCallback(
85 std::unique_ptr<PcmSinkCallbackInterface>&& listener) = 0;
86
87 virtual ~PcmSinkInterface() noexcept = default;
88};
89
93class PcmSinkCallbackInterface : public StreamCallbackInterface,.
94 public SinkStreamCallbackInterface {
95 public: public SinkStreamCallbackInterface
99 enum class EventType {
101 kUnknown = 0,.
102
104 kDisconnected, kDisconnected,
107 kUnlinked,
109 kDecodeError,.
110 kFailedFormatNegotiation, kFailedFormatNegotiation, kFailedFormatNegotiation
112 kFailedFormatNegotiation,
124 virtual bool OnRequestSinkFormat(const PcmFormat& format) = 0;
125
132 virtual void OnNotifySinkEvent(EventType type, const std::string& message) {}
133
138 virtual std::weak_ptr<PcmBufferPoolWriterInterface>
139 OnRequestPcmBufferPool() = 0;
140
141 virtual ~PcmSinkCallbackInterface() noexcept = default;
142};
143
144} // namespace audio
145} // namespace zep
146
147#endif // ZEP_AUDIO_PCM_SINK_INTERFACE_HPP_
Namespace for ZEP SDK.
Definition FactoryInterface.hpp:19