Zao SDK for Jetson / libzao-endpoint API リファレンス 1.1.0.0 (2023-08-17)
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 "../SourceStreamInterface.hpp"
9#include "../StreamInterface.hpp"
10#include "../TimestampInterface.hpp"
11#include "NvBufferInterface.hpp"
12#include "VideoFormat.hpp"
13
14// 前方宣言
15struct v4l2_buffer;
16class NvBuffer;
17namespace v4l2 {
18struct VideoFormat;
19}
20
21namespace zao {
22namespace endpoint {
23namespace video {
24
25class NvSourceCallbackInterface;
26
31 public:
38 const std::vector<VideoFormat>& formats) = 0;
39
47 virtual bool GetDecidedFormat(VideoFormat& format) const noexcept = 0;
48
57 virtual std::shared_future<VideoFormat> GetFormatDecisionStatus()
58 const noexcept = 0;
59
60 virtual std::unique_ptr<NvBufferInterface> DequeueBuffer() = 0;
61 virtual bool QueueBuffer(std::unique_ptr<NvBufferInterface> buffer) = 0;
62
67 virtual void SendStatistics(/*TODO*/) = 0;
68
78 virtual void RegisterCallback(
79 const std::shared_ptr<NvSourceCallbackInterface>& listener,
80 bool use_weak_ptr = false) = 0;
81
90 virtual void RegisterCallback(
91 std::unique_ptr<NvSourceCallbackInterface>&& listener) = 0;
92
93 virtual ~NvSourceInterface() noexcept = default;
94};
95
102 public:
106 enum class EventType {
108 kUnknown = 0,
109
111 kDisconnected,
112
114 kUnlinked,
115
117 kFailedFormatNegotiation,
118 };
119
129 virtual bool OnRequestSourceFormat(const VideoFormat& format) = 0;
130
137 virtual void OnNotifySourceEvent(EventType type, const std::string& message) {
138 }
139
140 virtual ~NvSourceCallbackInterface() noexcept = default;
141};
142
143} // namespace video
144} // namespace endpoint
145} // namespace zao
146
147#endif // ZAO_ENDPOINT_VIDEO_NV_SOURCE_INTERFACE_HPP_
ソース側ストリーム機能の共通コールバックインターフェース
Definition SourceStreamInterface.hpp:26
ソース側ストリーム機能インターフェース
Definition SourceStreamInterface.hpp:10
ストリーム機能の共通コールバックインターフェース
Definition StreamInterface.hpp:30
エンドポイント側のストリーム機能インターフェース
Definition StreamInterface.hpp:14
Definition NvBufferInterface.hpp:17
NVIDIA Multimedia APIを利用した映像ソース機能の コールバックインターフェース
Definition NvSourceInterface.hpp:101
EventType
イベントの種類
Definition NvSourceInterface.hpp:106
virtual bool OnRequestSourceFormat(const VideoFormat &format)=0
フォーマット決定要求時に呼び出されるコールバック。
virtual void OnNotifySourceEvent(EventType type, const std::string &message)
エラーなどのイベントが発生した時に呼び出されるコールバック。
Definition NvSourceInterface.hpp:137
NVIDIA Multimedia APIを利用した映像ソース機能インターフェース
Definition NvSourceInterface.hpp:30
virtual void SendStatistics()=0
統計情報の送信
virtual std::shared_future< VideoFormat > GetFormatDecisionStatus() const noexcept=0
フォーマット決定状態を取得するshared_futureを取得する。
virtual void RegisterCallback(const std::shared_ptr< NvSourceCallbackInterface > &listener, bool use_weak_ptr=false)=0
コールバックの送信先をshared_ptrまたはweak_ptrで登録する
virtual void SetAcceptableFormats(const std::vector< VideoFormat > &formats)=0
送信可能なフォーマット一覧を提示する。
virtual bool GetDecidedFormat(VideoFormat &format) const noexcept=0
決定したフォーマットを取得する。
映像のフォーマット情報
Definition VideoFormat.hpp:16
Zao製品共通の名前空間
Definition FactoryInterface.hpp:11