Zao SDK for Jetson / libzao-endpoint API リファレンス 1.5.0.0 (2024-09-25)
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 "VideoFormat.hpp"
14
15// 前方宣言
16struct v4l2_buffer;
17class NvBuffer;
18namespace v4l2 {
19struct VideoFormat;
20}
21
22namespace zao {
23namespace endpoint {
24namespace video {
25
26class NvSourceCallbackInterface;
27
33 : public StreamInterface,
35 public EventSourceInterface<NvSourceCallbackInterface> {
36 public:
43 [[deprecated("Please use SetSourceFormats function")]] //
44 void
45 SetAcceptableFormats(const std::vector<VideoFormat>& formats) {
46 return SetSourceFormats(formats);
47 }
55 virtual void SetSourceFormats(const std::vector<VideoFormat>& formats) = 0;
56
63 [[deprecated("Please use GetDeterminedFormat function")]] //
64 bool
65 GetDecidedFormat(VideoFormat& format) const noexcept {
66 return GetDeterminedFormat(format);
67 }
68
80 virtual bool GetDeterminedFormat(VideoFormat& format) const noexcept = 0;
81
88 [[deprecated("Please use GetDeterminedFormatAsync function")]] //
89 std::shared_future<VideoFormat>
90 GetFormatDecisionStatus() const noexcept {
92 }
93
107 virtual std::shared_future<VideoFormat> GetDeterminedFormatAsync()
108 const noexcept = 0;
109
114 virtual std::unique_ptr<NvBufferInterface> DequeueBuffer() = 0;
122 virtual bool QueueBuffer(std::unique_ptr<NvBufferInterface> buffer) = 0;
123
131 virtual void SendStatistics(/*TODO*/) = 0;
132
133 virtual ~NvSourceInterface() noexcept = default;
134};
135
144 public:
149 enum class EventType {
154 kUnknown = 0,
155
160 kDisconnected,
161
166 kUnlinked,
167
172 kFailedFormatNegotiation,
173 };
174
190 virtual bool OnRequestSourceFormat(const VideoFormat& format) = 0;
191
201 virtual void OnNotifySourceEvent(EventType type, const std::string& message) {
202 }
203
204 virtual ~NvSourceCallbackInterface() noexcept = default;
205};
206
207} // namespace video
208} // namespace endpoint
209} // namespace zao
210
211#endif // ZAO_ENDPOINT_VIDEO_NV_SOURCE_INTERFACE_HPP_
イベントを生成するクラスの共通インターフェース
Definition EventSourceInterface.hpp:27
ソース側ストリーム機能の共通コールバックインターフェース
Definition SourceStreamInterface.hpp:31
ソース側ストリーム機能インターフェース
Definition SourceStreamInterface.hpp:11
ストリーム機能の共通コールバックインターフェース
Definition StreamInterface.hpp:34
エンドポイント側のストリーム機能インターフェース
Definition StreamInterface.hpp:15
NvBufferを管理するクラスのインターフェース
Definition NvBufferInterface.hpp:24
NVIDIA Multimedia APIを利用した 映像ソース機能のコールバックインターフェース
Definition NvSourceInterface.hpp:143
EventType
イベントの種類
Definition NvSourceInterface.hpp:149
virtual bool OnRequestSourceFormat(const VideoFormat &format)=0
フォーマット決定要求時に呼び出されるコールバック
virtual void OnNotifySourceEvent(EventType type, const std::string &message)
エラーなどのイベントが発生した時に呼び出されるコールバック。
Definition NvSourceInterface.hpp:201
NVIDIA Multimedia APIを利用した映像ソース機能インターフェース
Definition NvSourceInterface.hpp:35
bool GetDecidedFormat(VideoFormat &format) const noexcept
決定したフォーマットを取得する。
Definition NvSourceInterface.hpp:65
virtual std::shared_future< VideoFormat > GetDeterminedFormatAsync() const noexcept=0
フォーマット決定状態を取得するshared_futureを取得する。
virtual void SendStatistics()=0
統計情報の送信
void SetAcceptableFormats(const std::vector< VideoFormat > &formats)
映像ソースとして送信可能なフォーマット一覧を提示する。
Definition NvSourceInterface.hpp:45
virtual std::unique_ptr< NvBufferInterface > DequeueBuffer()=0
画像を供給するためのバッファを取得する
virtual bool QueueBuffer(std::unique_ptr< NvBufferInterface > buffer)=0
送信する画像を供給する
virtual void SetSourceFormats(const std::vector< VideoFormat > &formats)=0
映像ソースとして送信可能なフォーマット一覧を提示する。
virtual bool GetDeterminedFormat(VideoFormat &format) const noexcept=0
決定したフォーマットを取得する。
std::shared_future< VideoFormat > GetFormatDecisionStatus() const noexcept
フォーマット決定状態を取得するshared_futureを取得する。
Definition NvSourceInterface.hpp:90
映像のフォーマット情報
Definition VideoFormat.hpp:17
Zao製品共通の名前空間
Definition FactoryInterface.hpp:11