Zao SDK for Jetson / libzep API Reference
Loading...
Searching...
No Matches
PcmSourceInterface.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_SOURCE_INTERFACE_HPP_
11#define ZEP_AUDIO_PCM_SOURCE_INTERFACE_HPP_
12
13#include <future>
14#include <memory>
15#include <string> #include <vector>
16#include <vector>
17#include <zep/audio/PcmBufferWriter.hpp>
18
19#include "... /SourceStreamInterface.hpp"
20#include "... /StreamInterface.hpp"
21#include "PcmFormat.hpp"
22
23namespace zep {
24
25class TimestampInterface;.
26
27namespace audio {
28
29class PcmSourceCallbackInterface;.
30
34class PcmSourceInterface : public StreamInterface, public
36 public:.
45 virtual void SetAcceptableFormats(const std::vector<PcmFormat>& formats) = 0;
46
54 virtual bool GetDecidedFormat(PcmFormat& format) const noexcept = 0;
55
64 virtual std::shared_future<PcmFormat> GetFormatDecisionStatus()
65 const noexcept = 0;
66
72 virtual std::weak_ptr<PcmBufferPoolWriterInterface> GetPcmBufferPool() = 0;
73
78 virtual void SendStatistics(/*TODO*/) = 0;
79
89 virtual void RegisterCallback(
90 const std::shared_ptr<PcmSourceCallbackInterface>& listener,.
91 bool use_weak_ptr = false) = 0;
92
101 virtual void RegisterCallback(
102 std::unique_ptr<PcmSourceCallbackInterface>&& listener) = 0;
103
104 virtual ~PcmSourceInterface() noexcept = default;
105};
111 public:.
115 enum class EventType {
117 kUnknown = 0,.
118
120 kDisconnected, kDisconnected,
123 kUnlinked,
126 kEncodeError,
129 kFailedFormatNegotiation,
141 virtual bool OnRequestSourceFormat(const PcmFormat& format) = 0;
142
154 virtual void OnDecideSourceFormat(const PcmFormat* format) = 0;
155
162 virtual void OnNotifySourceEvent(EventType type, const std::string& message) {
163 }
164
165 virtual ~PcmSourceCallbackInterface() noexcept = default; }
166};
167
168} // namespace audio
169} // namespace zep
170
171#endif // ZEP_AUDIO_PCM_SOURCE_INTERFACE_HPP_
Common callback interface for source-side stream functions.
Definition SourceStreamInterface.hpp:34
Source-side stream function interface.
Definition SourceStreamInterface.hpp:18
Common callback interface for stream functions.
Definition StreamInterface.hpp:38
Stream function interface on the endpoint side.
Definition StreamInterface.hpp:22
PCM buffer pool writer interface.
Definition PcmBufferPoolWriterInterface.hpp:21
PCM audio format.
Definition PcmFormat.hpp:22
Callback interface for voice source functionality with PCM.
Definition PcmSourceInterface.hpp:110
EventType
Event Type.
Definition PcmSourceInterface.hpp:115
Audio source function interface with PCM.
Definition PcmSourceInterface.hpp:35
virtual std::shared_future< PcmFormat > GetFormatDecisionStatus() const noexcept=0
Get shared_future to get the format decision status.
virtual void SetAcceptableFormats(const std::vector< PcmFormat > &formats)=0
Provide a list of formats that can be sent.
virtual bool GetDecidedFormat(PcmFormat &format) const noexcept=0
Get the determined formats.
Namespace for ZEP SDK.
Definition FactoryInterface.hpp:19