|
22 | 22 | #include "Module.h" |
23 | 23 | #include "libIBus.h" |
24 | 24 |
|
25 | | -#if 1 |
26 | 25 | #include "dsTypes.h" |
27 | 26 | #include "host.hpp" |
28 | | -#endif |
29 | 27 |
|
30 | 28 | #define DEFAULT_PRIM_VOL_LEVEL 25 |
31 | 29 | #define MAX_PRIM_VOL_LEVEL 100 |
|
34 | 32 | namespace WPEFramework { |
35 | 33 | namespace Plugin { |
36 | 34 |
|
37 | | -class AVInput: public PluginHost::IPlugin, public PluginHost::JSONRPC |
38 | | -{ |
39 | | -private: |
| 35 | +class AVInput: public PluginHost::IPlugin, public PluginHost::JSONRPC, |
| 36 | + public device::Host::IHdmiInEvents, public device::Host::ICompositeInEvents{ |
40 | 37 |
|
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 | | - void 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 |
| 38 | +private: |
145 | 39 |
|
146 | 40 | AVInput(const AVInput &) = delete; |
147 | 41 | AVInput &operator=(const AVInput &) = delete; |
@@ -236,14 +130,14 @@ class AVInput: public PluginHost::IPlugin, public PluginHost::JSONRPC |
236 | 130 | static void dsAviContentTypeEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len); |
237 | 131 |
|
238 | 132 | private: |
239 | | - device::Host &_hostListener; |
240 | | - HdmiInEventNotification _hdmiEventNotification; |
241 | | - CompositeInEventNotification _compositeinEventNotification; |
242 | 133 |
|
243 | | - bool _registeredHostEventHandlers; |
| 134 | + device::Host::IHdmiInEvents *m_HdmiInEventsNotification; |
| 135 | + device::Host::ICompositeInEvents *m_CompositeInEventsNotification; |
| 136 | + |
| 137 | + bool _registeredDsEventHandlers; |
244 | 138 |
|
245 | 139 | public: |
246 | | - void registerHostEventHandlers(); |
| 140 | + void registerDsEventHandlers(); |
247 | 141 |
|
248 | 142 | /* HdmiInEventNotification*/ |
249 | 143 |
|
|
0 commit comments