Zao SDK for Jetson / libzao-endpoint API リファレンス 1.6.0.0 (2024-12-24)
Loading...
Searching...
No Matches
NvSourceInterface.hpp
1#ifndef ZAO_ENDPOINT_VIDEO_NV_SOURCE_INTERFACE_HPP_
2#define ZAO_ENDPOINT_VIDEO_NV_SOURCE_INTERFACE_HPP_
3
4#include <future>
5#include <memory>
6#include <vector>
7
8#include "../EventSourceInterface.hpp"
9#include "../SourceStreamInterface.hpp"
10#include "../StreamInterface.hpp"
11#include "../TimestampInterface.hpp"
12#include "NvBufferInterface.hpp"
13#include "NvSourceBufferDequeueResult.hpp"
14#include "NvSourceBufferEnqueueResult.hpp"
15#include "VideoFormat.hpp"
16
17// 前方宣言
18struct v4l2_buffer;
19class NvBuffer;
20namespace v4l2 {
21struct VideoFormat;
22}
23
24namespace zao {
25namespace endpoint {
26namespace video {
27
28class NvSourceCallbackInterface;
29
35 : public StreamInterface,
37 public EventSourceInterface<NvSourceCallbackInterface> {
38 public:
45 [[deprecated("Please use SetSourceFormats function")]]
46 void SetAcceptableFormats(const std::vector<VideoFormat>& formats) {
47 return SetSourceFormats(formats);
48 }
56 virtual void SetSourceFormats(const std::vector<VideoFormat>& formats) = 0;
57
64 [[deprecated("Please use GetDeterminedFormat function")]]
65 bool GetDecidedFormat(VideoFormat& format) const {
66 return GetDeterminedFormat(format);
67 }
68
80 virtual bool GetDeterminedFormat(VideoFormat& format) const = 0;
81
88 [[deprecated("Please use GetDeterminedFormatAsync function")]]
89 std::shared_future<VideoFormat> GetFormatDecisionStatus() const {
91 }
92
106 virtual std::shared_future<VideoFormat> GetDeterminedFormatAsync() const = 0;
107
114
121 [[deprecated("Please use DequeueSourceBuffer.")]]
122 std::unique_ptr<NvBufferInterface> DequeueBuffer() {
124 }
125
136 std::unique_ptr<NvBufferInterface> buffer) = 0;
137
148 [[deprecated("Please use EnqueueSourceBuffer.")]]
149 bool QueueBuffer(std::unique_ptr<NvBufferInterface> buffer) {
150 return !EnqueueSourceBuffer(std::move(buffer)).HasError();
151 }
152
157 virtual ~NvSourceInterface() noexcept = default;
158};
159
168 public:
173 enum class EventType {
178 kUnknown = 0,
179
184 kDisconnected,
185
190 kUnlinked,
191
196 kFailedFormatNegotiation,
197 };
198
214 virtual bool OnRequestSourceFormat(const VideoFormat& format) = 0;
215
225 virtual void OnNotifySourceEvent(EventType type, const std::string& message) {
226 }
227
232 virtual ~NvSourceCallbackInterface() noexcept = default;
233};
234
235} // namespace video
236} // namespace endpoint
237} // namespace zao
238
239#endif // ZAO_ENDPOINT_VIDEO_NV_SOURCE_INTERFACE_HPP_
イベントを生成するクラスの共通インターフェース
Definition EventSourceInterface.hpp:31
ソース側ストリーム機能の共通コールバックインターフェース
Definition SourceStreamInterface.hpp:35
ソース側ストリーム機能インターフェース
Definition SourceStreamInterface.hpp:11
ストリーム機能の共通コールバックインターフェース
Definition StreamInterface.hpp:37
エンドポイント側のストリーム機能インターフェース
Definition StreamInterface.hpp:15
NvBuffer送信用バッファの取り出し結果を示す型。
Definition NvSourceBufferDequeueResult.hpp:17
std::unique_ptr< NvBufferInterface > TakeBuffer() noexcept
所有権付きでバッファを得る。
Definition NvSourceBufferDequeueResult.hpp:122
NvBuffer送信用バッファの格納結果を示す型。
Definition NvSourceBufferEnqueueResult.hpp:13
bool HasError() const noexcept
エラーが発生したか否か。
Definition NvSourceBufferEnqueueResult.hpp:100
NVIDIA Multimedia APIを利用した 映像ソース機能のコールバックインターフェース
Definition NvSourceInterface.hpp:167
EventType
イベントの種類
Definition NvSourceInterface.hpp:173
virtual bool OnRequestSourceFormat(const VideoFormat &format)=0
フォーマット決定要求時に呼び出されるコールバック
virtual ~NvSourceCallbackInterface() noexcept=default
NvSourceCallbackInterface オブジェクトを破棄する。
virtual void OnNotifySourceEvent(EventType type, const std::string &message)
エラーなどのイベントが発生した時に呼び出されるコールバック。
Definition NvSourceInterface.hpp:225
NVIDIA Multimedia APIを利用した映像ソース機能インターフェース
Definition NvSourceInterface.hpp:37
virtual std::shared_future< VideoFormat > GetDeterminedFormatAsync() const =0
フォーマット決定状態を取得するshared_futureを取得する。
virtual ~NvSourceInterface() noexcept=default
NvSourceInterface オブジェクトを破棄する。
void SetAcceptableFormats(const std::vector< VideoFormat > &formats)
映像ソースとして送信可能なフォーマット一覧を提示する。
Definition NvSourceInterface.hpp:46
std::shared_future< VideoFormat > GetFormatDecisionStatus() const
フォーマット決定状態を取得するshared_futureを取得する。
Definition NvSourceInterface.hpp:89
virtual bool GetDeterminedFormat(VideoFormat &format) const =0
決定したフォーマットを取得する。
bool GetDecidedFormat(VideoFormat &format) const
決定したフォーマットを取得する。
Definition NvSourceInterface.hpp:65
virtual void SetSourceFormats(const std::vector< VideoFormat > &formats)=0
映像ソースとして送信可能なフォーマット一覧を提示する。
virtual NvSourceBufferDequeueResult DequeueSourceBuffer()=0
画像を供給するためのバッファを取り出す。
bool QueueBuffer(std::unique_ptr< NvBufferInterface > buffer)
送信する画像を格納したバッファをキューに入れる。
Definition NvSourceInterface.hpp:149
virtual NvSourceBufferEnqueueResult EnqueueSourceBuffer(std::unique_ptr< NvBufferInterface > buffer)=0
送信する画像を格納したバッファをキューに入れる。
std::unique_ptr< NvBufferInterface > DequeueBuffer()
画像を供給するためのバッファを取得する
Definition NvSourceInterface.hpp:122
映像のフォーマット情報
Definition VideoFormat.hpp:17
Zao製品共通の名前空間
Definition FactoryInterface.hpp:11