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 <vector>
6 
7 #include <nx/sdk/analytics/helpers/consuming_device_agent.h>
8 #include <nx/sdk/analytics/i_object_metadata_packet.h>
9 
10 #include "engine.h"
11 
13 
15 {
16 public:
17  DeviceAgent(Engine* engine, const nx::sdk::IDeviceInfo* deviceInfo);
18  virtual ~DeviceAgent() override;
19 
20 protected:
21  virtual std::string manifestString() const override;
22 
23  virtual bool pushCompressedVideoFrame(
25 
27 
28 private:
29  struct HttpRequestContext
30  {
31  nx::sdk::IUtilityProvider4::HttpDomainName domain =
32  nx::sdk::IUtilityProvider4::HttpDomainName::vms;
33  std::string url = "/rest/v4/site/settings";
34  std::string httpMethod = "GET";
35  std::string mimeType;
36  std::string requestBody;
37  int64_t periodSeconds = 1;
38  };
39 
40 private:
41  int64_t m_lastFrameTimestampUs = 0;
42  int64_t m_lastEventTimestampUs = 0;
43  HttpRequestContext m_requestContext;
44  Engine* const m_engine;
45 };
46 
47 } // namespace nx::vms_server_plugins::analytics::stub::http_requests
Definition: ptr.h:18
Definition: consuming_device_agent.h:36
virtual nx::sdk::Result< const nx::sdk::ISettingsResponse * > settingsReceived() override
Definition: device_agent.cpp:126
Definition: i_device_info.h:13
virtual bool pushCompressedVideoFrame(nx::sdk::Ptr< const nx::sdk::analytics::ICompressedVideoPacket > videoFrame) override
Definition: device_agent.cpp:97
Definition: result.h:52