30 #include "ccDataReader.h"
43 namespace subtecConnector
47 const auto registerResult = vlhal_cc_Register(0, CCDataController::Instance(), closedCaptionDataCb, closedCaptionDecodeCb);
48 logprintf(
"vlhal_cc_Register return value = %d\n", registerResult);
50 if(registerResult != 0)
51 return CC_VL_OS_API_RESULT_FAILED;
53 const auto startResult = media_closeCaptionStart(
nullptr);
54 logprintf(
"media_closeCaptionStart return value = %d\n", registerResult);
57 return CC_VL_OS_API_RESULT_FAILED;
59 return CC_VL_OS_API_RESULT_SUCCESS;
62 mrcc_Error initPacketSender()
64 const auto packetSenderStartResult = ClosedCaptionsChannel::InitComms();
65 logprintf(
"CCDataController::Instance()->InitComms() return value = %d\n", (
int)packetSenderStartResult);
67 if(!packetSenderStartResult)
68 return CC_VL_OS_API_RESULT_FAILED;
70 return CC_VL_OS_API_RESULT_SUCCESS;
74 CCDataController::Instance()->sendResetChannelPacket();
79 media_closeCaptionStop();
86 typedef int mrcc_Error;
88 mrcc_Error ccShow(
void)
90 CCDataController::Instance()->sendUnmute();
94 mrcc_Error ccHide(
void)
96 CCDataController::Instance()->sendMute();
102 CCDataController::Instance()->sendCCSetAttribute(attrib, type, ccType);
106 mrcc_Error ccSetDigitalChannel(
unsigned int channel)
108 CCDataController::Instance()->ccSetDigitalChannel(channel);
112 mrcc_Error ccSetAnalogChannel(
unsigned int channel)
114 CCDataController::Instance()->ccSetAnalogChannel(channel);
120 CCDataController::Instance()->ccGetAttributes(attrib, ccType);
129 return CC_VL_OS_API_RESULT_FAILED;
138 case GSW_CC_ATTRIB_FONT_COLOR :
139 case GSW_CC_ATTRIB_BACKGROUND_COLOR:
140 case GSW_CC_ATTRIB_BORDER_COLOR:
141 case GSW_CC_ATTRIB_WIN_COLOR:
142 case GSW_CC_ATTRIB_EDGE_COLOR:
144 *size =
sizeof(CCSupportedColors_strings)/
sizeof(
char *);
145 const char** pValuesNames = CCSupportedColors_strings;
147 *size =
sizeof(CCSupportedColors)/
sizeof(
unsigned long);
148 const unsigned long * pValues = CCSupportedColors;
151 for(i = 0; i < *size; i++)
154 strncpy(((
gsw_CcColor*)values[i])->name, pValuesNames[i],
155 GSW_MAX_CC_COLOR_NAME_LENGTH);
160 logprintf(
"ccGetCapability invoked with not supported attribType = 0x%x\n", (
int)attribType);
161 return CC_VL_OS_API_RESULT_FAILED;
164 return CC_VL_OS_API_RESULT_SUCCESS;