nx_server_plugin_sdk 1.0 Server Plugin SDK

i_stream_reader.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #pragma once
4
5 #include <camera/camera_plugin.h>
6 #include <nx/sdk/cloud_storage/i_codec_info.h>
7 #include <nx/sdk/cloud_storage/i_media_data_packet.h>
8 #include <nx/sdk/i_list.h>
9 #include <nx/sdk/interface.h>
10
11 namespace nx::sdk::cloud_storage {
12
16 class IStreamReader: public Interface<IStreamReader>
17 {
18 public:
19 static auto interfaceId() { return makeId("nx::sdk::archive::StreamReader"); }
20
25 public: virtual ErrorCode getNextData(IMediaDataPacket** packet) = 0;
26
27 protected: virtual void getOpaqueMetadata(Result<const IString*>* outResult) const = 0;
32 public: Result<const IString*> opaqueMetadata() const
33 {
34 Result<const IString*> result;
35 getOpaqueMetadata(&result);
36 return result;
37 }
38
39 protected: virtual const IList<ICodecInfo>* getCodecInfoList() const = 0;
44 public: Ptr<const IList<ICodecInfo>> codecInfoList() const { return Ptr(getCodecInfoList()); }
45
46 virtual int64_t startTimeUs() const = 0;
47 virtual int64_t endTimeUs() const = 0;
48
55 virtual ErrorCode seek(int64_t timestampUs, bool findKeyFrame, int64_t* selectedPositionUs) = 0;
56
60 virtual int size() const = 0;
61 };
62
63 } // namespace nx::sdk::cloud_storage
nx::sdk::cloud_storage::IStreamReader::codecInfoList
Ptr< const IList< ICodecInfo > > codecInfoList() const
Definition: i_stream_reader.h:44
nx::sdk::cloud_storage::IStreamReader
Definition: i_stream_reader.h:16
nx::sdk::Interface
Definition: interface.h:48
nx::sdk::cloud_storage::IMediaDataPacket
Definition: i_media_data_packet.h:17
nx::sdk::cloud_storage::IStreamReader::opaqueMetadata
Result< const IString * > opaqueMetadata() const
Definition: i_stream_reader.h:32
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::cloud_storage::IStreamReader::getNextData
virtual ErrorCode getNextData(IMediaDataPacket **packet)=0
nx::sdk::cloud_storage::IStreamReader::seek
virtual ErrorCode seek(int64_t timestampUs, bool findKeyFrame, int64_t *selectedPositionUs)=0
nx::sdk::Result
Definition: result.h:52
nx::sdk::cloud_storage::IStreamReader::size
virtual int size() const =0
nx::sdk::cloud_storage
Definition: algorithm.cpp:9
nx::sdk::IList
Definition: i_list.h:10
nx::sdk::IRefCountable::makeId
static const InterfaceId * makeId(const char(&charArray)[len])
Definition: i_ref_countable.h:77