Zao SDK for Jetson / libzao-endpoint API リファレンス 1.1.0.0 (2023-08-17)
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
64 virtual void RegisterCallback(
65 const std::shared_ptr<PcmSinkCallbackInterface>& listener,
66 bool use_weak_ptr = false) = 0;
67
76 virtual void RegisterCallback(
77 std::unique_ptr<PcmSinkCallbackInterface>&& listener) = 0;
78
79 virtual ~PcmSinkInterface() noexcept = default;
80};
81
87 public:
91 enum class EventType {
93 kUnknown = 0,
94
96 kDisconnected,
97
99 kUnlinked,
100
102 kDecodeError,
103
105 kFailedFormatNegotiation,
106 };
107
117 virtual bool OnRequestSinkFormat(const PcmFormat& format) = 0;
118
125 virtual void OnNotifySinkEvent(EventType type, const std::string& message) {}
126
131 virtual std::weak_ptr<PcmBufferPoolWriterInterface>
133
134 virtual ~PcmSinkCallbackInterface() noexcept = default;
135};
136
137} // namespace audio
138} // namespace endpoint
139} // namespace zao
140
141#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:86
virtual std::weak_ptr< PcmBufferPoolWriterInterface > OnRequestPcmBufferPool()=0
PCMバッファプールの書き込み側を要求するコールバック。
EventType
イベントの種類
Definition PcmSinkInterface.hpp:91
virtual void OnNotifySinkEvent(EventType type, const std::string &message)
エラーなどのイベントが発生した時に呼び出されるコールバック。
Definition PcmSinkInterface.hpp:125
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