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 <nx/sdk/analytics/helpers/consuming_device_agent.h>
6 #include <nx/sdk/helpers/uuid_helper.h>
7
8 #include "engine.h"
9
10 namespace nx {
11 namespace vms_server_plugins {
12 namespace analytics {
13 namespace stub {
14 namespace taxonomy_features {
15
16 class DeviceAgent: public nx::sdk::analytics::ConsumingDeviceAgent
17 {
18 public:
19 DeviceAgent(Engine* engine, const nx::sdk::IDeviceInfo* deviceInfo);
20 virtual ~DeviceAgent() override;
21
22 protected:
23 virtual std::string manifestString() const override;
24
25 virtual bool pushCompressedVideoFrame(
26 nx::sdk::Ptr<const nx::sdk::analytics::ICompressedVideoPacket> videoFrame) override;
27
28 virtual nx::sdk::Result<const nx::sdk::ISettingsResponse*> settingsReceived() override;
29
30 private:
31 nx::sdk::Uuid trackIdByTrackIndex(int trackIndex);
32
33 nx::sdk::Ptr<nx::sdk::analytics::IMetadataPacket> generateObjectMetadataPacket(
34 int64_t frameTimestampUs);
35
36 private:
37 struct Settings
38 {
39 std::atomic<bool> generateInstanceOfBaseObjectType{true};
40 std::atomic<bool> generateInstanceOfDerivedObjectType{true};
41 std::atomic<bool> generateInstanceOfDerivedObjectTypeWithOmittedAttributes{true};
42 std::atomic<bool> generateInstanceOfHiddenDerivedObjectType{true};
43 std::atomic<bool> generateInstanceOfHiddenDerivedObjectTypeWithOwnAttributes{true};
44 std::atomic<bool> generateInstanceOfDerivedObjectTypeWithUnsupportedBase{true};
45 std::atomic<bool> generateInstanceOfObjectTypeWithNumericAttibutes{true};
46 std::atomic<bool> generateInstanceOfObjectTypeWithBooleanAttibutes{true};
47 std::atomic<bool> generateInstanceOfObjectTypeWithIcon{true};
48 std::atomic<bool> generateInstanceOfObjectTypeInheritedFromBaseTypeLibraryType{true};
49 std::atomic<bool> generateInstanceOfObjectTypeUsingBaseTypeLibraryEnumType{true};
50 std::atomic<bool> generateInstanceOfObjectTypeUsingBaseTypeLibraryColorType{true};
51 std::atomic<bool> generateInstanceOfObjectTypeUsingBaseTypeLibraryObjectType{true};
52 std::atomic<bool> generateInstanceOfOfBaseTypeLibraryObjectType{true};
53 std::atomic<bool> generateInstanceOfObjectTypeDeclaredInEngineManifest{true};
54 std::atomic<bool> generateInstanceOfLiveOnlyObjectType{true};
55 std::atomic<bool> generateInstanceOfNonIndexableObjectType{true};
56 std::atomic<bool> generateInstanceOfExtendedObjectType{true};
57 std::atomic<bool> generateInstanceOfObjectTypeWithAttributeList{true};
58 std::atomic<bool> generateInstanceOfObjectTypeWithDependentAttributes{true};
59 std::atomic<bool> generateInstanceOfObjectTypeWithEnumAttributesWithInlineItems{true};
60 };
61
62 Engine* const m_engine;
63
64 int m_frameIndex = 0;
65 std::vector<nx::sdk::Uuid> m_trackIds;
66 Settings m_settings;
67 };
68
69 } // namespace taxonomy_features
70 } // namespace stub
71 } // namespace analytics
72 } // namespace vms_server_plugins
73 } // namespace nx
nx::vms_server_plugins::analytics::stub::taxonomy_features::Engine
Definition: engine.h:15
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::analytics::ConsumingDeviceAgent
Definition: consuming_device_agent.h:36
nx::vms_server_plugins::analytics::stub::taxonomy_features::DeviceAgent
Definition: device_agent.h:16
nx::sdk::Uuid
Definition: uuid.h:22
nx::sdk::IDeviceInfo
Definition: i_device_info.h:13
nx::sdk::Result
Definition: result.h:52
nx::vms_server_plugins::analytics::stub::taxonomy_features::DeviceAgent::settingsReceived
virtual nx::sdk::Result< const nx::sdk::ISettingsResponse * > settingsReceived() override
Definition: device_agent.cpp:138
nx
Definition: apple_utils.h:6
nx::vms_server_plugins::analytics::stub::taxonomy_features::DeviceAgent::pushCompressedVideoFrame
virtual bool pushCompressedVideoFrame(nx::sdk::Ptr< const nx::sdk::analytics::ICompressedVideoPacket > videoFrame) override
Definition: device_agent.cpp:124