-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdsVideoDevice.h
489 lines (448 loc) · 19.2 KB
/
dsVideoDevice.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2016 RDK Management
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup HPK Hardware Porting Kit
* @{
* @par The Hardware Porting Kit
* HPK is the next evolution of the well-defined Hardware Abstraction Layer
* (HAL), but augmented with more comprehensive documentation and test suites
* that OEM or SOC vendors can use to self-certify their ports before taking
* them to RDKM for validation or to an operator for final integration and
* deployment. The Hardware Porting Kit effectively enables an OEM and/or SOC
* vendor to self-certify their own Video Accelerator devices, with minimal RDKM
* assistance.
*
*/
/**
* @defgroup Device_Settings Device Settings Module
* @{
*/
/**
* @defgroup Device_Settings_HAL Device Settings HAL
* Describe the details about Device Settings HAL function specifications.
*
* <b> Following abbreviations present in HAL function </b>
*
* @par Abbreviations
* - cb: Callback function (suffix).
* - DS: Device Settings.
* - HAL: Hardware Abstraction Layer.
* - FPS: Frames Per Second.
* - FRF: Frame Rate Frequency
* - HDR: High Dynamic Range
*
* @{
*/
/**
* @defgroup dsVIDEODEVICE_HAL DS Video Device HAL
* @{
* @par Application API Specification
* Described herein are the DeviceSettings HAL types and functions that are part of
* the Video Device subsystem. The Video Device subsystem manages system-specific HAL operations.
*
*/
/**
* @defgroup DS_VIDEODEVICE_API DS HAL Video Device Public APIs
* @par Application API Specification
* dsVideoDevice HAL provides an interface for managing the VideoDevice settings for the device settings module
*
* @{
*/
/**
* @file dsVideoDevice.h
*/
#ifndef __DS_VIDEO_DEVICE_H__
#define __DS_VIDEO_DEVICE_H__
#include <stdbool.h>
#include "dsError.h"
#include "dsVideoDeviceTypes.h"
#include "dsAVDTypes.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Initializes all the video devices in the system
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_ALREADY_INITIALIZED - Function is already initialized.
* @retval dsERR_GENERAL - Underlying undefined platform error
*
* @warning This function is Not thread safe.
*
* @post dsVideoDeviceTerm() must be called to release resources.
*
* @see dsVideoDeviceTerm()
*
*
*/
dsError_t dsVideoDeviceInit();
/**
* @brief Gets the handle for the video device requested
*
* @note Index is always 0, due to devices only having a single video device
*
* @param[in] index - Index of video device. Max number is device specific. Min of 0
* @param[out] handle - The handle used by the Caller to uniquely identify the HAL instance
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_NOT_INITIALIZED - Module is not initialized
* @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
* @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
* @retval dsERR_GENERAL - Underlying undefined platform error
*
* @pre dsVideoDeviceInit() must be called before calling this function
*
* @warning This function is Not thread safe.
*
*
*/
dsError_t dsGetVideoDevice(int index, intptr_t *handle);
/**
* @brief Sets the screen zoom mode (decoder format conversion)
*
* For source devices, this function establishes the zoom mode settings according to the available zoom options for specified video device.
* For sink devices, this function returns dsERR_OPERATION_NOT_SUPPORTED always.
*
* @param[in] handle - The handle returned from the dsGetVideoDevice() function
* @param[in] dfc - Type of zoom mode to be used. Please refer ::dsVideoZoom_t
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_NOT_INITIALIZED - Module is not initialized
* @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
* @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
* @retval dsERR_GENERAL - Underlying undefined platform error
*
* @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function
*
* @warning This function is Not thread safe.
*
* @see dsGetDFC()
*
*/
dsError_t dsSetDFC(intptr_t handle, dsVideoZoom_t dfc);
/**
* @brief Gets the screen zoom mode (decoder format conversion)
*
* For source devices, this function gets the zoom mode settings for specified video device.
* For sink devices, this function returns dsERR_OPERATION_NOT_SUPPORTED always.
*
* @param[in] handle - The handle returned from the dsGetVideoDevice() function
* @param[out] dfc - Type of zoom mode being used. Please refer ::dsVideoZoom_t
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_NOT_INITIALIZED - Module is not initialized
* @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
* @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
* @retval dsERR_GENERAL - Underlying undefined platform error
*
* @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
*
* @warning This function is Not thread safe.
*
* @see dsSetDFC()
*
*/
dsError_t dsGetDFC(intptr_t handle, dsVideoZoom_t *dfc);
/**
* @brief De-initializes all the video devices in the system
*
* This function reset any data structures used within this module and
* release any handles specific to the video devices.
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_NOT_INITIALIZED - Module is not initialized
* @retval dsERR_GENERAL - General failure
*
* @pre dsVideoDeviceInit() must be called before calling this function.
*
* @warning This function is Not thread safe.
*
* @see dsVideoDeviceInit()
*
*/
dsError_t dsVideoDeviceTerm();
/**
* @brief Gets the HDR capabilities
*
* For sink devices, this function returns the HDR Capabilities of TV
* For source devices, this function returns the HDR Capabilities of STB
*
* @param[in] handle - The handle returned from the dsGetVideoDevice() function
* @param[out] capabilities - OR-ed values of all supported HDR standards. Please refer ::dsHDRStandard_t,
* dsHDRStandard_t is currently in the audioVisual combined file.
*
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_NOT_INITIALIZED - Module is not initialized
* @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
* @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
* @retval dsERR_GENERAL - Underlying undefined platform error
*
* @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
*
* @warning This function is Not thread safe.
*
*/
dsError_t dsGetHDRCapabilities(intptr_t handle, int *capabilities);
/**
* @brief Gets the video formats supported
*
* @param[in] handle - The handle returned from the dsGetVideoDevice() function
* @param[out] supported_formats - OR-ed values of all the supported video codec formats.
* Please refer ::dsVideoCodingFormat_t
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_NOT_INITIALIZED - Module is not initialized
* @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
* @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
* @retval dsERR_GENERAL - Underlying undefined platform error
*
* @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
*
* @warning This function is Not thread safe.
*
*/
dsError_t dsGetSupportedVideoCodingFormats(intptr_t handle, unsigned int * supported_formats);
/**
* @brief Gets the video codec information of the provided coding format.
*
* For source devices, this function returns the supported codec profile and levels for the input coding format.
* For sink devices, this function returns dsERR_OPERATION_NOT_SUPPORTED always.
*
* @param[in] handle - The handle returned from the dsGetVideoDevice() function
* @param[in] codec - OR-ed value of supported video codec formats. Please refer ::dsVideoCodingFormat_t.
* @param[out] info - Structure containing Video codec information. Please refer ::dsVideoCodecInfo_t
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_NOT_INITIALIZED - Module is not initialized
* @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
* @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
* @retval dsERR_GENERAL - Underlying undefined platform error
*
* @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
*
* @warning This function is Not thread safe.
*
*/
dsError_t dsGetVideoCodecInfo(intptr_t handle, dsVideoCodingFormat_t codec, dsVideoCodecInfo_t * info);
/**
* @brief Disables, forcefully the HDR support of the device
*
* This function returns dsERR_OPERATION_NOT_SUPPORTED for both source and sink devices.
*
* @param[in] handle - The handle returned from the dsGetVideoDevice() function
* @param[in] disable - Boolean value to force disable HDR or not.
* True to force disable, false to remove force disable
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_NOT_INITIALIZED - Module is not initialized
* @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
* @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
* @retval dsERR_GENERAL - Underlying undefined platform error
*
* @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
*
* @warning This function is Not thread safe.
*
*/
dsError_t dsForceDisableHDRSupport(intptr_t handle, bool disable);
/**
* @brief Sets the FRF mode of the device
*
* For sink devices, this function sets the Frame Rate Mode for the video device.
* For source devices, this function returns dsERR_OPERATION_NOT_SUPPORTED always.
*
* @param[in] handle - The handle returned from the dsGetVideoDevice() function
* @param[in] frfmode - integer value to enable/disable Auto Framerate mode.
* 1 to enable auto framerate mode, 0 to disable auto framerate mode
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_NOT_INITIALIZED - Module is not initialised
* @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
* @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
* @retval dsERR_GENERAL - Underlying undefined platform error
*
* @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
*
* @warning This function is Not thread safe.
*
* @see dsGetFRFMode()
*
*/
dsError_t dsSetFRFMode(intptr_t handle, int frfmode);
/**
* @brief Gets the FRF mode of the device
*
* For sink devices, this function returns the Frame Rate Mode of the video device.
* For source devices, this function returns dsERR_OPERATION_NOT_SUPPORTED always.
*
* @param[in] handle - The handle returned from the dsGetVideoDevice() function
* @param[out] frfmode - integer value corresponding to Auto Framerate mode of the device.
* 1 if auto framerate mode is enabled, 0 if auto framerate mode is disabled
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_NOT_INITIALIZED - Module is not initialized
* @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
* @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
* @retval dsERR_GENERAL - Underlying undefined platform error
*
* @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
*
* @warning This function is Not thread safe.
*
* @see dsSetFRFMode()
*
*/
dsError_t dsGetFRFMode(intptr_t handle, int *frfmode);
/**
* @brief Gets the current panel refresh rate of the device
*
* For sink devices, this function returns the current panel refresh rate of the device.
* For source devices, this function returns dsERR_OPERATION_NOT_SUPPORTED always.
*
* @param[in] handle - The handle returned from the dsGetVideoDevice() function
* @param[out] framerate - Current Panel Refresh Rate will be represented.
* Returns the value as a string(eg:"3840x2160px48")
*
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_NOT_INITIALIZED - Module is not initialized
* @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
* @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
* @retval dsERR_GENERAL - Underlying undefined platform error
*
* @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function.
*
* @warning This function is Not thread safe.
*
* @see dsSetDisplayframerate()
*
*/
dsError_t dsGetCurrentDisplayframerate(intptr_t handle, char *framerate);
/**
* @brief Sets the panel refresh rate for the device
*
* For sink devices, this function sets the panel refresh rate for the device.
* For source devices, this function returns dsERR_OPERATION_NOT_SUPPORTED always.
*
* @param[in] handle - The handle returned from the dsGetVideoDevice() function
* @param[in] framerate - Panel Refresh Rate value to be set which is platform-specific.
* Expects the value as a string(eg:"3840x2160px48").
* aaaaxbbbbxyy (aaaaxbbbb - Panel Resolution, yy - Panel Refresh Rate)
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_NOT_INITIALIZED - Module is not initialized
* @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
* @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
* @retval dsERR_GENERAL - Underlying undefined platform error
*
* @pre dsVideoDeviceInit() and dsGetVideoDevice() must be called before calling this function
*
* @warning This function is Not thread safe.
*
* @see dsGetCurrentDisplayframerate()
*
*/
dsError_t dsSetDisplayframerate(intptr_t handle, char *framerate);
/**
* @brief Call back function to receive the framerate pre change event from the HAL side.
* @param [in] tSecond - time(in Seconds) during which the framerate will change.
*
* @pre dsVideoDeviceInit(), dsRegisterFrameratePreChangeCB() must be called before calling this function.
*
*/
typedef void (*dsRegisterFrameratePreChangeCB_t)(unsigned int tSecond);
/**
* @brief This function is used to register the callback function for the Display framerate pre change event.
*
* For sink devices, this function registers a callback for Display framerate pre change event.
* For source devices, this function returns dsERR_OPERATION_NOT_SUPPORTED always.
*
* @param[in] CBFunc - Function callback to register for the event.
* See dsRegisterFrameratePreChangeCB_t.
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_NOT_INITIALIZED - Module is not initialised
* @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
* @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
* @retval dsERR_GENERAL - Underlying undefined platform error
*
* @pre dsVideoDeviceInit() must be called before calling this function.
* @post dsRegisterFrameratePreChangeCB_t callback must be called after calling this function.
*
* @warning This function is Not thread safe.
*
*/
dsError_t dsRegisterFrameratePreChangeCB(dsRegisterFrameratePreChangeCB_t CBFunc);
/**
* @brief Call back function to receive the framerate post change event.
* @param [in] tSecond - time elapsed(in Seconds) after framerate change.
*
* @pre dsVideoDeviceInit(), dsRegisterFrameratePostChangeCB() must be called before calling this function.
*
*
*/
typedef void (*dsRegisterFrameratePostChangeCB_t)(unsigned int tSecond);
/**
* @brief This function is used to register a callback function for the Display framerate
* post change event from the HAL side.
*
* For sink devices, this function registers a callback for Display framerate post change event.
* For source devices, this function returns dsERR_OPERATION_NOT_SUPPORTED always.
*
* @param[in] CBFunc - Function to register for the event.
* See dsRegisterFrameratePostChangeCB_t.
*
* @return dsError_t - Status
* @retval dsERR_NONE - Success
* @retval dsERR_NOT_INITIALIZED - Module is not initialised
* @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
* @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
* @retval dsERR_GENERAL - Underlying undefined platform error
*
* @pre dsVideoDeviceInit() must be called before calling this function.
* @post dsRegisterFrameratePostChangeCB_t callback must be called after calling this function.
*
* @warning This function is Not thread safe.
*
*/
dsError_t dsRegisterFrameratePostChangeCB(dsRegisterFrameratePostChangeCB_t CBFunc);
#ifdef __cplusplus
}
#endif
#endif /* __DS_VIDEO_DEVICE_H__ */
/** @} */ // End of DSHAL_VIDEODEVICE_APIs
/** @} */ // End of DS Video Device HAL
/** @} */ // End of Device Settings HAL
/** @} */ // End of Device Settings Module
/** @} */ // End of HPK