nx_metadata_sdk 1.0 Metadata 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 const nx::sdk::analytics::ICompressedVideoPacket* videoFrame) override;
27
28 virtual void doSetNeededMetadataTypes(
29 nx::sdk::Result<void>* outValue,
30 const nx::sdk::analytics::IMetadataTypes* neededMetadataTypes) override;
31
32 virtual nx::sdk::Result<const nx::sdk::ISettingsResponse*> settingsReceived() override;
33
34 private:
35 nx::sdk::Uuid trackIdByTrackIndex(int trackIndex);
36
37 nx::sdk::Ptr<nx::sdk::analytics::IMetadataPacket> generateObjectMetadataPacket(
38 int64_t frameTimestampUs);
39
40 private:
41 struct Settings
42 {
43 std::atomic<bool> generateInstanceOfBaseObjectType{true};
44 std::atomic<bool> generateInstanceOfDerivedObjectType{true};
45 std::atomic<bool> generateInstanceOfDerivedObjectTypeWithOmittedAttributes{true};
46 std::atomic<bool> generateInstanceOfHiddenDerivedObjectType{true};
47 std::atomic<bool> generateInstanceOfHiddenDerivedObjectTypeWithOwnAttributes{true};
48 std::atomic<bool> generateInstanceOfDerivedObjectTypeWithUnsupportedBase{true};
49 std::atomic<bool> generateInstanceOfObjectTypeWithNumericAttibutes{true};
50 std::atomic<bool> generateInstanceOfObjectTypeWithBooleanAttibutes{true};
51 std::atomic<bool> generateInstanceOfObjectTypeWithIcon{true};
52 std::atomic<bool> generateInstanceOfObjectTypeInheritedFromBaseLibraryType{true};
53 std::atomic<bool> generateInstanceOfObjectTypeUsingBaseLibraryEnumType{true};
54 std::atomic<bool> generateInstanceOfObjectTypeUsingBaseLibraryColorType{true};
55 std::atomic<bool> generateInstanceOfObjectTypeUsingBaseLibraryObjectType{true};
56 std::atomic<bool> generateInstanceOfOfBaseLibraryObjectType{true};
57 std::atomic<bool> generateInstanceOfObjectTypeDeclaredInEngineManifest{true};
58 std::atomic<bool> generateInstanceOfLiveOnlyObjectType{true};
59 std::atomic<bool> generateInstanceOfNonIndexableObjectType{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::sdk::analytics::ICompressedVideoPacket
Definition: i_compressed_video_packet.h:34
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:38
nx::vms_server_plugins::analytics::stub::taxonomy_features::DeviceAgent
Definition: device_agent.h:16
nx::sdk::analytics::IMetadataTypes
Definition: i_metadata_types.h:13
nx::sdk::Result< void >
Definition: result.h:81
nx::sdk::Uuid
Definition: uuid.h:22
nx::sdk::IDeviceInfo
Definition: i_device_info.h:14
nx::sdk::Result
Definition: result.h:47
nx::vms_server_plugins::analytics::stub::taxonomy_features::DeviceAgent::settingsReceived
virtual nx::sdk::Result< const nx::sdk::ISettingsResponse * > settingsReceived() override
Definition: device_agent.cpp:132
nx
Definition: apple_utils.h:6
nx::vms_server_plugins::analytics::stub::taxonomy_features::DeviceAgent::pushCompressedVideoFrame
virtual bool pushCompressedVideoFrame(const nx::sdk::analytics::ICompressedVideoPacket *videoFrame) override
Definition: device_agent.cpp:112