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>
16#include <vector>
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
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
95 public:
99 enum class EventType {
101 kUnknown = 0,
102
104 kDisconnected,
105
107 kUnlinked,
108
110 kDecodeError,
111
113 kFailedFormatNegotiation,
114 };
115
125 virtual bool OnRequestSinkFormat(const PcmFormat& format) = 0;
126
133 virtual void OnNotifySinkEvent(EventType type, const std::string& message) {}
134
139 virtual std::weak_ptr<PcmBufferPoolWriterInterface>
141
142 virtual ~PcmSinkCallbackInterface() noexcept = default;
143};
144
145} // namespace audio
146} // namespace zep
147
148#endif // ZEP_AUDIO_PCM_SINK_INTERFACE_HPP_
Common callback interface for sink-side stream functions.
Definition SinkStreamInterface.hpp:26
Sink-side stream function interface.
Definition SinkStreamInterface.hpp:18
Common callback interface for stream functions.
Definition StreamInterface.hpp:38
Stream function interface on the endpoint side.
Definition StreamInterface.hpp:22
PCM audio format.
Definition PcmFormat.hpp:22
PCMによる音声シンク機能のコールバックインターフェース
Definition PcmSinkInterface.hpp:94
virtual void OnNotifySinkEvent(EventType type, const std::string &message)
エラーなどのイベントが発生した時に呼び出されるコールバック。
Definition PcmSinkInterface.hpp:133
EventType
イベントの種類
Definition PcmSinkInterface.hpp:99
virtual std::weak_ptr< PcmBufferPoolWriterInterface > OnRequestPcmBufferPool()=0
PCMバッファプールの書き込み側を要求するコールバック。
virtual bool OnRequestSinkFormat(const PcmFormat &format)=0
フォーマット決定要求時に呼び出されるコールバック。
PCMによる音声シンク機能インターフェース
Definition PcmSinkInterface.hpp:31
virtual void SetAcceptableFormats(const std::vector< PcmFormat > &formats)=0
受信可能なフォーマット一覧を提示する。
virtual bool GetDecidedFormat(PcmFormat &format) const noexcept=0
決定したフォーマットを取得する。
virtual std::shared_future< PcmFormat > GetFormatDecisionStatus() const noexcept=0
フォーマット決定状態を取得するshared_futureを取得する。
Namespace for ZEP SDK.
Definition FactoryInterface.hpp:19