Zao SDK for Jetson / libzao-endpoint API リファレンス 1.2.0.0 (2023-10-30)
Loading...
Searching...
No Matches
PcmSinkInterface.hpp
1#ifndef ZAO_ENDPOINT_AUDIO_PCM_SINK_INTERFACE_HPP_
2#define ZAO_ENDPOINT_AUDIO_PCM_SINK_INTERFACE_HPP_
3
4#include <future>
5#include <memory>
6#include <string>
7#include <vector>
8
9#include "../SinkStreamInterface.hpp"
10#include "../StreamInterface.hpp"
11#include "PcmBufferWriter.hpp"
12#include "PcmFormat.hpp"
13
14namespace zao {
15namespace endpoint {
16namespace audio {
17
18class PcmSinkCallbackInterface;
19
24 public:
33 virtual void SetAcceptableFormats(const std::vector<PcmFormat>& formats) = 0;
34
42 virtual bool GetDecidedFormat(PcmFormat& format) const noexcept = 0;
43
52 virtual std::shared_future<PcmFormat> GetFormatDecisionStatus()
53 const noexcept = 0;
54
65 virtual void RegisterCallback(
66 const std::shared_ptr<PcmSinkCallbackInterface>& listener,
67 bool use_weak_ptr = false) = 0;
68
78 virtual void RegisterCallback(
79 std::unique_ptr<PcmSinkCallbackInterface>&& listener) = 0;
80
81 virtual ~PcmSinkInterface() noexcept = default;
82};
83
89 public:
93 enum class EventType {
95 kUnknown = 0,
96
98 kDisconnected,
99
101 kUnlinked,
102
104 kDecodeError,
105
107 kFailedFormatNegotiation,
108 };
109
119 virtual bool OnRequestSinkFormat(const PcmFormat& format) = 0;
120
127 virtual void OnNotifySinkEvent(EventType type, const std::string& message) {}
128
133 virtual std::weak_ptr<PcmBufferPoolWriterInterface>
135
136 virtual ~PcmSinkCallbackInterface() noexcept = default;
137};
138
139} // namespace audio
140} // namespace endpoint
141} // namespace zao
142
143#endif // ZAO_ENDPOINT_AUDIO_PCM_SINK_INTERFACE_HPP_
シンク側ストリーム機能の共通コールバックインターフェース
Definition SinkStreamInterface.hpp:18
シンク側ストリーム機能インターフェース
Definition SinkStreamInterface.hpp:10
ストリーム機能の共通コールバックインターフェース
Definition StreamInterface.hpp:30
エンドポイント側のストリーム機能インターフェース
Definition StreamInterface.hpp:14
PCM音声のフォーマット
Definition PcmFormat.hpp:14
PCMによる音声シンク機能のコールバックインターフェース
Definition PcmSinkInterface.hpp:88
virtual std::weak_ptr< PcmBufferPoolWriterInterface > OnRequestPcmBufferPool()=0
PCMバッファプールの書き込み側を要求するコールバック。
EventType
イベントの種類
Definition PcmSinkInterface.hpp:93
virtual void OnNotifySinkEvent(EventType type, const std::string &message)
エラーなどのイベントが発生した時に呼び出されるコールバック。
Definition PcmSinkInterface.hpp:127
virtual bool OnRequestSinkFormat(const PcmFormat &format)=0
フォーマット決定要求時に呼び出されるコールバック。
PCMによる音声シンク機能インターフェース
Definition PcmSinkInterface.hpp:23
virtual std::shared_future< PcmFormat > GetFormatDecisionStatus() const noexcept=0
フォーマット決定状態を取得するshared_futureを取得する。
virtual bool GetDecidedFormat(PcmFormat &format) const noexcept=0
決定したフォーマットを取得する。
virtual void SetAcceptableFormats(const std::vector< PcmFormat > &formats)=0
受信可能なフォーマット一覧を提示する。
virtual void RegisterCallback(const std::shared_ptr< PcmSinkCallbackInterface > &listener, bool use_weak_ptr=false)=0
コールバックの送信先をshared_ptrまたはweak_ptrで登録する
Zao製品共通の名前空間
Definition FactoryInterface.hpp:11