Skip to content

Commit b4caeab

Browse files
RDKEMW-1017 RDKEMW-1018: Updated IMiracastPlayer and IMiracastService
Signed-off-by: yuvaramachandran_gurusamy <[email protected]>
1 parent ad3cc34 commit b4caeab

File tree

3 files changed

+269
-258
lines changed

3 files changed

+269
-258
lines changed

apis/Ids.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,11 @@ namespace Exchange {
292292
ID_HDMI_CEC_SINK_DEVICE_LIST_ITERATOR = ID_HDMI_CEC_SINK + 2,
293293
ID_HDMI_CEC_SINK_NOTIFICATION = ID_HDMI_CEC_SINK + 3,
294294

295-
ID_MIRACAST_SERVICE = ID_ENTOS_OFFSET + 0x3D0,
296-
ID_MIRACAST_SERVICE_NOTIFICATION = ID_MIRACAST_SERVICE + 1,
297-
ID_MIRACAST_PLAYER = ID_MIRACAST_SERVICE + 2,
298-
ID_MIRACAST_PLAYER_NOTIFICATION = ID_MIRACAST_SERVICE + 3,
299-
ID_MIRACAST_PLAYER_WESTEROS_ENV_ARGS_ITERATOR= ID_MIRACAST_SERVICE + 4
295+
ID_MIRACAST_SERVICE = ID_ENTOS_OFFSET + 0x3D0,
296+
ID_MIRACAST_SERVICE_NOTIFICATION = ID_MIRACAST_SERVICE + 1,
297+
ID_MIRACAST_PLAYER = ID_MIRACAST_SERVICE + 2,
298+
ID_MIRACAST_PLAYER_NOTIFICATION = ID_MIRACAST_SERVICE + 3,
299+
ID_MIRACAST_PLAYER_ENV_ARGUMENTS_ITERATOR = ID_MIRACAST_SERVICE + 4
300300
};
301301
}
302302
}

apis/Miracast/IMiracastPlayer.h

Lines changed: 137 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -25,130 +25,141 @@
2525

2626
namespace WPEFramework
2727
{
28-
namespace Exchange
29-
{
30-
// @json @text:keep
31-
struct EXTERNAL IMiracastPlayer : virtual public Core::IUnknown
32-
{
33-
enum { ID = ID_MIRACAST_PLAYER };
34-
35-
enum State : uint8_t
36-
{
37-
STATE_IDLE = 0 /* @text IDLE */,
38-
STATE_INITIATED = 1 /* @text INITIATED */,
39-
STATE_INPROGRESS = 2 /* @text INPROGRESS */,
40-
STATE_PLAYING = 3 /* @text PLAYING */,
41-
STATE_STOPPED = 4 /* @text STOPPED */,
42-
STATE_PAUSED = 5 /* @text PAUSED */
43-
};
44-
45-
enum ReasonCode : uint8_t
46-
{
47-
REASON_CODE_SUCCESS = 200 /* @text SUCCESS */,
48-
REASON_CODE_APP_REQ_TO_STOP = 201 /* @text APP_REQ_TO_STOP */,
49-
REASON_CODE_SRC_DEV_REQ_TO_STOP = 202 /* @text SRC_DEV_REQ_TO_STOP */,
50-
REASON_CODE_RTSP_ERROR = 203 /* @text RTSP_FAILURE */,
51-
REASON_CODE_RTSP_TIMEOUT = 204 /* @text RTSP_TIMEOUT */,
52-
REASON_CODE_RTSP_METHOD_NOT_SUPPORTED = 205 /* @text RTSP_NOT_SUPPORTED */,
53-
REASON_CODE_GST_ERROR = 206 /* @text GST_FAILURE */,
54-
REASON_CODE_INT_FAILURE = 207 /* @text INTERNAL_FAILURE */,
55-
REASON_CODE_NEW_SRC_DEV_CONNECT_REQ = 208 /* @text NEW_SRC_DEV_CONNECT_REQ */,
56-
};
57-
58-
enum StopReasonCode : uint16_t
59-
{
60-
STOP_REASON_APP_REQ_FOR_EXIT = 300 /* @text APP_REQ_TO_STOP_ON_EXIT */,
61-
STOP_REASON_APP_REQ_FOR_NEW_CONNECTION = 301 /* @text APP_REQ_TO_STOP_ON_NEW_CONNECTION */
62-
};
63-
64-
struct EXTERNAL DeviceParameters
65-
{
66-
string sourceDeviceIP /* @text source_dev_ip */ /* @brief IP Address of Source Device */;
67-
string sourceDeviceMac /* @text source_dev_mac */ /* @brief MAC Address of Source Device */;
68-
string sourceDeviceName /* @text source_dev_name */ /* @brief Name of Source Device */;
69-
string sinkDeviceIP /* @text sink_dev_ip */ /* @brief IP Address of Sink Device */;
70-
};
71-
72-
struct EXTERNAL VideoRectangle
73-
{
74-
int32_t startX /* @text X */ /* @brief X coordinate of the rectangle */;
75-
int32_t startY /* @text Y */ /* @brief Y coordinate of the rectangle */;
76-
int32_t width /* @text W */ /* @brief Width of the rectangle */;
77-
int32_t height /* @text H */ /* @brief Height of the rectangle */;
78-
};
79-
80-
struct EXTERNAL Result
81-
{
82-
string message /* @text message */ /* @brief reason for success or failure */;
83-
bool success;
84-
};
85-
86-
struct EXTERNAL WesterosEnvArguments
87-
{
88-
string argName /* @text argName */ /* @brief Westeros argument name */;
89-
string argValue /* @text argValue */ /* @brief Westeros argument value */;
90-
};
91-
using IWesterosEnvArgumentsIterator = RPC::IIteratorType<WesterosEnvArguments, ID_MIRACAST_PLAYER_WESTEROS_ENV_ARGS_ITERATOR>;
92-
93-
// @event
94-
struct EXTERNAL INotification : virtual public Core::IUnknown
95-
{
96-
enum { ID = ID_MIRACAST_PLAYER_NOTIFICATION };
97-
98-
// @brief Notifies when a Miracast source device wants to connect
99-
// @text onStateChange
100-
// @param clientName: Name of the client device
101-
// @param clientMac: MacAddress of the client device
102-
// @param playerState: Current state of the player (e.g., INITIATED | INPROGRESS | PLAYING | STOPPED/IDLE(Default State).)
103-
// @param reasonCode: Reason code for the player state update
104-
// @param reason: reason code Decription
105-
virtual void OnStateChange(const string &clientName /* @text name */, const string &clientMac /* @text mac */, const State &playerState /* @text state */, const string &reasonCode /* @text reason_code */, const ReasonCode &reasonDescription /* @text reason */) {};
106-
};
107-
108-
// @json:omit
109-
virtual Core::hresult Register(Exchange::IMiracastPlayer::INotification *notification) = 0;
110-
// @json:omit
111-
virtual Core::hresult Unregister(Exchange::IMiracastPlayer::INotification *notification) = 0;
112-
// @json:omit
113-
virtual Core::hresult Initialize(PluginHost::IShell* service) = 0;
114-
// @json:omit
115-
virtual Core::hresult Deinitialize(PluginHost::IShell* service) = 0;
116-
117-
// @brief To set the Miracast Player State to Play after the Miracast session like RTSP communication and GStreamer Playback
118-
// @text playRequest
119-
// @param deviceParam: Contains Source and Sink Device related properties
120-
// @param videoRect: Video rectangle to be used for Miracast playback (x, y, width, height)
121-
// @param success: Is the operation successful or not
122-
virtual Core::hresult PlayRequest(const DeviceParameters &deviceParam /* @in @text device_parameters */, const VideoRectangle &videoRect /* @in @text video_rectangle */, Result &returnPayload /* @out */) = 0;
123-
124-
// @brief To stop the Miracast Player to tear down the RTSP communication, stop/close the GStreamer pipeline, clean up, and reset the player state
125-
// @text stopRequest
126-
// @param clientMac: MacAddress of the client device
127-
// @param clientName: Name of the client device
128-
// @param reasonCode: Reason code for the player stop request
129-
// @param reason: Reason for the player stop request
130-
// @param success: Is the operation successful or not
131-
virtual Core::hresult StopRequest(const string &clientMac /* @in @text mac */, const string &clientName /* @in @text name */, const int &reasonCode /* @in @text reason_code */, Result &returnPayload /* @out */) = 0;
132-
133-
// @brief Set the Video Rectangle.
134-
// @text setVideoRectangle
135-
// @param startX: X coordinate of the rectangle
136-
// @param startY: Y coordinate of the rectangle
137-
// @param width: Width of the rectangle
138-
// @param height: Height of the rectangle
139-
// @param success: Is the operation successful or not
140-
virtual Core::hresult SetVideoRectangle(const int &startX /* @in @text X */, const int &startY /* @in @text Y */, const int &width /* @in @text W */, const int &height /* @in @text H */, Result &returnPayload /* @out */) = 0;
141-
142-
// @brief To configure the westeros environment arguments for the Miracast Player
143-
// @text setWesterosEnvironment
144-
// @param westerosArgs: Westeros environment arguments to be set
145-
// @param success: Is the operation successful or not
146-
virtual Core::hresult SetWesterosEnvironment( IWesterosEnvArgumentsIterator * const westerosArgs /* @in @text westerosArgs */, Result &returnPayload /* @out */) = 0;
147-
148-
// @brief To reset the westeros environment arguments for the Miracast Player
149-
// @text unsetWesterosEnvironment
150-
// @param success: Is the operation successful or not
151-
virtual Core::hresult UnsetWesterosEnvironment(Result &returnPayload /* @out */) = 0;
152-
};
153-
} // namespace Exchange
28+
namespace Exchange
29+
{
30+
// @json @text:keep
31+
struct EXTERNAL IMiracastPlayer : virtual public Core::IUnknown
32+
{
33+
enum { ID = ID_MIRACAST_PLAYER };
34+
35+
enum State : uint8_t
36+
{
37+
STATE_IDLE = 0 /* @text IDLE */,
38+
STATE_INITIATED = 1 /* @text INITIATED */,
39+
STATE_INPROGRESS = 2 /* @text INPROGRESS */,
40+
STATE_PLAYING = 3 /* @text PLAYING */,
41+
STATE_STOPPED = 4 /* @text STOPPED */,
42+
STATE_PAUSED = 5 /* @text PAUSED */
43+
};
44+
45+
enum ReasonCode : uint8_t
46+
{
47+
REASON_CODE_SUCCESS = 200 /* @text SUCCESS */,
48+
REASON_CODE_APP_REQ_TO_STOP = 201 /* @text APP_REQ_TO_STOP */,
49+
REASON_CODE_SRC_DEV_REQ_TO_STOP = 202 /* @text SRC_DEV_REQ_TO_STOP */,
50+
REASON_CODE_RTSP_ERROR = 203 /* @text RTSP_FAILURE */,
51+
REASON_CODE_RTSP_TIMEOUT = 204 /* @text RTSP_TIMEOUT */,
52+
REASON_CODE_RTSP_METHOD_NOT_SUPPORTED = 205 /* @text RTSP_NOT_SUPPORTED */,
53+
REASON_CODE_GST_ERROR = 206 /* @text GST_FAILURE */,
54+
REASON_CODE_INT_FAILURE = 207 /* @text INTERNAL_FAILURE */,
55+
REASON_CODE_NEW_SRC_DEV_CONNECT_REQ = 208 /* @text NEW_SRC_DEV_CONNECT_REQ */,
56+
};
57+
58+
enum StopReasonCode : uint16_t
59+
{
60+
STOP_REASON_APP_REQ_FOR_EXIT = 300 /* @text APP_REQ_TO_STOP_ON_EXIT */,
61+
STOP_REASON_APP_REQ_FOR_NEW_CONNECTION = 301 /* @text APP_REQ_TO_STOP_ON_NEW_CONNECTION */
62+
};
63+
64+
struct EXTERNAL DeviceParameters
65+
{
66+
string sourceDeviceIP /* @text source_dev_ip */ /* @brief IP Address of Source Device */;
67+
string sourceDeviceMac /* @text source_dev_mac */ /* @brief MAC Address of Source Device */;
68+
string sourceDeviceName /* @text source_dev_name */ /* @brief Name of Source Device */;
69+
string sinkDeviceIP /* @text sink_dev_ip */ /* @brief IP Address of Sink Device */;
70+
};
71+
72+
struct EXTERNAL VideoRectangle
73+
{
74+
int32_t startX /* @text X */ /* @brief X coordinate of the rectangle */;
75+
int32_t startY /* @text Y */ /* @brief Y coordinate of the rectangle */;
76+
int32_t width /* @text W */ /* @brief Width of the rectangle */;
77+
int32_t height /* @text H */ /* @brief Height of the rectangle */;
78+
};
79+
80+
struct EXTERNAL Result
81+
{
82+
string message /* @text message */ /* @brief reason for success or failure */;
83+
bool success;
84+
};
85+
86+
struct EXTERNAL EnvArguments
87+
{
88+
string argName /* @text argName */ /* @brief environment argument name */;
89+
string argValue /* @text argValue */ /* @brief environment argument value */;
90+
};
91+
using IEnvArgumentsIterator = RPC::IIteratorType<EnvArguments, ID_MIRACAST_PLAYER_ENV_ARGUMENTS_ITERATOR>;
92+
93+
// @event
94+
struct EXTERNAL INotification : virtual public Core::IUnknown
95+
{
96+
enum { ID = ID_MIRACAST_PLAYER_NOTIFICATION };
97+
98+
// @brief Notifies when a Miracast source device wants to connect
99+
// @text onStateChange
100+
// @param clientName: Name of the client device
101+
// @param clientMac: MacAddress of the client device
102+
// @param playerState: Current state of the player (e.g., INITIATED | INPROGRESS | PLAYING | STOPPED/IDLE(Default State).)
103+
// @param reasonCode: Reason code for the player state update
104+
// @param reason: reason code Decription
105+
virtual void OnStateChange(const string &clientName /* @text name */, const string &clientMac /* @text mac */, const State &playerState /* @text state */, const string &reasonCode /* @text reason_code */, const ReasonCode &reasonDescription /* @text reason */) {};
106+
};
107+
108+
// @json:omit
109+
virtual Core::hresult Register(Exchange::IMiracastPlayer::INotification *notification) = 0;
110+
// @json:omit
111+
virtual Core::hresult Unregister(Exchange::IMiracastPlayer::INotification *notification) = 0;
112+
// @json:omit
113+
virtual Core::hresult Initialize(PluginHost::IShell* service) = 0;
114+
// @json:omit
115+
virtual Core::hresult Deinitialize(PluginHost::IShell* service) = 0;
116+
117+
// @brief To set the Miracast Player State to Play after the Miracast session like RTSP communication and GStreamer Playback
118+
// @text playRequest
119+
// @param deviceParam: Contains Source and Sink Device related properties
120+
// @param videoRect: Video rectangle to be used for Miracast playback (x, y, width, height)
121+
// @param success: Is the operation successful or not
122+
virtual Core::hresult PlayRequest(const DeviceParameters &deviceParam /* @in @text device_parameters */, const VideoRectangle &videoRect /* @in @text video_rectangle */, Result &result /* @out */) = 0;
123+
124+
// @brief To stop the Miracast Player to tear down the RTSP communication, stop/close the GStreamer pipeline, clean up, and reset the player state
125+
// @text stopRequest
126+
// @param clientMac: MacAddress of the client device
127+
// @param clientName: Name of the client device
128+
// @param reasonCode: Reason code for the player stop request
129+
// @param reason: Reason for the player stop request
130+
// @param success: Is the operation successful or not
131+
virtual Core::hresult StopRequest(const string &clientMac /* @in @text mac */, const string &clientName /* @in @text name */, const int &reasonCode /* @in @text reason_code */, Result &result /* @out */) = 0;
132+
133+
// @brief Set the Video Rectangle.
134+
// @text setVideoRectangle
135+
// @param startX: X coordinate of the rectangle
136+
// @param startY: Y coordinate of the rectangle
137+
// @param width: Width of the rectangle
138+
// @param height: Height of the rectangle
139+
// @param success: Is the operation successful or not
140+
virtual Core::hresult SetVideoRectangle(const int &startX /* @in @text X */, const int &startY /* @in @text Y */, const int &width /* @in @text W */, const int &height /* @in @text H */, Result &result /* @out */) = 0;
141+
142+
// @brief To configure the westeros environment arguments for the Miracast Player. This will be deprecated and SetEnvArguments will be used instead.
143+
// @text setWesterosEnvironment
144+
// @param westerosArgs: Westeros environment arguments to be set
145+
// @param success: Is the operation successful or not
146+
virtual Core::hresult SetWesterosEnvironment( IEnvArgumentsIterator * const westerosArgs /* @in @text westerosArgs */, Result &result /* @out */) = 0;
147+
148+
// @brief To reset the westeros environment arguments for the Miracast Player. This will be deprecated and UnsetEnvArguments will be used instead.
149+
// @text unsetWesterosEnvironment
150+
// @param success: Is the operation successful or not
151+
virtual Core::hresult UnsetWesterosEnvironment(Result &result /* @out */) = 0;
152+
153+
// @brief To configure the environment arguments for the Miracast Player
154+
// @text setEnvArguments
155+
// @param envArgs: environment arguments to be set
156+
// @param success: Is the operation successful or not
157+
virtual Core::hresult SetEnvArguments( IEnvArgumentsIterator * const envArgs /* @in @text envArgs */, Result &result /* @out */) = 0;
158+
159+
// @brief To reset the environment arguments for the Miracast Player
160+
// @text unsetEnvArguments
161+
// @param success: Is the operation successful or not
162+
virtual Core::hresult UnsetEnvArguments(Result &result /* @out */) = 0;
163+
};
164+
} // namespace Exchange
154165
} // namespace WPEFramework

0 commit comments

Comments
 (0)