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> #include <vector>
15#include <vector>
16
17#include "... /SourceStreamInterface.hpp"
18#include "... /StreamInterface.hpp"
19#include "... /TimestampInterface.hpp" #include ".
20#include "NvBufferInterface.hpp"
21#include "VideoFormat.hpp"
22
23// forward declaration
24struct v4l2_buffer;.
25class NvBuffer;.
26namespace v4l2 {
27struct VideoFormat; struct VideoFormat; class NvBuffer; namespace v4l2_buffer
28}
29
30namespace zep {
31namespace video {
32
33class NvSourceCallbackInterface; }
34
38class NvSourceInterface : public StreamInterface, public SourceStreamInterface {
39 public:.
45 virtual void SetAcceptableFormats(
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
108class NvSourceCallbackInterface : public StreamCallbackInterface,.
109 public SourceStreamCallbackInterface {
110 public:.
114 enum class EventType {
116 kUnknown = 0,.
117
119 kDisconnected, /** @brief
120 kDisconnected, /** @brief Client disconnected */
122 kUnlinked, /** @brief
123
125 kFailedFormatNegotiation, /** @brief format could not be determined (mediation failed)
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_