index 4c5c673c71f82f9c30a0fe528568cd1125ff1591..0baa780745d74900fa7c9b7d8492257687985afb 100644 (file)
#define IODATA_SYNC_THD 0x16
#define IODATA_MIN_NUM_ZEROS_BEFORE_PA 2
-#define IODATA_PREAMBLE_MAX_LEN 8 // TBD
+#define IODATA_PREAMBLE_MAX_LEN 16 // TBD
#define IODATA_HEADER_LENGTH_IEC 4
#define IODATA_HEADER_CHECK_LENGTH_IEC 2 // For IEC, only look at 2 words to check SYNC.
case IODATA_CTL_GET_AUTODET_STATUS:
ioDataCtl->param.autoDetStats.syncState = pIoDataInst->autoDet.syncState;
ioDataCtl->param.autoDetStats.deliverZeros = pIoDataInst->deliverZeros;
- ioDataCtl->param.autoDetStats.bitStreamInfo = pIoDataInst->autoDet.bitStreamInfo;
+ ioDataCtl->param.autoDetStats.streamInfo.IEC_PC = pIoDataInst->autoDet.bitStreamInfo & IODATA_SYNC_PC_MASK;
+ ioDataCtl->param.autoDetStats.streamInfo.frameLength = pIoDataInst->autoDet.frameLength;
+ ioDataCtl->param.autoDetStats.streamInfo.dataLength = pIoDataInst->autoDet.frameLength
+ - pIoDataInst->autoDet.headerLength;
ioDataCtl->param.autoDetStats.syncTimeOut = pIoDataInst->syncTimeOut;
break;
/*
/* Check if a full frame has been received and if so, check if SYNC is maintained */
if(pIoDataInst->autoDet.completeFrameRcvd) {
if(pIoDataInst->autoDet.syncDetected) {
+ pIoDataInst->dbgStats.numFramesRcvd += 1;
pIoDataInst->autoDet.syncState = IODATA_SYNC_BITSTREAM;
pIoDataInst->autoDet.completeFrameRcvd = FALSE;
// Store the beginning address of data in current frame (not including the preamble)
pIoDataInst->autoDet.frameDataStartConfirm = pIoDataInst->autoDet.frameDataStartTemp;
- pIoDataInst->dbgStats.numFramesRcvd += 1;
// re-initialize for SYNC check
syncCheckInit(pIoDataInst);
uint_least16_t pc = pIoDataInst->autoDet.bitStreamInfo & IODATA_SYNC_PC_MASK;
pIoDataInst->autoDet.frameLength = pIoDataInst->IECframeLengths[pc];
+
+ if (pc == 1) {
+ pIoDataInst->autoDet.frameLength = 4288;
+ }
+ else if (pc == IODATA_SYNC_SUBTYPE_DTSHD) {
+ int DTSHDSubType = (pIoDataInst->autoDet.bitStreamInfo & IODATA_SYNC_SUBTYPE_MASK)
+ >> IODATA_SYNC_SUBTYPE_SHIFT;
+ pIoDataInst->autoDet.frameLength = pIoDataInst->IECframeLengths[pc] << DTSHDSubType;
+ }
+
pIoDataInst->autoDet.distToFrameEnd = pIoDataInst->autoDet.frameLength
- pIoDataInst->autoDet.numElementsRcvd;
//pDevExt->headerSize = IEC_HEADER_SIZE;
pDet->preambleRef[3] = tail; /* save this word for sync check */
pDet->headerLength = IODATA_HEADER_LENGTH_IEC;
+ if( (pDet->bitStreamInfo & 0x1F) == 0x11) { // DTSHD subtype
+ pDet->headerLength += 6;
+ }
pDet->headerCheckLen = IODATA_HEADER_CHECK_LENGTH_IEC;
scanState = SCANNED_IEC_PD;