nx_server_plugin_sdk 1.0 Server Plugin SDK

device_agent.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 <memory>
6
7 #include <nx/sdk/cloud_storage/helpers/data.h>
8 #include <nx/sdk/cloud_storage/i_integration.h>
9 #include <nx/sdk/helpers/ref_countable.h>
10 #include <nx/sdk/result.h>
11
12 #include "data_manager.h"
13
14 namespace nx::vms_server_plugins::cloud_storage::stub {
15
16 class DeviceAgent: public nx::sdk::RefCountable<nx::sdk::cloud_storage::IDeviceAgent>
17 {
18 public:
19 DeviceAgent(
20 const nx::sdk::cloud_storage::DeviceDescription& deviceDescription,
21 std::shared_ptr<DataManager> metadataManager);
22
23 protected:
24 virtual void getDeviceInfo(nx::sdk::Result<const nx::sdk::IDeviceInfo*>* outResult) const override;
25 virtual void doCreateStreamWriter(
26 nxcip::MediaStreamQuality quality,
27 int64_t startTimeMs,
28 const nx::sdk::IList<nx::sdk::cloud_storage::ICodecInfo>* codecList,
29 const char* opaqueMetadata,
30 nx::sdk::Result<nx::sdk::cloud_storage::IStreamWriter*>* outResult) override;
31
32 virtual void doCreateStreamReader(
33 const char* bucketUrl,
34 nxcip::MediaStreamQuality quality,
35 int64_t startTimeMs,
36 int64_t durationMs,
37 nx::sdk::Result<nx::sdk::cloud_storage::IStreamReader*>* outResult) override;
38
39 private:
40 std::shared_ptr<DataManager> m_dataManager;
41 const nx::sdk::cloud_storage::DeviceDescription m_deviceDescription;
42 };
43
44 } // namespace nx::vms_server_plugins::cloud_storage::stub
nx::vms_server_plugins::cloud_storage::stub
Definition: data_manager.cpp:36
nx::sdk::Result
Definition: result.h:52
nx::vms_server_plugins::cloud_storage::stub::DeviceAgent::getDeviceInfo
virtual void getDeviceInfo(nx::sdk::Result< const nx::sdk::IDeviceInfo *> *outResult) const override
Definition: device_agent.cpp:27
nx::sdk::cloud_storage::DeviceDescription
Definition: data.h:209
nx::vms_server_plugins::cloud_storage::stub::DeviceAgent
Definition: device_agent.h:16
nxcip::MediaStreamQuality
MediaStreamQuality
Definition: camera_plugin.h:1189
nx::sdk::IList< nx::sdk::cloud_storage::ICodecInfo >
nx::sdk::RefCountable
Definition: ref_countable.h:83