21
21
22
22
#include " Module.h"
23
23
#include " libIBus.h"
24
+
25
+ #if 1
24
26
#include " dsTypes.h"
27
+ #include " host.hpp"
28
+ #endif
25
29
26
30
#define DEFAULT_PRIM_VOL_LEVEL 25
27
31
#define MAX_PRIM_VOL_LEVEL 100
@@ -33,6 +37,112 @@ namespace Plugin {
33
37
class AVInput : public PluginHost ::IPlugin, public PluginHost::JSONRPC
34
38
{
35
39
private:
40
+
41
+ #if 1 /* HDMIIn Events from libds Library */
42
+
43
+ class HdmiInEventNotification : public device ::Host::IHdmiInEvents {
44
+ private:
45
+ HdmiInEventNotification (const HdmiInEventNotification&) = delete ;
46
+ HdmiInEventNotification& operator =(const HdmiInEventNotification&) = delete ;
47
+
48
+ public:
49
+ explicit HdmiInEventNotification (AVInput& parent)
50
+ : _parent(parent)
51
+ {
52
+ }
53
+ ~HdmiInEventNotification () override = default ;
54
+
55
+ public:
56
+ void OnHdmiInEventHotPlug (dsHdmiInPort_t port, bool isConnected) override
57
+ {
58
+ _parent.OnHdmiInEventHotPlug (port,isConnected);
59
+ }
60
+
61
+ void OnHdmiInEventSignalStatus (dsHdmiInPort_t port, dsHdmiInSignalStatus_t signalStatus) override
62
+ {
63
+ _parent.OnHdmiInEventSignalStatus (port,signalStatus);
64
+ }
65
+
66
+ void OnHdmiInEventStatus (dsHdmiInPort_t activePort, bool isPresented) override
67
+ {
68
+ _parent.OnHdmiInEventStatus (activePort,isPresented);
69
+ }
70
+
71
+ void OnHdmiInVideoModeUpdate (dsHdmiInPort_t port, const dsVideoPortResolution_t& videoPortResolution) override
72
+ {
73
+ _parent.OnHdmiInVideoModeUpdate (port,videoPortResolution);
74
+ }
75
+
76
+ void OnHdmiInAllmStatus (dsHdmiInPort_t port, bool allmStatus) override
77
+ {
78
+ _parent.OnHdmiInAllmStatus (port,allmStatus);
79
+ }
80
+
81
+ void OnHdmiInAVIContentType (dsHdmiInPort_t port, dsAviContentType_t aviContentType) override
82
+ {
83
+ _parent.OnHdmiInAVIContentType (port, aviContentType);
84
+ }
85
+
86
+ void OnHdmiInVRRStatus (dsHdmiInPort_t port, dsVRRType_t vrrType) override
87
+ {
88
+ _parent.OnHdmiInVRRStatus (port, vrrType);
89
+ }
90
+
91
+ void OnHdmiInAVLatency (int audioDelay, int videoDelay) override
92
+ {
93
+ _parent.OnHdmiInAVLatency (audioDelay, videoDelay);
94
+ }
95
+
96
+ BEGIN_INTERFACE_MAP (HdmiInEventNotification)
97
+ INTERFACE_ENTRY (device::Host::IHDMIInEvents)
98
+ END_INTERFACE_MAP
99
+
100
+ private:
101
+ AVInput& _parent;
102
+ };
103
+
104
+ class CompositeInEventNotification : public device ::Host::ICompositeInEvents {
105
+ private:
106
+ CompositeInEventNotification (const CompositeInEventNotification&) = delete ;
107
+ CompositeInEventNotification& operator =(const CompositeInEventNotification&) = delete ;
108
+
109
+ public:
110
+ explicit CompositeInEventNotification (AVInput& parent)
111
+ : _parent(parent)
112
+ {
113
+ }
114
+ ~CompositeInEventNotification () override = default ;
115
+
116
+ public:
117
+ void OnCompositeInHotPlug (dsCompositeInPort_t port, bool isConnected) override
118
+ {
119
+ _parent.OnCompositeInHotPlug (port,isConnected);
120
+ }
121
+
122
+ void OnCompositeInSignalStatus (dsCompositeInPort_t port, dsCompInSignalStatus_t signalStatus) override
123
+ {
124
+ _parent.OnCompositeInSignalStatus (port,signalStatus);
125
+ }
126
+
127
+ void OnCompositeInStatus (dsCompositeInPort_t activePort, bool isPresented) override
128
+ {
129
+ _parent.OnCompositeInStatus (activePort,isPresented);
130
+ }
131
+
132
+ OnCompositeInVideoModeUpdate (dsCompositeInPort_t activePort, dsVideoPortResolution_t videoResolution) override
133
+ {
134
+ _parent.OnCompositeInVideoModeUpdate (activePort,videoResolution);
135
+ }
136
+
137
+ BEGIN_INTERFACE_MAP (CompositeInEventNotification)
138
+ INTERFACE_ENTRY (device::Host::ICompositeInEvents)
139
+ END_INTERFACE_MAP
140
+
141
+ private:
142
+ AVInput& _parent;
143
+ };
144
+ #endif
145
+
36
146
AVInput (const AVInput &) = delete ;
37
147
AVInput &operator =(const AVInput &) = delete ;
38
148
@@ -124,6 +234,35 @@ class AVInput: public PluginHost::IPlugin, public PluginHost::JSONRPC
124
234
125
235
void hdmiInputAviContentTypeChange (int port, int content_type);
126
236
static void dsAviContentTypeEventHandler (const char *owner, IARM_EventId_t eventId, void *data, size_t len);
237
+
238
+ private:
239
+ device::Host &_hostListener;
240
+ HdmiInEventNotification _hdmiEventNotification;
241
+ CompositeInEventNotification _compositeinEventNotification;
242
+
243
+ bool _registeredHostEventHandlers;
244
+
245
+ public:
246
+ void registerHostEventHandlers ();
247
+
248
+ /* HdmiInEventNotification*/
249
+
250
+ void OnHdmiInEventHotPlug (dsHdmiInPort_t port, bool isConnected);
251
+ void OnHdmiInEventSignalStatus (dsHdmiInPort_t port, dsHdmiInSignalStatus_t signalStatus);
252
+ void OnHdmiInEventStatus (dsHdmiInPort_t activePort, bool isPresented);
253
+ void OnHdmiInVideoModeUpdate (dsHdmiInPort_t port, const dsVideoPortResolution_t& videoPortResolution);
254
+ void OnHdmiInAllmStatus (dsHdmiInPort_t port, bool allmStatus);
255
+ void OnHdmiInAVIContentType (dsHdmiInPort_t port, dsAviContentType_t aviContentType);
256
+ void OnHdmiInVRRStatus (dsHdmiInPort_t port, dsVRRType_t vrrType);
257
+ void OnHdmiInAVLatency (int audioDelay, int videoDelay);
258
+
259
+ /* CompositeInEventNotification */
260
+
261
+ void OnCompositeInHotPlug (dsCompositeInPort_t port, bool isConnected);
262
+ void OnCompositeInSignalStatus (dsCompositeInPort_t port, dsCompInSignalStatus_t signalStatus);
263
+ void OnCompositeInStatus (dsCompositeInPort_t activePort, bool isPresented);
264
+ void OnCompositeInVideoModeUpdate (dsCompositeInPort_t activePort, dsVideoPortResolution_t videoResolution);
265
+
127
266
public:
128
267
static AVInput* _instance;
129
268
};
0 commit comments