nx_server_plugin_sdk 1.0 Server Plugin SDK

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 <nx/sdk/cloud_storage/i_stream_reader.h>
6 #include <nx/sdk/helpers/ref_countable.h>
7 #include <nx/sdk/result.h>
8
9 namespace nx::vms_server_plugins::cloud_storage::sample {
10
11 class StreamReader: nx::sdk::RefCountable<nx::sdk::cloud_storage::IStreamReader>
12 {
13 public:
14 StreamReader(
15 const std::string& deviceId,
16 int streamIndex,
17 int64_t startTimeMs,
18 int64_t durationMs);
19
20 virtual nx::sdk::ErrorCode getNextData(
21 nx::sdk::cloud_storage::IMediaDataPacket** packet) override;
22
23 virtual int64_t startTimeUs() const override;
24 virtual int64_t endTimeUs() const override;
25
26 virtual nx::sdk::ErrorCode seek(
27 int64_t timestampUs, bool findKeyFrame, int64_t* selectedPositionUs) override;
28
29 protected:
30 virtual void getOpaqueMetadata(
31 nx::sdk::Result<const nx::sdk::IString*>* outResult) const override;
32 virtual const nx::sdk::IList<nx::sdk::cloud_storage::ICodecInfo>* getCodecInfoList() const override;
33 };
34
35 } // namespace nx::vms_server_plugins::cloud_storage::sample
nx::vms_server_plugins::cloud_storage::sample::StreamReader::getNextData
virtual nx::sdk::ErrorCode getNextData(nx::sdk::cloud_storage::IMediaDataPacket **packet) override
Definition: stream_reader.cpp:38
nx::sdk::cloud_storage::IMediaDataPacket
Definition: i_media_data_packet.h:17
nx::vms_server_plugins::cloud_storage::sample::StreamReader
Definition: stream_reader.h:11
nx::sdk::Result
Definition: result.h:52
nx::vms_server_plugins::cloud_storage::sample
Definition: device_agent.cpp:13
nx::sdk::IList< nx::sdk::cloud_storage::ICodecInfo >
nx::sdk::RefCountable
Definition: ref_countable.h:83
nx::vms_server_plugins::cloud_storage::sample::StreamReader::seek
virtual nx::sdk::ErrorCode seek(int64_t timestampUs, bool findKeyFrame, int64_t *selectedPositionUs) override
Definition: stream_reader.cpp:44