⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plm_private.h

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 H
字号:
/**********************************************************************************
 *  Copyright (c) 2002 ZORAN Corporation, All Rights Reserved
 *  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
 *
 *  File: $Workfile: plm_private.h $             
 *
 * Description: 
 * ============
 * Playback Mode handler internal definitions.
 * 
 * Log:
 * ====
 * $Revision: $
 * Last Modified by $Author: $ at $Modtime: $ 
 **********************************************************************************
 * Updates:
 **********************************************************************************
 * $Log: $
 * 
 * 
 *********************************************************************************/
#include "Config.h"		/* Global Configuration - do not remove! */


#ifndef PLM_PRIVATE_H
#define PLM_PRIVATE_H


/*** Include Files ***************************************************************/
#include "Include\SysDefs.h"
#include "Drive\Zfe\zfe.h"
#include "Drive\Zfe\Disc\Plm\plm.h"
#include "Drive\Zfe\Disc\Reader\reader.h"
#include "Drive\Zfe\Shared\Dsp\DrcParams\DrcParamsAPI.h"


/*** Defines *********************************************************************/

/* PFI */
#define PLM_PFI_SIZE_IN_BYTES				18	/* 18 bytes of PFI information */

/* TOC */
#define PLM_TOC_ITEMS_FIFO_DEPTH			2

/* DVD */
#ifdef DRV_EDC_ERRORS_HANDLING
#define PLM_EDC_ERRORS_HANDLING_TABLE_SIZE	5
#endif

#ifdef BE_FE_ERRORS_HANDLING
#define PLM_BE_FE_ERRORS_TABLE_SIZE			30	/* each entry hold 16 sectors errors indications */
#endif


/*** Typedefs ********************************************************************/
typedef void (* PLM_ERROR_HANDLER_T)(PLM_ERROR_TYPE, UINT16, UINT32, int);


/* DVD */
typedef struct
{
	UINT32 currPsn;
	UINT32 currAddr;
	UINT8  currCount;

	UINT8  sacdHybrid;

	UINT8  pfiInfo[PLM_PFI_SIZE_IN_BYTES];
	UINT8  pfiInfoValid[PLM_PFI_SIZE_IN_BYTES];

	UINT32 startPhysicalPsn;
	UINT32 lastPhysicalPsnOfLayer0;
	UINT32 lastPhysicalPsn;

	UINT8  watchdogTimer;
	UINT32 mediaIdentificationTime;
	BOOL firstSector;

} PLM_DVD_PFI_MNGR_ST;


#ifdef DRV_EDC_ERRORS_HANDLING
typedef struct
{
	UINT8 head;
	UINT8 tail;
	BOOL empty;
	BOOL full;
	UINT32 table[PLM_EDC_ERRORS_HANDLING_TABLE_SIZE];
} PLM_EDC_ERRORS_HANDLING_ST;
#endif


typedef struct
{
#ifdef DRV_EDC_ERRORS_HANDLING
	PLM_EDC_ERRORS_HANDLING_ST edcErrorsHandler;
#endif
#ifdef DRV_DVD_DEFECT_HANDLING
	DVD_DRC_PARAMS_ET dvdDefectStrategy;
	UINT8 dvdDefectShort2LongThreshold;
	UINT8 dvdDefectLong2ShortThreshold;
#endif	
	UINT32 startPhysicalPsn;
	UINT32 lastPhysicalPsnOfLayer0;
	UINT32 lastPhysicalPsn;
#ifdef DRV_DVDRW_WHITE_DOT_HANDLING
	BOOL   whiteDotDetection;
	UINT8  nPlaybacks;
#endif
} PLM_DVD_PLAYBACK_MNGR_ST;


typedef struct 
{
	PLM_DVD_PFI_MNGR_ST pfi;
	PLM_DVD_PLAYBACK_MNGR_ST playback;
} PLM_DVD_MNGR_ST;


/* CD */
typedef struct
{
	UINT8 fifoFront;
	UINT8 fifoRear;
	BOOL fifoEmpty;
	BOOL fifoFull;
	TOC_ITEM_EXP fifoData[PLM_TOC_ITEMS_FIFO_DEPTH];

	/* mode1 information */
	UINT8 firstTrack;
	UINT8 firstTrackValid;
	UINT8 lastTrack;
	UINT8 lastTrackValid;
	UINT8 totalNumOfTracks;
	UINT8 numOfValidTracks;

	/* mode5 information */
	BOOL multisessionDisc;
	BOOL firstLeadin;
	UINT8 firstLeadinValid;
	UINT8 nextPaValid;
	UINT8 lastLeadoutValid;
	UINT32 currentStartPsn; 
	UINT32 currentEndPsn;
	UINT32 nextPaStartPsn;
	UINT32 lastLeadoutStartPsn;
	READER_REQUEST_ET readerRequest;
	UINT8 firstTrackInLastSession;

	UINT8 unexpectedSectorErrorTh;
	UINT32 mediaIdentificationTime;
	UINT8 watchdogTimer;
	BOOL firstItemArrived;

} PLM_CD_TOC_MNGR_ST;


typedef struct
{
	UINT32 sectionAddr;
	UINT8 titlesCnt;
	UINT8 maxTitles;

	UINT8 watchdogTimer;
	BOOL firstInfoArrived;
	UINT8 unexpectedSectorErrorTh;

} PLM_CD_CDTEXT_MNGR_ST;


typedef enum
{
	PLM_CD_ECC_NO_STRATEGY_E,
	PLM_CD_ECC_DEFAULT_STRATEGY_E,
	PLM_CD_ECC_DEFECT_1_STRATEGY_E,
	PLM_CD_ECC_DEFECT_2_STRATEGY_E,
	PLM_CD_ECC_JITTER_1_STRATEGY_E,
	PLM_CD_ECC_JITTER_2_STRATEGY_E,
	PLM_CD_ECC_NUM_OF_ERROR_STRATEGIES_E
} PLM_CD_ECC_ERROR_STRATEGY_ET;


typedef struct 
{
	UINT8 numOfTracks;
	UINT8 firstTrackInLastSession;
	UINT8 currSessionDataTrack;
	UINT32 leadOutAddress;
	BOOL multisessionDisc;

	int	sectionSectorOffset;
	BOOL sectionSectorValid;
	UINT8 cddaSearchMode;

	PLM_CD_ECC_ERROR_STRATEGY_ET currentCdErrStrategy;
	UINT16 eccAllowedErrorsThreshold;
	UINT16 eccNoDefectCntr;
	UINT16 eccDefectCntr;
	UINT8 defectLength;

} PLM_CD_PLAYBACK_MNGR_ST;


typedef struct 
{
	PLM_CD_TOC_MNGR_ST toc;
#ifdef CDTEXT_SUPPORT
	PLM_CD_CDTEXT_MNGR_ST cdtext;
#endif
	PLM_CD_PLAYBACK_MNGR_ST playback;
} PLM_CD_MNGR_ST;


/* General */
typedef enum
{
	PLM_IDLE_E,
	PLM_BEFORE_START_SECTOR_E,
	PLM_BEFORE_END_SECTOR_E,
	PLM_AFTER_END_SECTOR_E,
	PLM_AFTER_END_SECTOR_IN_ECC_E,
	PLM_AFTER_END_SECTOR_IN_EDC_E = PLM_AFTER_END_SECTOR_IN_ECC_E
} PLM_STATE_ET;


typedef enum
{
	PLM_ERROR_SOURCE_STP_E,
	PLM_ERROR_SOURCE_ECC_E,
	PLM_ERROR_SOURCE_EDC_E,
	PLM_ERROR_SOURCE_NUM_SOURCES_E
} PLM_ERROR_SOURCE_ET;


typedef enum
{
	PLM_PENDING_REQUEST_NONE,
	PLM_PENDING_REQUEST_CACHED,
	PLM_PENDING_REQUEST_SENT
} PLM_PENDING_REQUEST_ET;


typedef struct
{
	UINT32 psn;
	UINT8 retryCnt;
} PLM_ERROR_RETRY_TABLE_ENTRY_ST;


#ifdef BE_FE_ERRORS_HANDLING
typedef struct
{
	UINT32 psn;
	UINT16 errors;
} PLM_BE_FE_ERRORS_ENTRY_ST;


typedef struct
{
	UINT8 tblHead;
	UINT8 tblTail;
	PLM_BE_FE_ERRORS_ENTRY_ST errorsTbl[PLM_BE_FE_ERRORS_TABLE_SIZE];
} PLM_BE_FE_ERRORS_ST;
#endif


typedef struct
{
	/* Current playback state (idle, before start, during playback, after end) */
	PLM_STATE_ET plmState;
	/* Current error handler routine */
	PLM_ERROR_HANDLER_T errorHandler;
#ifdef BE_FE_ERRORS_HANDLING
	/* BE-FE errors handling */
	PLM_BE_FE_ERRORS_ST beFeErrorsHandler;
#endif
	/* Current STP error PSN */
	UINT32 errorPsn;
	/* Timer handler */
	UINT8 timeoutTimer;	
	/* Count the number of retries on the same PSN from a given source */ 
	PLM_ERROR_RETRY_TABLE_ENTRY_ST retryTable[PLM_ERROR_SOURCE_NUM_SOURCES_E]; 
	/* A callback to the high level in case of errors */
	DRV_CORE_CB callBack;
	
	/* Is there a pending request */
	PLM_PENDING_REQUEST_ET pendingRequest;
	/* Expected sector type & bitstream type for pending request */
	UINT16 nextExpectedBts;
 	/* Expected bitstream type for current request */
	PLM_BITSTREAM_TYPE_ST expectedBts;
	/* Start PSN of pennding playback */
	UINT32 nextStartPsn;																	
	/* End PSN of pending playback */
	UINT32 nextEndPsn;			
	/* Start PSN as requested by high level (before alignment additions) */
	UINT32 orgStartPsn;
	/* End PSN as requested by high level (before alignment additions) */
	UINT32 orgEndPsn;
	/* Start PSN of current playback */
	UINT32 currStartPsn;				
	/* End PSN of current playback */
	UINT32 currEndPsn;					
	/* Start PSN of previous playback */
	UINT32 prevStartPsn;				
	/* End PSN of previous playback */
	UINT32 prevEndPsn;					
 	/* Serial number of playback .Aid to check if errors are from current playback or previous one */
	UINT8 playNumber;
	/* Managers for DVD, CD, PFI, TOC and CDTEXT playbacks */
	union
	{
		PLM_DVD_MNGR_ST dvd;
		PLM_CD_MNGR_ST cd;
	} mngr;

} PLM_MNGR_ST;


/*** Private Functions ***********************************************************/
void PLM_Abort(BOOL critical);
void PLM_IncPlayNum(void);

void PLM_ErrorsHandling(PLM_ERROR_TYPE err_type, UINT8 * remain_retries);
#if (defined(_DEBUG) && defined(DEBUG_FE_TRACE))
void PLM_PrintErrorInfo(PLM_ERROR_TYPE err_type, UINT32 org_err_psn, UINT8 skip, UINT16 info);
#endif

void PLM_ReaderCb(READER_EVENT_ET event, UINT16 param1, UINT16 param2);


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -