Skip to content

Commit d975516

Browse files
authored
RDKEMW-1008: Add COM-RPC support to AVInput plugin (#480)
* RDKEMW-1008: Add COM-RPC support to AVInput plugin: WIP * RDKEMW-1008: Corrected build errors * RDKEMW-1008: Compiler errors: WIP * RDKEMW-1008: Compiler errors: WIP * RDKEMW-1008: Compiler errors: WIP * RDKEMW-1008: Compiler errors: WIP * RDKEMW-1008: Compiler errors: WIP * RDKEMW-1008: Compiler errors: Resolved * RDKEMW-1008: Clean-up, adding onDeviceChanged WIP * RDKEMW-1008: Clean-up, adding onDeviceChanged WIP * RDKEMW-1008: Clean-up, adding onDeviceChanged WIP * RDKEMW-1008: Fixed onDeviceChanged: WIP * RDKEMW-1008: WIP * RDKEMW-1008: WIP * RDKEMW-1008: WIP * RDKEMW-1008: WIP * RDKEMW-1008: WIP * RDKEMW-1008: WIP * Restored DeviceInfo.json * Removed debug * Formatting * Formatting * Formatting * AVInput COM-RPC Support: Updated per PR comments. * AVInput COM-RPC Support: Fixed GetInputDevices * AVInput COM-RPC Support: Aligned repsonses with existing code * AVInput COM-RPC Support: Fixed JSON for responses with only a success out param * AVInput COM-RPC Support: Renamed SuccessResult instances * AVInput COM-RPC Support: Refactored OnDevicesChanged to use iterator param * AVInput COM-RPC Support: Removed debug * AVInput COM-RPC Support: Rebased * Formatting * AVInput COM-RPC Support: Rebased * AVInput COM-RPC Support: Fixed rebase issue * AVInput COM-RPC Support: Formatting * AVInput COM-RPC Support: Rebased DeviceInfo.json * AVInput COM-RPC Support: Fixed rebase issue * AVInput COM-RPC Support: Fixed rebase issue * AVInput COM-RPC Support: Moved #defines to implementation * AVInput COM-RPC Support: Removed ContentType * AVInput COM-RPC Support: Unit tests: Fixed setMixerLevels * AVInput COM-RPC Support: Moved getInputDevices out of IAVInput * AVInput COM-RPC Support: Converted input types in interface to strings to maintain unit test compatibility * AVInput COM-RPC Support: Removed debug * AVInput COM-RPC Support: WIP * AVInput COM-RPC Support: WIP * AVInput COM-RPC Support: WIP * AVInput COM-RPC Support: WIP * AVInput COM-RPC Support: WIP * AVInput COM-RPC Support: Renamed HdmiContentTypeUpdate --> AviContentTypeUpdate to match existing implementation * AVInput COM-RPC Support: Updated documentaion to reflect existing code behavior
1 parent 8d5c67a commit d975516

File tree

4 files changed

+329
-19
lines changed

4 files changed

+329
-19
lines changed

apis/AVInput/IAVInput.h

Lines changed: 299 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,299 @@
1+
/*
2+
* If not stated otherwise in this file or this component's LICENSE file the
3+
* following copyright and licenses apply:
4+
*
5+
* Copyright 2025 RDK Management
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
#pragma once
21+
#include "Module.h"
22+
23+
// @stubgen:include <com/IIteratorType.h>
24+
25+
namespace WPEFramework {
26+
namespace Exchange {
27+
/* @json 1.0.0 @text:keep */
28+
struct EXTERNAL IAVInput : virtual public Core::IUnknown {
29+
enum {
30+
ID = ID_AV_INPUT
31+
};
32+
33+
struct InputDevice {
34+
int id /* @brief id */;
35+
string locator /* @brief locator */;
36+
bool connected /* @brief connected */;
37+
};
38+
39+
struct SuccessResult {
40+
bool success /* @brief success */;
41+
};
42+
43+
using IStringIterator = RPC::IIteratorType<string, RPC::ID_STRINGITERATOR>;
44+
using IInputDeviceIterator = RPC::IIteratorType<InputDevice, ID_AV_INPUT_DEVICE_LIST_ITERATOR>;
45+
46+
struct EXTERNAL IDevicesChangedNotification : virtual public Core::IUnknown {
47+
enum {
48+
ID = ID_AV_INPUT_NOTIFICATION_DEVICES_CHANGED
49+
};
50+
51+
// @text onDevicesChanged
52+
// @brief Triggered whenever a new HDMI/Composite device is connected to an HDMI/Composite Input
53+
virtual void OnDevicesChanged(IInputDeviceIterator* const devices) {}
54+
};
55+
56+
// @json:omit
57+
virtual Core::hresult RegisterDevicesChangedNotification(IDevicesChangedNotification* notification) = 0;
58+
59+
// @json:omit
60+
virtual Core::hresult UnregisterDevicesChangedNotification(IDevicesChangedNotification* notification) = 0;
61+
62+
// @event
63+
struct EXTERNAL ISignalChangedNotification : virtual public Core::IUnknown {
64+
enum {
65+
ID = ID_AV_INPUT_NOTIFICATION_SIGNAL_CHANGED
66+
};
67+
68+
// @text onSignalChanged
69+
// @brief Triggered whenever the signal status changes for an HDMI/Composite Input
70+
// @param id - in - The port identifier for the HDMI/Composite Input
71+
// @param locator - in - A URL corresponding to the HDMI/Composite Input port
72+
// @param signalStatus - in - Signal Status of the HDMI/Composite Input. Valid values are noSignal, unstableSignal, notSupportedSignal, stableSignal
73+
virtual void OnSignalChanged(const int id, const string& locator, const string& signalStatus) { };
74+
};
75+
76+
virtual Core::hresult RegisterSignalChangedNotification(ISignalChangedNotification* notification) = 0;
77+
virtual Core::hresult UnregisterSignalChangedNotification(ISignalChangedNotification* notification) = 0;
78+
79+
// @event
80+
struct EXTERNAL IInputStatusChangedNotification : virtual public Core::IUnknown {
81+
enum {
82+
ID = ID_AV_INPUT_NOTIFICATION_INPUT_STATUS_CHANGED
83+
};
84+
85+
// @text onInputStatusChanged
86+
// @brief Triggered whenever the status changes for an HDMI/Composite Input
87+
// @param id - in - The port identifier for the HDMI/Composite Input
88+
// @param locator - in - A URL corresponding to the HDMI/Composite Input port
89+
// @param status - in - Status of the HDMI/Composite Input. Valid values are started or stopped
90+
// @param plane - in - Defines whether the video plane type, 0 - Primary video plane, 1 - Secondary Video Plane, Other values - Invalid
91+
virtual void OnInputStatusChanged(const int id, const string& locator, const string& status, const int plane) { };
92+
};
93+
94+
virtual Core::hresult RegisterInputStatusChangedNotification(IInputStatusChangedNotification* notification) = 0;
95+
virtual Core::hresult UnregisterInputStatusChangedNotification(IInputStatusChangedNotification* notification) = 0;
96+
97+
// @event
98+
struct EXTERNAL IVideoStreamInfoUpdateNotification : virtual public Core::IUnknown {
99+
enum {
100+
ID = ID_AV_INPUT_NOTIFICATION_VIDEO_STREAM_INFO_UPDATE
101+
};
102+
103+
// @text videoStreamInfoUpdate
104+
// @brief Triggered whenever there is an update in HDMI/Composite Input video stream info
105+
// @param id - in - The port identifier for the HDMI/Composite Input
106+
// @param locator - in - A URL corresponding to the HDMI/Composite Input port
107+
// @param width - in - Width of the Video Stream
108+
// @param height - in - Height of the Video Stream
109+
// @param progressive - in - Whether the Video Stream is progressive or not
110+
// @param frameRateN - in - FrameRate Numerator
111+
// @param frameRateD - in - FrameRate Denominator
112+
virtual void VideoStreamInfoUpdate(const int id, const string& locator, const int width, const int height, const bool progressive, const int frameRateN, const int frameRateD) { };
113+
};
114+
115+
virtual Core::hresult RegisterVideoStreamInfoUpdateNotification(IVideoStreamInfoUpdateNotification* notification) = 0;
116+
virtual Core::hresult UnregisterVideoStreamInfoUpdateNotification(IVideoStreamInfoUpdateNotification* notification) = 0;
117+
118+
// @event
119+
struct EXTERNAL IGameFeatureStatusUpdateNotification : virtual public Core::IUnknown {
120+
enum {
121+
ID = ID_AV_INPUT_NOTIFICATION_GAME_FEATURE_STATUS_UPDATE
122+
};
123+
124+
// @text gameFeatureStatusUpdate
125+
// @brief Triggered whenever game feature(ALLM) status changes for an HDMI Input
126+
// @param id - in - The port identifier for the HDMI Input
127+
// @param gameFeature - in - Game Feature to which current status requested
128+
// @param mode - in - The current game feature status. Mode is required only for ALLM. Need to add support for future game features
129+
virtual void GameFeatureStatusUpdate(const int id, const string& gameFeature, const bool mode) { };
130+
};
131+
132+
virtual Core::hresult RegisterGameFeatureStatusUpdateNotification(IGameFeatureStatusUpdateNotification* notification) = 0;
133+
virtual Core::hresult UnregisterGameFeatureStatusUpdateNotification(IGameFeatureStatusUpdateNotification* notification) = 0;
134+
135+
// @event
136+
struct EXTERNAL IAviContentTypeUpdateNotification : virtual public Core::IUnknown {
137+
enum {
138+
ID = ID_AV_INPUT_NOTIFICATION_AVI_CONTENT_TYPE_UPDATE
139+
};
140+
141+
// @text aviContentTypeUpdate
142+
// @brief Triggered whenever AV Infoframe content type changes for an HDMI Input
143+
// @param id - in - Hdmi Input port ID for which content type change event received and possible values are port id 0, 1 and 2 for three Hdmi Input ports
144+
// @param aviContentType - in - new Content type received for the active hdmi input port and the possible integer values indicates following accordingly 0 - Graphics, 1 - Photo, 2 - Cinema, 3 - Game, 4 - Invalid data
145+
virtual void AviContentTypeUpdate(const int id, const int aviContentType) { };
146+
};
147+
148+
virtual Core::hresult RegisterAviContentTypeUpdateNotification(IAviContentTypeUpdateNotification* notification) = 0;
149+
virtual Core::hresult UnregisterAviContentTypeUpdateNotification(IAviContentTypeUpdateNotification* notification) = 0;
150+
151+
// @text numberOfInputs
152+
// @brief Returns an integer that specifies the number of available inputs
153+
// @param numberOfInputs - out - The number of inputs that are available for selection
154+
// @param success - out - Whether the request succeeded
155+
virtual Core::hresult NumberOfInputs(uint32_t& numberOfInputs /* @out */, bool& success /* @out */) = 0;
156+
157+
// @text writeEDID
158+
// @brief Changes a current EDID value.
159+
// @param portId - in - An ID of an HDMI/Composite Input port as returned by the getInputDevices method
160+
// @param message - in - A new EDID value
161+
// @param success - out - Whether the request succeeded
162+
virtual Core::hresult WriteEDID(const string& portId, const string& message, SuccessResult& successResult /* @out */) = 0;
163+
164+
// @text readEDID
165+
// @brief Returns the current EDID value.
166+
// @param portId - in - An ID of an HDMI/Composite Input port as returned by the getInputDevices method
167+
// @param EDID - out - The EDID Value
168+
// @param success - out - Whether the request succeeded
169+
virtual Core::hresult ReadEDID(const string& portId, string& EDID /* @out */, bool& success /* @out */) = 0;
170+
171+
// @text getRawSPD
172+
// @brief Returns the Source Data Product Descriptor (SPD) infoFrame packet information for the specified HDMI Input device as raw bits
173+
// @param portId - in - An ID of an HDMI/Composite Input port as returned by the getInputDevices method
174+
// @param HDMISPD - out - The SPD information as raw bits
175+
// @param success - out - Whether the request succeeded
176+
virtual Core::hresult GetRawSPD(const string& portId, string& HDMISPD /* @out */, bool& success /* @out */) = 0;
177+
178+
// @text getSPD
179+
// @brief Returns the Source Data Product Descriptor (SPD) infoFrame packet information for the specified HDMI Input device
180+
// @param portId - in - An ID of an HDMI/Composite Input port as returned by the getInputDevices method
181+
// @param HDMISPD - out - The SPD information
182+
// @param success - out - Whether the request succeeded
183+
virtual Core::hresult GetSPD(const string& portId, string& HDMISPD /* @out */, bool& success /* @out */) = 0;
184+
185+
// @text setEdidVersion
186+
// @brief Sets an HDMI EDID version
187+
// @param portId - in - An ID of an HDMI/Composite Input port as returned by the getInputDevices method
188+
// @param edidVersion - in - The EDID version
189+
// @param success - out - Whether the request succeeded
190+
virtual Core::hresult SetEdidVersion(const string& portId, const string& edidVersion, SuccessResult& successResult /* @out */) = 0;
191+
192+
// @text getEdidVersion
193+
// @brief Returns the EDID version
194+
// @param portId - in - An ID of an HDMI/Composite Input port as returned by the getInputDevices method
195+
// @param edidVersion - out - The EDID version
196+
// @param success - out - Whether the request succeeded
197+
virtual Core::hresult GetEdidVersion(const string& portId, string& edidVersion /* @out */, bool& success /* @out */) = 0;
198+
199+
// @text setEdid2AllmSupport
200+
// @brief Sets an HDMI ALLM bit in EDID.
201+
// @param portId - in - An ID of an HDMI/Composite Input port as returned by the getInputDevices method
202+
// @param allmSupport - in - The ALLM support in EDID
203+
// @param success - out - Whether the request succeeded
204+
virtual Core::hresult SetEdid2AllmSupport(const string& portId, const bool allmSupport, SuccessResult& successResult /* @out */) = 0;
205+
206+
// @text getEdid2AllmSupport
207+
// @brief Returns the ALLM bit in EDID
208+
// @param portId - in - The ID of the input device to get the ALLM
209+
// @param allmSupport - out - The ALLM bit value in edid
210+
// @param success - out - Whether the request succeeded
211+
virtual Core::hresult GetEdid2AllmSupport(const string& portId, bool& allmSupport /* @out */, bool& success /* @out */) = 0;
212+
213+
// @text setVRRSupport
214+
// @brief Sets an HDMI VRR support bit in EDID
215+
// @param id - in - The ID of the input device to set the VRR
216+
// @param vrrSupport - in - The VRR support bit value to set
217+
virtual Core::hresult SetVRRSupport(const string& portId, const bool vrrSupport, SuccessResult& successResult /* @out */) = 0;
218+
219+
// @text getVRRSupport
220+
// @brief Returns the VRR support bit in EDID
221+
// @param id - in - The ID of the input device to get the VRR
222+
// @param vrrSupport - out - The VRR support bit value
223+
virtual Core::hresult GetVRRSupport(const string& portId, bool& vrrSupport /* @out */, bool& success /* @out */) = 0;
224+
225+
// @text getHdmiVersion
226+
// @brief Gets the maximum hdmi compatibility version supported for the given port.
227+
// @param portId - in - An ID of an HDMI/Composite Input port as returned by the getInputDevices method
228+
// @param HdmiCapabilityVersion - out - The Maximum Hdmi compatibility version supported by the given port
229+
// @param success - out - Whether the request succeeded
230+
virtual Core::hresult GetHdmiVersion(const string& portId, string& HdmiCapabilityVersion /* @out */, bool& success /* @out */) = 0;
231+
232+
// @text setMixerLevels
233+
// @brief Sets the audio mixer level for given audio input.
234+
// @param primaryVolume - in - Primary audio input volume
235+
// @param inputVolume - in - System audio input volume
236+
// @param success - out - Whether the request succeeded
237+
virtual Core::hresult SetMixerLevels(const int primaryVolume, const int inputVolume, SuccessResult& successResult /* @out */) = 0;
238+
239+
// @text startInput
240+
// @brief Activates the specified HDMI/Composite Input port as the primary video source.
241+
// @param portId - in - An ID of an HDMI/Composite Input port as returned by the getInputDevices method
242+
// @param typeOfInput - in - The type of Input - HDMI/COMPOSITE
243+
// @param requestAudioMix - in - Defines whether the Audio mixing is true or false, This is an optional argument
244+
// @param plane - in - Defines whether the video plane type, 0 - Primary video plane, 1 - Secondary Video Plane, Other values - Invalid - This is an optional argument
245+
// @param topMost - in - Defines whether the Hdmi Input should be over or under the other video plane
246+
// @param success - out - Whether the request succeeded
247+
virtual Core::hresult StartInput(const string& portId, const string& typeOfInput, const bool requestAudioMix, const int plane, const bool topMost, SuccessResult& successResult /* @out */) = 0;
248+
249+
// @text stopInput
250+
// @brief Deactivates the HDMI/Composite Input port currently selected as the primary video source.
251+
// @param typeOfInput - in - The type of Input - HDMI/COMPOSITE
252+
// @param success - out - Whether the request succeeded
253+
virtual Core::hresult StopInput(const string& typeOfInput, SuccessResult& successResult /* @out */) = 0;
254+
255+
// @text setVideoRectangle
256+
// @brief Sets an HDMI/Composite Input video window.
257+
// @param x - in - The x-coordinate of the video rectangle
258+
// @param y - in - The y-coordinate of the video rectangle
259+
// @param w - in - The width of the video rectangle
260+
// @param h - in - The height of the video rectangle
261+
// @param typeOfInput - in - The type of Input - HDMI/COMPOSITE
262+
// @param success - out - Whether the request succeeded
263+
virtual Core::hresult SetVideoRectangle(const uint16_t x, const uint16_t y, const uint16_t w, const uint16_t h, const string& typeOfInput, SuccessResult& successResult /* @out */) = 0;
264+
265+
// @text currentVideoMode
266+
// @brief Returns the current video mode for the specified input device
267+
// @param currentVideoMode - out - The current video mode
268+
// @param success - out - Whether the request succeeded
269+
virtual Core::hresult CurrentVideoMode(string& currentVideoMode /* @out */, bool& success /* @out */) = 0;
270+
271+
// @text contentProtected
272+
// @brief Returns whether the content is protected for the specified input device
273+
// @param isContentProtected - out - Whether the HDMI input is protected
274+
// @param success - out - Whether the request succeeded
275+
virtual Core::hresult ContentProtected(bool& isContentProtected /* @out */, bool& success /* @out */) = 0;
276+
277+
// @text getSupportedGameFeatures
278+
// @brief Returns the list of supported game features.
279+
// @param supportedGameFeatures - out - The supported game Features
280+
// @param success - out - Whether the request succeeded
281+
virtual Core::hresult GetSupportedGameFeatures(WPEFramework::Exchange::IAVInput::IStringIterator*& supportedGameFeatures /* @out */, bool& success /* @out */) = 0;
282+
283+
// @text getGameFeatureStatus
284+
// @brief Returns the Game Feature Status. For example: ALLM.
285+
// @param portId - in - An ID of an HDMI Input port as returned by the getInputDevices method
286+
// @param gameFeature - in - Game Feature to which current status requested
287+
// @param mode - out - The current game feature status. Mode is required only for ALLM. Need to add support for future game features
288+
// @param success - out - Whether the request succeeded
289+
virtual Core::hresult GetGameFeatureStatus(const string& portId, const string& gameFeature, bool& mode /* @out */, bool& success /* @out */) = 0;
290+
291+
// @text getVRRFrameRate
292+
// @brief Returns the current VRR frame rate for the specified input device
293+
// @param portId - in - An ID of an HDMI Input port as returned by the getInputDevices method
294+
// @param currentVRRVideoFrameRate - out - The current VRR frame rate
295+
// @param success - out - Whether the request succeeded
296+
virtual Core::hresult GetVRRFrameRate(const string& portId, double& currentVRRVideoFrameRate /* @out */, bool& success /* @out */) = 0;
297+
};
298+
} // namespace Exchange
299+
} // namespace WPEFramework

apis/Ids.h

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,18 @@ namespace Exchange {
302302
ID_FRONT_PANEL_LIGHTS_LIST_ITERATOR = ID_FRONT_PANEL + 1,
303303
ID_FRONT_PANEL_BLINK_INFO_LIST_ITERATOR = ID_FRONT_PANEL + 2,
304304

305-
ID_TELEMETRYMETRICS = ID_ENTOS_OFFSET + 0x3F0
306-
};
307-
}
308-
}
305+
ID_TELEMETRYMETRICS = ID_ENTOS_OFFSET + 0x3F0,
306+
307+
ID_AV_INPUT = ID_ENTOS_OFFSET + 0x400,
308+
ID_AV_INPUT_NOTIFICATION_DEVICES_CHANGED = ID_AV_INPUT + 1,
309+
ID_AV_INPUT_NOTIFICATION_SIGNAL_CHANGED = ID_AV_INPUT + 2,
310+
ID_AV_INPUT_NOTIFICATION_INPUT_STATUS_CHANGED = ID_AV_INPUT + 3,
311+
ID_AV_INPUT_NOTIFICATION_VIDEO_STREAM_INFO_UPDATE = ID_AV_INPUT + 4,
312+
ID_AV_INPUT_NOTIFICATION_GAME_FEATURE_STATUS_UPDATE = ID_AV_INPUT + 5,
313+
ID_AV_INPUT_NOTIFICATION_AVI_CONTENT_TYPE_UPDATE = ID_AV_INPUT + 6,
314+
ID_AV_INPUT_DEVICE_LIST_ITERATOR = ID_AV_INPUT + 7
315+
316+
}; // enum IDS
317+
318+
} // namespace Exchange
319+
} // namespace WPEFramework

0 commit comments

Comments
 (0)