Zao SDK for Jetson / libzao-endpoint API リファレンス 1.1.0.0 (2023-08-17)
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
81 virtual void RegisterCallback(
82 const std::shared_ptr<PcmSourceCallbackInterface>& listener,
83 bool use_weak_ptr = false) = 0;
84
93 virtual void RegisterCallback(
94 std::unique_ptr<PcmSourceCallbackInterface>&& listener) = 0;
95
96 virtual ~PcmSourceInterface() noexcept = default;
97};
98
104 public:
108 enum class EventType {
110 kUnknown = 0,
111
113 kDisconnected,
114
116 kUnlinked,
117
119 kEncodeError,
120
122 kFailedFormatNegotiation,
123 };
124
134 virtual bool OnRequestSourceFormat(const PcmFormat& format) = 0;
135
147 virtual void OnDecideSourceFormat(const PcmFormat* format) = 0;
148
155 virtual void OnNotifySourceEvent(EventType type, const std::string& message) {
156 }
157
158 virtual ~PcmSourceCallbackInterface() noexcept = default;
159};
160
161} // namespace audio
162} // namespace endpoint
163} // namespace zao
164
165#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:103
virtual bool OnRequestSourceFormat(const PcmFormat &format)=0
フォーマット決定要求時に呼び出されるコールバック。
virtual void OnNotifySourceEvent(EventType type, const std::string &message)
エラーなどのイベントが発生した時に呼び出されるコールバック。
Definition PcmSourceInterface.hpp:155
EventType
イベントの種類
Definition PcmSourceInterface.hpp:108
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