Device Settings HAL 0.2.0
 
Loading...
Searching...
No Matches
dsVideoDevice.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 * @defgroup Device_Settings Device Settings Module
36 * @{
37 */
38
39/**
40 * @defgroup Device_Settings_HAL Device Settings HAL
41 * Describe the details about Device Settings HAL function specifications.
42 *
43 * <b> Following abbreviations present in HAL function </b>
44 *
45 * @par Abbreviations
46 * - cb: Callback function (suffix).
47 * - DS: Device Settings.
48 * - HAL: Hardware Abstraction Layer.
49 * - FPS: Frames Per Second.
50 * - FRF: Frame Rate Frequency
51 * - HDR: High Dynamic Range
52 *
53 * @{
54 */
55
56/**
57 * @defgroup dsVIDEODEVICE_HAL DS Video Device HAL
58 * @{
59 * @par Application API Specification
60 * Described herein are the DeviceSettings HAL types and functions that are part of
61 * the Video Device subsystem. The Video Device subsystem manages system-specific HAL operations.
62 *
63 */
64
65/**
66 * @defgroup DS_VIDEODEVICE_API DS HAL Video Device Public APIs
67 * @par Application API Specification
68 * dsVideoDevice HAL provides an interface for managing the VideoDevice settings for the device settings module
69 *
70 * @{
71 */
72
73/**
74 * @file dsVideoDevice.h
75 */
76
77#ifndef _DS_VIDEODEVICE_H_
78#define _DS_VIDEODEVICE_H_
79
80#include <sys/types.h>
81#include "dsError.h"
82#include "dsTypes.h"
83
84#ifdef __cplusplus
85extern "C" {
86#endif
87
88/**
89 * @brief Initializes all the video devices in the system
90 *
91 * @return dsError_t - Status
92 * @retval dsERR_NONE - Success
93 * @retval dsERR_GENERAL - Underlying undefined platform error
94 *
95 * @warning This function is Not thread safe.
96 * @see dsVideoDeviceTerm()
97 *
98 *
99 */
101
102/**
103 * @brief Gets the handle for the video device requested
104 *
105 * @note Index is always 0, due to devices only having a single video device
106 *
107 * @param[in] index - Index of video device. Max number is device specific. Min of 0
108 * @param[out] handle - The handle used by the Caller to uniquely identify the HAL instance
109 *
110 * @return dsError_t - Status
111 * @retval dsERR_NONE - Success
112 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
113 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
114 * @retval dsERR_GENERAL - Underlying undefined platform error
115 *
116 * @pre dsVideoDeviceInit() must be called before calling this function
117 *
118 * @warning This function is Not thread safe.
119*
120 *
121 */
122dsError_t dsGetVideoDevice(int index, intptr_t *handle);
123
124/**
125 * @brief Sets the screen zoom mode (decoder format conversion)
126 *
127 * @param[in] handle - The handle returned from the dsGetVideoDevice() function
128 * @param[in] dfc - Type of zoom mode to be used. Please refer ::dsVideoZoom_t
129 *
130 * @return dsError_t - Status
131 * @retval dsERR_NONE - Success
132 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
133 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
134 * @retval dsERR_GENERAL - Underlying undefined platform error
135 *
136 * @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function
137 *
138 * @warning This function is Not thread safe.
139 *
140 * @see dsGetDFC()
141 *
142 */
143dsError_t dsSetDFC(intptr_t handle, dsVideoZoom_t dfc);
144
145/**
146 * @brief Gets the screen zoom mode (decoder format conversion)
147 *
148 * @param[in] handle - The handle returned from the dsGetVideoDevice() function
149 * @param[out] dfc - Type of zoom mode being used. Please refer ::dsVideoZoom_t
150 *
151 * @return dsError_t - Status
152 * @retval dsERR_NONE - Success
153 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
154 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
155 * @retval dsERR_GENERAL - Underlying undefined platform error
156 *
157 * @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
158 *
159 * @warning This function is Not thread safe.
160 *
161 * @see dsSetDFC()
162 *
163 */
164dsError_t dsGetDFC(intptr_t handle, dsVideoZoom_t *dfc);
165
166/**
167 * @brief De-initializes all the video devices in the system
168 *
169 * This function reset any data structures used within this module and
170 * release any handles specific to the video devices.
171 *
172 * @return dsError_t - Status
173 * @retval dsERR_NONE - Success
174 * @retval dsERR_GENERAL - General failure
175 *
176 * @pre dsVideoDeviceInit() must be called before calling this function.
177 *
178 * @warning This function is Not thread safe.
179 *
180 * @see dsVideoDeviceInit()
181 *
182 */
184
185/**
186 * @brief Gets the HDR capabilities
187 *
188 * @param[in] handle - The handle returned from the dsGetVideoDevice() function
189 * @param[out] capabilities - OR-ed values of all supported HDR standards. Please refer ::dsHDRStandard_t,
190 * dsHDRStandard_t is currently in the audioVisual combined file.
191 *
192 *
193 * @return dsError_t - Status
194 * @retval dsERR_NONE - Success
195 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
196 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
197 * @retval dsERR_GENERAL - Underlying undefined platform error
198 *
199 * @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
200 *
201 * @warning This function is Not thread safe.
202 *
203 */
204dsError_t dsGetHDRCapabilities(intptr_t handle, int *capabilities);
205
206/**
207 * @brief Gets the video formats supported
208 *
209 * @param[in] handle - The handle returned from the dsGetVideoDevice() function
210 * @param[out] supported_formats - OR-ed values of all the supported video codec formats.
211 * Please refer ::dsVideoCodingFormat_t
212 *
213 * @return dsError_t - Status
214 * @retval dsERR_NONE - Success
215 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
216 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
217 * @retval dsERR_GENERAL - Underlying undefined platform error
218 *
219 * @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
220 *
221 * @warning This function is Not thread safe.
222 *
223 */
224dsError_t dsGetSupportedVideoCodingFormats(intptr_t handle, unsigned int * supported_formats);
225
226/**
227 * @brief Gets the video codec information
228 *
229 * @param[in] handle - The handle returned from the dsGetVideoDevice() function
230 * @param[in] codec - OR-ed value of supported video codec formats. Please refer ::dsVideoCodingFormat_t.
231 * @param[out] info - Structure containing Video codec information. Please refer ::dsVideoCodecInfo_t
232 *
233 * @return dsError_t - Status
234 * @retval dsERR_NONE - Success
235 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
236 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
237 * @retval dsERR_GENERAL - Underlying undefined platform error
238 *
239 * @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
240 *
241 * @warning This function is Not thread safe.
242 *
243 */
245
246/**
247 * @brief Disables, forcefully the HDR support of the device
248 *
249 * @param[in] handle - The handle returned from the dsGetVideoDevice() function
250 * @param[in] disable - Boolean value to force disable HDR or not.
251 * True to force disable, false to remove force disable
252 *
253 * @return dsError_t - Status
254 * @retval dsERR_NONE - Success
255 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
256 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
257 * @retval dsERR_GENERAL - Underlying undefined platform error
258 *
259 * @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
260 *
261 * @warning This function is Not thread safe.
262 *
263 */
264dsError_t dsForceDisableHDRSupport(intptr_t handle, bool disable);
265
266/**
267 * @brief Sets the FRF mode of the device
268 *
269 * @param[in] handle - The handle returned from the dsGetVideoDevice() function
270 * @param[in] frfmode - integer with corresponding Framerate value.
271 * Please refer ::dsVideoFrameRate_t for max and min framerate.
272 *
273 * @return dsError_t - Status
274 * @retval dsERR_NONE - Success
275 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
276 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
277 * @retval dsERR_GENERAL - Underlying undefined platform error
278 *
279 * @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
280 *
281 * @warning This function is Not thread safe.
282 *
283 * @see dsGetFRFMode()
284 *
285 */
286dsError_t dsSetFRFMode(intptr_t handle, int frfmode);
287
288/**
289 * @brief Gets the FRF mode of the device
290 *
291 * @param[in] handle - The handle returned from the dsGetVideoDevice() function
292 * @param[out] frfmode - integer with corresponding Framerate value of the device.
293 * Please refer :: dsVideoFrameRate_t for max and min framerate.
294 *
295 * @return dsError_t - Status
296 * @retval dsERR_NONE - Success
297 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
298 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
299 * @retval dsERR_GENERAL - Underlying undefined platform error
300 *
301 * @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
302 *
303 * @warning This function is Not thread safe.
304 *
305 * @see dsSetFRFMode()
306 *
307 */
308dsError_t dsGetFRFMode(intptr_t handle, int *frfmode);
309
310/**
311 * @brief Gets the current framerate of the device
312 *
313 * @param[in] handle - The handle returned from the dsGetVideoDevice() function
314 * @param[out] framerate - Current frame rate will be represented in FPS
315 * Please refer ::dsVideoFrameRate_t for max and min framerate.
316 * Updates the value as a string(eg:"60").
317 *
318 * @return dsError_t - Status
319 * @retval dsERR_NONE - Success
320 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
321 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
322 * @retval dsERR_GENERAL - Underlying undefined platform error
323 *
324 * @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
325 *
326 * @warning This function is Not thread safe.
327 *
328 * @see dsSetDisplayframerate()
329 *
330 */
331dsError_t dsGetCurrentDisplayframerate(intptr_t handle, char *framerate);
332
333/**
334 * @brief Sets the display framerate for the device
335 *
336 * @param[in] handle - The handle returned from the dsGetVideoDevice() function
337 * @param[in] framerate - Framerate value to be set frame will be represented in FPS.
338 * Please refer ::dsVideoFrameRate_t for max and min framerate.
339 * Expects the value as a string(eg:"60").
340 *
341 * @return dsError_t - Status
342 * @retval dsERR_NONE - Success
343 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
344 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
345 * @retval dsERR_GENERAL - Underlying undefined platform error
346 *
347 * @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function
348 *
349 * @warning This function is Not thread safe.
350 *
351 * @see dsGetCurrentDisplayframerate()
352 *
353 */
354dsError_t dsSetDisplayframerate(intptr_t handle, char *framerate);
355
356/**
357 * @brief Call back function to receive the framerate change event form the HAL side.
358 * @param [in] tSecond time elapsed after the change. Time in seconds.
359 *
360 * @pre dsVideoDeviceInit(), dsRegisterFrameratePreChangeCB() must be called before calling this function.
361 *
362 */
363typedef void (*dsRegisterFrameratePreChangeCB_t)(unsigned int tSecond);
364
365/**
366 * @brief This function is used to register the callback function for the Display framerate pre change event.
367 *
368 * @param[in] CBFunc - Function callback to register for the event.
369 * See dsRegisterFrameratePreChangeCB_t.
370 *
371 * @return dsError_t - Status
372 * @retval dsERR_NONE - Success
373 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
374 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
375 * @retval dsERR_GENERAL - Underlying undefined platform error
376 *
377 * @pre dsVideoDeviceInit() must be called before calling this function.
378 * @post dsRegisterFrameratePreChangeCB_t callback must be called after calling this function.
379 *
380 * @warning This function is Not thread safe.
381 *
382 */
384
385/**
386 * @brief Call back function to receive the framerate change is event.
387 * @param [in] tSecond time elapsed after the change.
388 *
389 * @pre dsVideoDeviceInit(), dsRegisterFrameratePostChangeCB() must be called before calling this function.
390 *
391 *
392 */
393typedef void (*dsRegisterFrameratePostChangeCB_t)(unsigned int tSecond);
394
395/**
396 * @brief This function is used to register a callback function for the Display framerate
397 * post change event from the HAL side.
398 *
399 * @param[in] CBFunc - Function to register for the event.
400 * See dsRegisterFrameratePostChangeCB_t.
401 *
402 * @return dsError_t - Status
403 * @retval dsERR_NONE - Success
404 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
405 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
406 * @retval dsERR_GENERAL - Underlying undefined platform error
407 *
408 * @pre dsVideoDeviceInit() must be called before calling this function.
409 * @post dsRegisterFrameratePostChangeCB_t callback must be called after calling this function.
410 *
411 * @warning This function is Not thread safe.
412 *
413 */
415
416#ifdef __cplusplus
417}
418#endif
419#endif /* _DS_VIDEODEVICE_H_ */
420
421/** @} */ // End of DSHAL_VIDEODEVICE_APIs
422/** @} */ // End of DS Video Device HAL
423/** @} */ // End of Device Settings HAL
424/** @} */ // End of Device Settings Module
425/** @} */ // End of HPK
Device Settings HAL error codes.
HAL types.
dsError_t dsVideoDeviceTerm()
De-initializes all the video devices in the system.
dsError_t dsGetCurrentDisplayframerate(intptr_t handle, char *framerate)
Gets the current framerate of the device.
dsError_t dsSetDFC(intptr_t handle, dsVideoZoom_t dfc)
Sets the screen zoom mode (decoder format conversion)
dsError_t dsGetHDRCapabilities(intptr_t handle, int *capabilities)
Gets the HDR capabilities.
dsError_t dsGetFRFMode(intptr_t handle, int *frfmode)
Gets the FRF mode of the device.
dsError_t dsRegisterFrameratePostChangeCB(dsRegisterFrameratePostChangeCB_t CBFunc)
This function is used to register a callback function for the Display framerate post change event fro...
dsError_t dsGetSupportedVideoCodingFormats(intptr_t handle, unsigned int *supported_formats)
Gets the video formats supported.
dsError_t dsGetVideoDevice(int index, intptr_t *handle)
Gets the handle for the video device requested.
dsError_t dsGetDFC(intptr_t handle, dsVideoZoom_t *dfc)
Gets the screen zoom mode (decoder format conversion)
dsError_t dsRegisterFrameratePreChangeCB(dsRegisterFrameratePreChangeCB_t CBFunc)
This function is used to register the callback function for the Display framerate pre change event.
dsError_t dsSetFRFMode(intptr_t handle, int frfmode)
Sets the FRF mode of the device.
dsError_t dsVideoDeviceInit()
Initializes all the video devices in the system.
dsError_t dsSetDisplayframerate(intptr_t handle, char *framerate)
Sets the display framerate for the device.
dsError_t dsForceDisableHDRSupport(intptr_t handle, bool disable)
Disables, forcefully the HDR support of the device.
void(* dsRegisterFrameratePostChangeCB_t)(unsigned int tSecond)
Call back function to receive the framerate change is event.
Definition dsVideoDevice.h:393
dsError_t dsGetVideoCodecInfo(intptr_t handle, dsVideoCodingFormat_t codec, dsVideoCodecInfo_t *info)
Gets the video codec information.
void(* dsRegisterFrameratePreChangeCB_t)(unsigned int tSecond)
Call back function to receive the framerate change event form the HAL side.
Definition dsVideoDevice.h:363
dsError_t
Device Settings API Error return codes.
Definition dsError.h:100
dsVideoCodingFormat_t
List of video compression formats that may be supported by the decoder.
Definition dsTypes.h:1044
enum _dsVideoZoom_t dsVideoZoom_t
This enumeration defines all of the standard screen zoom (format conversion) modes.
Structure type for Video codec info.
Definition dsTypes.h:1074