Zao SDK for Jetson / libzao-endpoint API リファレンス 1.2.0.0 (2023-10-30)
Loading...
Searching...
No Matches
PcmSourceInterface.hpp
1#ifndef ZAO_ENDPOINT_AUDIO_PCM_SOURCE_INTERFACE_HPP_
2#define ZAO_ENDPOINT_AUDIO_PCM_SOURCE_INTERFACE_HPP_
3
4#include <future>
5#include <memory>
6#include <string>
7#include <vector>
8
9#include "../SourceStreamInterface.hpp"
10#include "../StreamInterface.hpp"
11#include "PcmBufferWriter.hpp"
12#include "PcmFormat.hpp"
13
14namespace zao {
15namespace endpoint {
16
17class TimestampInterface;
18
19namespace audio {
20
21class PcmSourceCallbackInterface;
22
28 public:
37 virtual void SetAcceptableFormats(const std::vector<PcmFormat>& formats) = 0;
38
46 virtual bool GetDecidedFormat(PcmFormat& format) const noexcept = 0;
47
56 virtual std::shared_future<PcmFormat> GetFormatDecisionStatus()
57 const noexcept = 0;
58
64 virtual std::weak_ptr<PcmBufferPoolWriterInterface> GetPcmBufferPool() = 0;
65
70 virtual void SendStatistics(/*TODO*/) = 0;
71
82 virtual void RegisterCallback(
83 const std::shared_ptr<PcmSourceCallbackInterface>& listener,
84 bool use_weak_ptr = false) = 0;
85
95 virtual void RegisterCallback(
96 std::unique_ptr<PcmSourceCallbackInterface>&& listener) = 0;
97
98 virtual ~PcmSourceInterface() noexcept = default;
99};
100
106 public:
110 enum class EventType {
112 kUnknown = 0,
113
115 kDisconnected,
116
118 kUnlinked,
119
121 kEncodeError,
122
124 kFailedFormatNegotiation,
125 };
126
136 virtual bool OnRequestSourceFormat(const PcmFormat& format) = 0;
137
149 virtual void OnDecideSourceFormat(const PcmFormat* format) = 0;
150
157 virtual void OnNotifySourceEvent(EventType type, const std::string& message) {
158 }
159
160 virtual ~PcmSourceCallbackInterface() noexcept = default;
161};
162
163} // namespace audio
164} // namespace endpoint
165} // namespace zao
166
167#endif // ZAO_ENDPOINT_AUDIO_PCM_SOURCE_INTERFACE_HPP_
ソース側ストリーム機能の共通コールバックインターフェース
Definition SourceStreamInterface.hpp:26
ソース側ストリーム機能インターフェース
Definition SourceStreamInterface.hpp:10
ストリーム機能の共通コールバックインターフェース
Definition StreamInterface.hpp:30
エンドポイント側のストリーム機能インターフェース
Definition StreamInterface.hpp:14
PCMバッファプールの書き込み側インターフェース
Definition PcmBufferPoolWriterInterface.hpp:13
PCM音声のフォーマット
Definition PcmFormat.hpp:14
PCMによる音声ソース機能のコールバックインターフェース
Definition PcmSourceInterface.hpp:105
virtual bool OnRequestSourceFormat(const PcmFormat &format)=0
フォーマット決定要求時に呼び出されるコールバック。
virtual void OnNotifySourceEvent(EventType type, const std::string &message)
エラーなどのイベントが発生した時に呼び出されるコールバック。
Definition PcmSourceInterface.hpp:157
EventType
イベントの種類
Definition PcmSourceInterface.hpp:110
virtual void OnDecideSourceFormat(const PcmFormat *format)=0
フォーマットが決定された時に呼び出されるコールバック。
PCMによる音声ソース機能インターフェース
Definition PcmSourceInterface.hpp:27
virtual std::weak_ptr< PcmBufferPoolWriterInterface > GetPcmBufferPool()=0
PCMバッファプールの書き込み側インターフェースを取得する。
virtual bool GetDecidedFormat(PcmFormat &format) const noexcept=0
決定したフォーマットを取得する。
virtual void RegisterCallback(const std::shared_ptr< PcmSourceCallbackInterface > &listener, bool use_weak_ptr=false)=0
コールバックの送信先をshared_ptrまたはweak_ptrで登録する
virtual void SetAcceptableFormats(const std::vector< PcmFormat > &formats)=0
送信可能なフォーマット一覧を提示する。
virtual std::shared_future< PcmFormat > GetFormatDecisionStatus() const noexcept=0
フォーマット決定状態を取得するshared_futureを取得する。
virtual void SendStatistics()=0
統計情報の送信
Zao製品共通の名前空間
Definition FactoryInterface.hpp:11