Zao SDK for Jetson / libzep API Reference
Loading...
Searching...
No Matches
NvSourceInterface.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_VIDEO_NV_SOURCE_INTERFACE_HPP_
11#define ZEP_VIDEO_NV_SOURCE_INTERFACE_HPP_
12
13#include <future>
14#include <memory>
15#include <vector>
16
17#include "../SourceStreamInterface.hpp"
18#include "../StreamInterface.hpp"
19#include "../TimestampInterface.hpp"
20#include "NvBufferInterface.hpp"
21#include "VideoFormat.hpp"
22
23// 前方宣言
24struct v4l2_buffer;
25class NvBuffer;
26namespace v4l2 {
27struct VideoFormat;
28}
29
30namespace zep {
31namespace video {
32
33class NvSourceCallbackInterface;
34
39 public:
46 const std::vector<VideoFormat>& formats) = 0;
47
55 virtual bool GetDecidedFormat(VideoFormat& format) const noexcept = 0;
56
65 virtual std::shared_future<VideoFormat> GetFormatDecisionStatus()
66 const noexcept = 0;
67
68 virtual std::unique_ptr<NvBufferInterface> DequeueBuffer() = 0;
69 virtual bool QueueBuffer(std::unique_ptr<NvBufferInterface> buffer) = 0;
70
75 virtual void SendStatistics(/*TODO*/) = 0;
76
86 virtual void RegisterCallback(
87 const std::shared_ptr<NvSourceCallbackInterface>& listener,
88 bool use_weak_ptr = false) = 0;
89
98 virtual void RegisterCallback(
99 std::unique_ptr<NvSourceCallbackInterface>&& listener) = 0;
100
101 virtual ~NvSourceInterface() noexcept = default;
102};
103
110 public:
114 enum class EventType {
116 kUnknown = 0,
117
119 kDisconnected,
120
122 kUnlinked,
123
125 kFailedFormatNegotiation,
126 };
127
137 virtual bool OnRequestSourceFormat(const VideoFormat& format) = 0;
138
145 virtual void OnNotifySourceEvent(EventType type, const std::string& message) {
146 }
147
148 virtual ~NvSourceCallbackInterface() noexcept = default;
149};
150
151} // namespace video
152} // namespace zep
153
154#endif // ZEP_VIDEO_NV_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
Definition NvBufferInterface.hpp:25
NVIDIA Multimedia APIを利用した映像ソース機能の コールバックインターフェース
Definition NvSourceInterface.hpp:109
virtual bool OnRequestSourceFormat(const VideoFormat &format)=0
フォーマット決定要求時に呼び出されるコールバック。
virtual void OnNotifySourceEvent(EventType type, const std::string &message)
エラーなどのイベントが発生した時に呼び出されるコールバック。
Definition NvSourceInterface.hpp:145
EventType
イベントの種類
Definition NvSourceInterface.hpp:114
NVIDIA Multimedia APIを利用した映像ソース機能インターフェース
Definition NvSourceInterface.hpp:38
virtual std::shared_future< VideoFormat > GetFormatDecisionStatus() const noexcept=0
フォーマット決定状態を取得するshared_futureを取得する。
virtual bool GetDecidedFormat(VideoFormat &format) const noexcept=0
決定したフォーマットを取得する。
virtual void SetAcceptableFormats(const std::vector< VideoFormat > &formats)=0
送信可能なフォーマット一覧を提示する。
virtual void SendStatistics()=0
統計情報の送信
Video format information.
Definition VideoFormat.hpp:24
Namespace for ZEP SDK.
Definition FactoryInterface.hpp:19