nx_server_plugin_sdk 1.0 Server Plugin SDK

i_uncompressed_video_frame.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/i_metadata_packet.h>
6 #include <nx/sdk/analytics/i_uncompressed_media_frame.h>
7 #include <nx/sdk/i_list.h>
8 #include <nx/sdk/interface.h>
9
10 namespace nx::sdk::analytics {
11
12 class IUncompressedVideoFrame0:
13 public Interface<IUncompressedVideoFrame0, IUncompressedMediaFrame0>
14 {
15 public:
16 static auto interfaceId() { return makeId("nx::sdk::analytics::IUncompressedVideoFrame"); }
17
18 enum class PixelFormat: int
19 {
20 yuv420,
21 argb,
22 abgr,
23 rgba,
24 bgra,
25 rgb,
26 bgr,
27 count
28 };
29
30 struct PixelAspectRatio
31 {
32 int numerator;
33 int denominator;
34 };
35
39 virtual int width() const = 0;
40
44 virtual int height() const = 0;
45
47 protected: virtual void getPixelAspectRatio(PixelAspectRatio* outValue) const = 0;
51 public: PixelAspectRatio pixelAspectRatio() const
52 {
53 PixelAspectRatio value;
54 getPixelAspectRatio(&value);
55 return value;
56 }
57
58 virtual PixelFormat pixelFormat() const = 0;
59
64 virtual int lineSize(int plane) const = 0;
65 };
66
70 class IUncompressedVideoFrame: public Interface<IUncompressedVideoFrame, IUncompressedVideoFrame0>
71 {
72 public:
73 static auto interfaceId() { return makeId("nx::sdk::analytics::IUncompressedVideoFrame1"); }
74
76 protected: virtual IList<IMetadataPacket>* getMetadataList() const = 0;
77 public: Ptr<IList<IMetadataPacket>> metadataList() const
78 {
79 return Ptr(getMetadataList());
80 }
81 };
82 using IUncompressedVideoFrame1 = IUncompressedVideoFrame;
83
84 } // namespace nx::sdk::analytics
nx::sdk::analytics::IUncompressedVideoFrame0::getPixelAspectRatio
virtual void getPixelAspectRatio(PixelAspectRatio *outValue) const =0
nx::sdk::analytics::IUncompressedVideoFrame0::lineSize
virtual int lineSize(int plane) const =0
nx::sdk::Interface
Definition: interface.h:48
nx::sdk::analytics::IUncompressedVideoFrame0::pixelAspectRatio
PixelAspectRatio pixelAspectRatio() const
Definition: i_uncompressed_video_frame.h:51
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::analytics
Definition: consuming_device_agent.cpp:25
nx::sdk::analytics::IUncompressedVideoFrame0::height
virtual int height() const =0
nx::sdk::analytics::IUncompressedVideoFrame0::width
virtual int width() const =0
nx::sdk::analytics::IUncompressedVideoFrame0
Definition: i_uncompressed_video_frame.h:12
nx::sdk::analytics::IUncompressedVideoFrame
Definition: i_uncompressed_video_frame.h:70
nx::sdk::analytics::IUncompressedVideoFrame::getMetadataList
virtual IList< IMetadataPacket > * getMetadataList() const =0
nx::sdk::IList
Definition: i_list.h:10
nx::sdk::analytics::IUncompressedVideoFrame0::PixelAspectRatio
Definition: i_uncompressed_video_frame.h:30