Device Settings HAL 0.2.0
 
Loading...
Searching...
No Matches
dsCompositeIn.h
Go to the documentation of this file.
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 2016 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/**
21 * @addtogroup HPK Hardware Porting Kit
22 * @{
23 * @par The Hardware Porting Kit
24 * HPK is the next evolution of the well-defined Hardware Abstraction Layer
25 * (HAL), but augmented with more comprehensive documentation and test suites
26 * that OEM or SOC vendors can use to self-certify their ports before taking
27 * them to RDKM for validation or to an operator for final integration and
28 * deployment. The Hardware Porting Kit effectively enables an OEM and/or SOC
29 * vendor to self-certify their own Video Accelerator devices, with minimal RDKM
30 * assistance.
31 *
32 */
33
34/**
35 * @addtogroup Device_Settings Device Settings Module
36 * @{
37 */
38
39/**
40 * @addtogroup Device_Settings_HAL Device Settings HAL
41 * @par Application API Specification
42 * Described herein are the DeviceSettings HAL types and functions that are part of
43 * the CompositeIn subsystem. The CompositeIn subsystem manages system-specific HAL operations.
44 * @{
45 */
46
47/**
48* @defgroup dsCompositeIn_HAL DS CompositeIn HAL
49 * @{
50 * @par Application API Specification
51 * dsCompositeIn HAL provides an interface for managing the CompositeIn settings for the device settings module
52 */
53
54/**
55 * @defgroup DSHAL_COMPOSITE_IN_API DS HAL Composite Input Public APIs
56 * @{
57 */
58
59/**
60 * @file dsCompositeIn.h
61 *
62 * @brief Device Settings HAL COMPOSITE Input Public API.
63 * This API defines the HAL for the Device Settings COMPOSITE Input interface.
64 *
65 * @par Document
66 * Document reference.
67 *
68 * @par Open Issues (in no particular order)
69 * -# None
70 *
71 * @par Assumptions
72 * -# None
73 *
74 * @par Abbreviations
75 * - BE: Big-Endian.
76 * - cb: Callback function (suffix).
77 * - DS: Device Settings.
78 * - FPD: Front-Panel Display.
79 * - HAL: Hardware Abstraction Layer.
80 * - LE: Little-Endian.
81 * - LS: Least Significant.
82 * - MBZ: Must be zero.
83 * - MS: Most Significant.
84 * - RDK: Reference Design Kit.
85 * - _t: Type (suffix).
86 *
87 * @par Implementation Notes
88 * -# None
89 *
90 */
91
92#ifndef _DS_dsCompositeInH_
93#define _DS_dsCompositeInH_
94
95#include <sys/types.h>
96#include "dsError.h"
97#include "dsTypes.h"
98
99#ifdef __cplusplus
100extern "C" {
101#endif
102
103/**
104 * @brief Initializes the underlying COMPOSITE Input sub-system.
105 *
106 * This function must initialize the COMPOSITE Input module and any associated data
107 * structures.
108 *
109 * @return dsError_t - Status
110 * @retval dsERR_NONE - Success
111 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported; e.g: source devices
112 * @retval dsERR_GENERAL - Underlying undefined platform error
113 *
114 * @warning This API is Not thread safe.
115 *
116 * @see dsCompositeInTerm()
117 */
119
120/**
121 * @brief Terminates the underlying COMPOSITE Input sub-system.
122 *
123 * This function must terminate the COMPOSITE Input module and any associated data
124 * structures.
125 *
126 * @return dsError_t - Status
127 * @retval dsERR_NONE - Success
128 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported; e.g: source devices
129 * @retval dsERR_GENERAL - Underlying undefined platform error
130 *
131 * @warning This API is Not thread safe.
132 *
133 * @pre dsCompositeInInit() should be called before calling this API.
134 *
135 * @see dsCompositeInInit()
136 */
137
139
140/**
141 * @brief Gets the number of COMPOSITE Input ports on the specific platform.
142 *
143 * This function is used to get the number of COMPOSITE Input ports on the specific platform.
144 *
145 * @param[out] pNumberOfInputs - number of COMPOSITE Input ports. Min 0. Max please refer ::dsCompositeInPort_t
146 *
147 * @return dsError_t - Status
148 * @retval dsERR_NONE - Success
149 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
150 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported; e.g: source devices
151 * @retval dsERR_GENERAL - Underlying undefined platform error
152 *
153 * @warning This API is Not thread safe.
154 *
155 * @pre dsCompositeInInit() should be called before calling this API.
156 */
157
158dsError_t dsCompositeInGetNumberOfInputs (uint8_t *pNumberOfInputs);
159
160/**
161 * @brief Gets the COMPOSITE Input Status.
162 *
163 * This function is used to get the status of all COMPOSITE Input Status.
164 *
165 * @param [out] pStatus - status of compositeIn ports. Please refer ::dsCompositeInStatus_t
166 *
167 * @return dsError_t - Status
168 * @retval dsERR_NONE - Success
169 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
170 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported; e.g: source devices
171 * @retval dsERR_GENERAL - Underlying undefined platform error
172 *
173 * @warning This API is Not thread safe.
174 *
175 * @pre dsCompositeInInit() should be called before calling this API.
176 */
178
179/**
180 * @brief Sets the COMPOSITE Input port as active available for presentation.
181 *
182 * This function is used to set the COMPOSITE Input port for presentation.
183 *
184 * @param[in] Port - COMPOSITE Input port to be presented. Please refer ::dsCompositeInPort_t
185 *
186 * @return dsError_t - Status
187 * @retval dsERR_NONE - Success
188 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid(port is not present or index is out of range)
189 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported; e.g: source devices
190 * @retval dsERR_GENERAL - Underlying undefined platform error
191 *
192 * @warning This API is Not thread safe.
193 *
194 * @note When a port is selected that port should be set as activePort in ::dsCompositeInStatus_t.
195 * Also, if there is a signal (ie isPortConnected[that port ID] is true), once active, isPresented should be set to true as well.
196 *
197 * @pre dsCompositeInInit() should be called before calling this API.
198 */
200
201/**
202 * @brief Scales the COMPOSITE In video
203 * This function scales the COMPOSITE input video. The width and height, based on the x, y coordinates,
204 * cannot exceed that of the current resolution of the device.
205 * e.g. x(in pixels)+width cannot be greater then the width of the resolution.
206 *
207 * @param[in] x - x coordinate for the video. Min of 0. Max is based on the current resolution
208 * @param[in] y - y coordinate for the video. Min of 0. Max is based on the current resolution
209 * @param[in] width - width of the video. Min of 0. Max is based on the current resolution
210 * @param[in] height - height of the video. Min of 0. Max is based on the current resolution
211 *
212 * @return dsError_t - Status
213 * @retval dsERR_NONE - Success
214 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
215 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported; e.g: source devices
216 * @retval dsERR_GENERAL - Underlying undefined platform error
217 *
218 * @warning This API is Not thread safe.
219 *
220 * @pre dsCompositeInInit(), dsCompositeInSelectPort() should be called before calling this API.
221 */
222
223dsError_t dsCompositeInScaleVideo (int32_t x, int32_t y, int32_t width, int32_t height);
224
225/**
226 * @brief Callback function used to notify applications of COMPOSITE In hot plug status
227 *
228 * HAL Implementation should call this method to deliver COMPOSITE In hot plug status
229 * to the application (e.g. Connect/Disconnect for Port 0/1).
230 *
231 * @param[in] Port - COMPOSITE Input port. Please refer ::dsCompositeInPort_t
232 * @param[in] isPortConnected - Connection state of COMPOSITE In Port. @a true if connected, @a false if not
233 *
234 * @return None.
235 *
236 * @pre dsCompositeInRegisterConnectCB() should be called before calling this API.
237 *
238 * @note This should update isPortConnected in ::dsCompositeInStatus_t when this callback is triggered.
239 * If this port is currently active and presents video after being connected, isPresented should also be updated
240 *
241 * @see dsCompositeInRegisterConnectCB()
242 */
243typedef void (*dsCompositeInConnectCB_t)(dsCompositeInPort_t Port, bool isPortConnected);
244
245/**
246 * @brief Registers the COMPOSITE Input hot plug event.
247 *
248 * This function is used to register for the COMPOSITE Input hot plug event.
249 *
250 * @param[in] CBFunc - COMPOSITE Input hot plug callback function. Please refer ::dsCompositeInConnectCB_t
251 *
252 * @return dsError_t - Status
253 * @retval dsERR_NONE - Success
254 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
255 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported; e.g: source devices
256 * @retval dsERR_GENERAL - Underlying undefined platform error
257 *
258 * @warning This API is Not thread safe.
259 *
260 * @pre dsCompositeInInit() should be called before calling this API.
261 *
262 * @see dsCompositeInConnectCB_t()
263 */
265
266/**
267 * @brief Callback function used to notify applications of Composite In signal change status
268 *
269 * HAL Implementation should call this method to deliver Composite In signal change status
270 * to the application (e.g. NoSignal/UnstableSignal/NotSupportedSignal/StableSignal for Composite In ports).
271 *
272 * @param[in] port - Composite Input port. Please refer ::dsCompositeInPort_t
273 * @param[in] sigStatus - signal Status of Composite In Port. Please refer ::dsCompInSignalStatus_t
274 *
275 * @return None.
276 *
277 * @pre dsCompositeInRegisterSignalChangeCB() should be called before calling this API.
278 *
279 * @see dsCompositeInRegisterSignalChangeCB()
280 */
282
283/**
284 * @brief Registers the Composite Input Signal Change event.
285 *
286 * This function is used to register for the Composite Input Signal Change event.
287 *
288 * @param[in] CBFunc - Composite Input Signal change callback function. Please refer ::dsCompositeInSignalChangeCB_t
289 *
290 * @return dsError_t - Status
291 * @retval dsERR_NONE - Success
292 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
293 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported; e.g: source devices
294 * @retval dsERR_GENERAL - Underlying undefined platform error
295 *
296 * @warning This API is Not thread safe.
297 *
298 * @pre dsCompositeInInit() should be called before calling this API.
299 *
300 * @see dsCompositeInSignalChangeCB_t()
301 */
303
304/**
305 * @brief Callback function used to notify applications of Composite Input status change event.
306 *
307 * HAL Implementation should call this method to deliver Composite Input status
308 * to the application (e.g. port, isPresented(true/false) etc. for Composite In ports).
309 *
310 * @param[in] inputStatus - Composite Input status of a specific Port. Please refer ::dsCompositeInStatus_t
311 *
312 * @return None.
313 *
314 * @pre dsCompositeInRegisterStatusChangeCB() should be called before calling this API.
315 *
316 * @see dsCompositeInRegisterStatusChangeCB()
317 *
318 * @note This callback should be triggered whenever dsCompositeInStatus_t is updated. Please refer ::dsCompositeInSelectPort(), ::dsCompositeInConnectCB_t()
319 */
321
322/**
323 * @brief Registers the Composite Input Status Change event.
324 *
325 * This function is used to register for the Composite Input Status Change event.
326 *
327 * @param[in] CBFunc - Composite Input Status change callback function. Please refer ::dsCompositeInStatusChangeCB_t
328 *
329 *
330 * @return dsError_t - Status
331 * @retval dsERR_NONE - Success
332 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
333 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported; e.g: source devices
334 * @retval dsERR_GENERAL - Underlying undefined platform error
335 *
336 * @warning This API is Not thread safe.
337 *
338 * @pre dsCompositeInInit() should be called before calling this API.
339 *
340 * @see dsCompositeInStatusChangeCB_t()
341 */
342
344
345#ifdef __cplusplus
346}
347#endif
348#endif /* _DS_dsCompositeInH_ */
349
350/** @} */ // End of DS HAL Composite Input Public APIs
351/** @} */ // End of DS CompositeIn HAL
352/** @} */ // End of Device Settings HAL
353/** @} */ // End of Device Settings Module
354/** @} */ // End of HPK
Device Settings HAL error codes.
HAL types.
dsError_t dsCompositeInInit(void)
Initializes the underlying COMPOSITE Input sub-system.
void(* dsCompositeInConnectCB_t)(dsCompositeInPort_t Port, bool isPortConnected)
Callback function used to notify applications of COMPOSITE In hot plug status.
Definition dsCompositeIn.h:243
void(* dsCompositeInStatusChangeCB_t)(dsCompositeInStatus_t inputStatus)
Callback function used to notify applications of Composite Input status change event.
Definition dsCompositeIn.h:320
dsError_t dsCompositeInRegisterStatusChangeCB(dsCompositeInStatusChangeCB_t CBFunc)
Registers the Composite Input Status Change event.
dsError_t dsCompositeInRegisterConnectCB(dsCompositeInConnectCB_t CBFunc)
Registers the COMPOSITE Input hot plug event.
dsError_t dsCompositeInSelectPort(dsCompositeInPort_t Port)
Sets the COMPOSITE Input port as active available for presentation.
dsError_t dsCompositeInTerm(void)
Terminates the underlying COMPOSITE Input sub-system.
dsError_t dsCompositeInScaleVideo(int32_t x, int32_t y, int32_t width, int32_t height)
Scales the COMPOSITE In video This function scales the COMPOSITE input video. The width and height,...
dsError_t dsCompositeInGetStatus(dsCompositeInStatus_t *pStatus)
Gets the COMPOSITE Input Status.
void(* dsCompositeInSignalChangeCB_t)(dsCompositeInPort_t port, dsCompInSignalStatus_t sigStatus)
Callback function used to notify applications of Composite In signal change status.
Definition dsCompositeIn.h:281
dsError_t dsCompositeInRegisterSignalChangeCB(dsCompositeInSignalChangeCB_t CBFunc)
Registers the Composite Input Signal Change event.
dsError_t dsCompositeInGetNumberOfInputs(uint8_t *pNumberOfInputs)
Gets the number of COMPOSITE Input ports on the specific platform.
dsError_t
Device Settings API Error return codes.
Definition dsError.h:100
enum _dsCompositeInPort_t dsCompositeInPort_t
This enumeration defines the type of composite ports.
enum _dsCompInSignalStatus_t dsCompInSignalStatus_t
This enumeration defines the type composite signal status.
Structure type for Composite input status.
Definition dsTypes.h:1033