30 #include <sys/types.h>
41 #include "dsclientlogger.h"
43 #include "safec_lib.h"
47 printf(
"<<<<< VOP is initialized in Multi-App Mode >>>>>>>>\r\n");
49 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
52 (
char *)IARM_BUS_DSMGR_API_dsVideoPortInit,
56 if (IARM_RESULT_SUCCESS == rpcRet)
77 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
80 (
char *)IARM_BUS_DSMGR_API_dsGetVideoPort,
84 printf(
"%s..%d-%d\n",__func__,param.type,param.handle);
86 if (IARM_RESULT_SUCCESS == rpcRet)
88 *handle = param.handle;
104 param.handle = handle;
105 param.enabled =
false;
109 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
112 (
char *)IARM_BUS_DSMGR_API_dsIsHDCPEnabled,
116 if (IARM_RESULT_SUCCESS == rpcRet)
118 *enabled = param.enabled;
133 param.handle = handle;
134 param.enabled =
false;
138 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
141 (
char *)IARM_BUS_DSMGR_API_dsIsVideoPortEnabled,
145 if (IARM_RESULT_SUCCESS == rpcRet)
147 *enabled = param.enabled;
160 param.handle = handle;
163 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
165 (
char *)IARM_BUS_DSMGR_API_dsGetHDCPStatus,
168 if (IARM_RESULT_SUCCESS == rpcRet)
170 *status = param.hdcpStatus;
183 param.handle = handle;
186 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
188 (
char *)IARM_BUS_DSMGR_API_dsGetHDCPProtocol,
191 if (IARM_RESULT_SUCCESS == rpcRet)
193 *version = param.protocolVersion;
206 param.handle = handle;
209 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
211 (
char *)IARM_BUS_DSMGR_API_dsGetHDCPReceiverProtocol,
214 if (IARM_RESULT_SUCCESS == rpcRet)
216 *version = param.protocolVersion;
229 param.handle = handle;
232 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
234 (
char *)IARM_BUS_DSMGR_API_dsGetHDCPCurrentProtocol,
237 if (IARM_RESULT_SUCCESS == rpcRet)
239 *version = param.protocolVersion;
252 param.handle = handle;
253 param.connected =
false;
255 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
260 (
char *)IARM_BUS_DSMGR_API_dsIsDisplayConnected,
264 if (IARM_RESULT_SUCCESS == rpcRet)
266 *connected = param.connected;
280 param.handle = handle;
281 param.surround =
false;
283 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
288 (
char *)IARM_BUS_DSMGR_API_dsIsDisplaySurround,
292 if (IARM_RESULT_SUCCESS == rpcRet)
294 *surround = param.surround;
308 param.handle = handle;
309 param.surround = dsSURROUNDMODE_NONE;
311 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
316 (
char *)IARM_BUS_DSMGR_API_dsGetSurroundMode,
320 if (IARM_RESULT_SUCCESS == rpcRet)
322 *surround = param.surround;
333 param.handle = handle;
334 param.enabled = enabled;
337 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
340 (
char *)IARM_BUS_DSMGR_API_dsEnableVideoPort,
344 if (IARM_RESULT_SUCCESS == rpcRet)
360 param.handle = handle;
361 param.toPersist =
false;
362 param.resolution = *resolution;
364 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
367 (
char *)IARM_BUS_DSMGR_API_dsGetResolution,
371 *resolution = param.resolution;
373 if (IARM_RESULT_SUCCESS == rpcRet)
383 if ((value_str == NULL) || (parameter_str == NULL))
390 memset(¶m, 0,
sizeof(param));
391 param.handle = handle;
393 strncpy(param.param_bytes, parameter_str, DSSCART_PARAM_LEN_MAX -1);
394 strncpy(param.value_bytes, value_str, DSSCART_VALUE_LEN_MAX - 1);
395 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
397 (
char *)IARM_BUS_DSMGR_API_dsSetScartParameter,
401 if ((IARM_RESULT_SUCCESS == rpcRet) && (
dsERR_NONE == param.result))
416 param.handle = handle;
417 param.toPersist = persist;
418 param.forceCompatible =
true;
419 param.resolution = *resolution;
421 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
424 (
char *)IARM_BUS_DSMGR_API_dsSetResolution,
428 if (IARM_RESULT_SUCCESS == rpcRet && (
dsERR_NONE == param.result))
443 param.handle = handle;
444 param.toPersist = persist;
445 param.colorDepth = *colorDepth;
447 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
450 (
char *)IARM_BUS_DSMGR_API_dsGetPreferredColorDepth,
454 *colorDepth = param.colorDepth;
456 if (IARM_RESULT_SUCCESS == rpcRet)
469 param.handle = handle;
470 param.toPersist = persist;
471 param.colorDepth = colorDepth;
473 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
476 (
char *)IARM_BUS_DSMGR_API_dsSetPreferredColorDepth,
480 if (IARM_RESULT_SUCCESS == rpcRet && (
dsERR_NONE == param.result))
493 memset(¶m, 0,
sizeof(param));
494 param.handle = handle;
497 (
char *) IARM_BUS_DSMGR_API_dsColorDepthCapabilities,
501 if (IARM_RESULT_SUCCESS == rpcRet)
503 *capabilities = param.colorDepthCapability;
515 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
518 (
char *)IARM_BUS_DSMGR_API_dsVideoPortTerm,
522 if (IARM_RESULT_SUCCESS == rpcRet)
547 memset(¶m, 0,
sizeof(param));
548 param.handle = handle;
549 param.contentProtect = contentProtect;
550 param.keySize = keySize;
554 rc = memcpy_s(param.hdcpKey,
sizeof(param.hdcpKey), hdcpKey, keySize);
561 printf(
"IARM:CLI:dsEnableHDCP %d, %p, %d\r\n", contentProtect, hdcpKey, keySize);
563 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
565 (
char *)IARM_BUS_DSMGR_API_dsEnableHDCP,
569 if( (IARM_RESULT_SUCCESS == rpcRet) && (
dsERR_NONE == param.rpcResult))
585 param.handle = handle;
586 param.active =
false;
590 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
592 (
char *)IARM_BUS_DSMGR_API_dsIsVideoPortActive,
596 if (IARM_RESULT_SUCCESS == rpcRet)
598 *active = param.active;
610 memset(¶m, 0,
sizeof(param));
611 param.handle = handle;
614 (
char *) IARM_BUS_DSMGR_API_dsGetTVHDRCapabilities,
618 if (IARM_RESULT_SUCCESS == rpcRet)
620 *capabilities = param.capabilities;
632 memset(¶m, 0,
sizeof(param));
633 param.handle = handle;
636 (
char *) IARM_BUS_DSMGR_API_dsGetSupportedTVResolution,
640 if (IARM_RESULT_SUCCESS == rpcRet)
642 *resolutions = param.resolutions;
649 dsError_t dsSetForceDisable4KSupport(intptr_t handle,
bool disable)
654 memset(¶m, 0,
sizeof(param));
655 param.handle = handle;
656 param.disable = disable;
659 (
char *) IARM_BUS_DSMGR_API_dsSetForceDisable4K,
663 if (IARM_RESULT_SUCCESS == rpcRet)
671 dsError_t dsGetForceDisable4KSupport(intptr_t handle,
bool *disable)
676 memset(¶m, 0,
sizeof(param));
677 param.handle = handle;
680 (
char *) IARM_BUS_DSMGR_API_dsGetForceDisable4K,
684 if (IARM_RESULT_SUCCESS == rpcRet)
686 *disable = param.disable;
701 param.handle = handle;
706 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
708 (
char *)IARM_BUS_DSMGR_API_dsIsOutputHDR,
712 if (IARM_RESULT_SUCCESS == rpcRet)
727 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
729 (
char *)IARM_BUS_DSMGR_API_dsResetOutputToSDR,
733 if (IARM_RESULT_SUCCESS != rpcRet)
749 param.handle = handle;
750 param.hdcpCurrentProtocol = *hdcpProtocol;
754 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
756 (
char *)IARM_BUS_DSMGR_API_dsSetHdmiPreference,
760 if (IARM_RESULT_SUCCESS == rpcRet)
776 param.handle = handle;
781 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
783 (
char *)IARM_BUS_DSMGR_API_dsGetHdmiPreference,
787 if (IARM_RESULT_SUCCESS == rpcRet)
789 *hdcpProtocol = param.hdcpCurrentProtocol;
800 if (video_eotf == NULL) {
806 memset(¶m, 0,
sizeof(param));
807 param.handle = handle;
810 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
812 (
char *)IARM_BUS_DSMGR_API_dsGetVideoEOTF,
816 if( (IARM_RESULT_SUCCESS == rpcRet) && (
dsERR_NONE == param.result))
818 *video_eotf = param.video_eotf;
829 if (matrix_coefficients == NULL) {
835 memset(¶m, 0,
sizeof(param));
836 param.handle = handle;
839 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
841 (
char *)IARM_BUS_DSMGR_API_dsGetMatrixCoefficients,
845 if( (IARM_RESULT_SUCCESS == rpcRet) && (
dsERR_NONE == param.result))
847 *matrix_coefficients = param.matrix_coefficients;
858 if (color_depth == NULL) {
864 memset(¶m, 0,
sizeof(param));
865 param.handle = handle;
868 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
870 (
char *)IARM_BUS_DSMGR_API_dsGetColorDepth,
874 if( (IARM_RESULT_SUCCESS == rpcRet) && (
dsERR_NONE == param.result))
876 *color_depth = param.color_depth;
887 if (color_space == NULL) {
893 memset(¶m, 0,
sizeof(param));
894 param.handle = handle;
897 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
899 (
char *)IARM_BUS_DSMGR_API_dsGetColorSpace,
903 if( (IARM_RESULT_SUCCESS == rpcRet) && (
dsERR_NONE == param.result))
905 *color_space = param.color_space;
916 if (quantization_range == NULL) {
922 memset(¶m, 0,
sizeof(param));
923 param.handle = handle;
926 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
928 (
char *)IARM_BUS_DSMGR_API_dsGetQuantizationRange,
932 if( (IARM_RESULT_SUCCESS == rpcRet) && (
dsERR_NONE == param.result))
934 *quantization_range = param.quantization_range;
945 if (video_eotf == NULL || matrix_coefficients == NULL || color_space == NULL || color_depth == NULL || quantization_range == NULL) {
951 memset(¶m, 0,
sizeof(param));
952 param.handle = handle;
955 IARM_Result_t rpcRet = IARM_RESULT_SUCCESS;
957 (
char *)IARM_BUS_DSMGR_API_dsGetCurrentOutputSettings,
961 if( (IARM_RESULT_SUCCESS == rpcRet) && (
dsERR_NONE == param.result))
963 *video_eotf = param.video_eotf;
964 *matrix_coefficients = param.matrix_coefficients;
965 *color_space = param.color_space;
966 *color_depth = param.color_depth;
967 *quantization_range = param.quantization_range;
979 memset(¶m, 0,
sizeof(param));
980 param.handle = handle;
981 param.hdrMode = mode;
984 (
char *) IARM_BUS_DSMGR_API_dsSetForceHDRMode,
988 if (IARM_RESULT_SUCCESS == rpcRet)