/*************************************************************************** * Copyright (c) 2002, Broadcom Corporation * All Rights Reserved * Confidential Property of Broadcom Corporation * * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. * * $brcm_Workfile: bcmDccTransport.h $ * $brcm_Revision: \main\SanJose_MSTV_Devel\1 $ * $brcm_Date: 3/12/02 4:46p $ * * Module Description: * * Revision History: * * $brcm_Log: $ * * \main\SanJose_MSTV_Devel\1 3/12/02 4:46p erikg * Merge from SanJose_MSTV_Devel_erikg_mpegccxport2_2002_03_06_1118_38 * * \main\SanJose_MSTV_Devel_erikg_mpegccxport2_2002_03_06_1118_38\1 3/6/02 11:29a erikg * new include files * ***************************************************************************/ #ifndef BCMDCCTRANSPORT_H #define BCMDCCTRANSPORT_H #ifdef __cplusplus extern "C" { #endif /********************** * * INCLUDES * **********************/ #include "bcmDcc.h" #include "bcmDccTransportMux.h" /********************** * * DEFINES * **********************/ /* * DCC_TYPE_XXX * * These are bitmasks used for DccTransport_QueryDetectedFormats */ #define DCC_TYPE_DVS157 1 #define DCC_TYPE_A53_608 2 #define DCC_TYPE_A53_DTVCC 4 #define DCC_TYPE_UNKNOWN 8 /* * Field Indicator, used for DccTransport_Process */ #define DCC_608_FIELD_TOP 1 #define DCC_608_FIELD_BOTTOM 2 /********************** * * TYPES * **********************/ /******************************************** * * Enum: DCC_CC608_TYPE * * Description: * * DCC_CC608_TYPE enumerates how the function * DccTransport_Process is to choose which * type of 608 to output. * ********************************************/ typedef enum tagDCC_CC608_TYPE { CC608_A53 = 0, /* A53 only */ CC608_DVS157 = 1, /* DVS157 only */ CC608_A53Preferred = 2 /* A53 if present, else DVS157 */ } DCC_CC608_TYPE ; /******************************************** * * Structure: DCC_TRANSPORT_OBJECT * * Description: * * The DCC_TRANSPORT_OBJECT structure holds the * state for an MPEG Picture User Data parsing * session. * ********************************************/ typedef struct tagDCC_TRANSPORT_OBJECT { /* * CC608Type * * The CC608Type enum specifies * which type of 608 is to be output * when DccTransport_Process is called. */ DCC_CC608_TYPE CC608Type ; /* * CC608TypeStorage * * CC608TypeStorage is the state necessary * for keeping track of which type of 608 * CC data is present in a stream. */ DCC_CC608_MUX_STATE CC608MuxState ; } DCC_TRANSPORT_OBJECT ; /********************** * * FUNCTIONS * **********************/ /************************************************************************** * * Function: DccTransport_Init * * Inputs: * pObj - object to init * OutputType - defines which 608 CC type to output * * Outputs: * pObj - object state is modified * * Returns: dccSuccess or a standard DCCERR error code * * Description: * * This function initializes an MPEG CC transport session. * **************************************************************************/ DCCERR DccTransport_Init( DCC_TRANSPORT_OBJECT * pObj, DCC_CC608_TYPE OutputType) ; /************************************************************************** * * Function: DccTransport_Fini * * Inputs: * pObj - object, previously init'ed * * Outputs: * * * Returns: dccSuccess or a standard DCCERR error code * * Description: * * This function undoes the initialization done by DccTransport_Init. * **************************************************************************/ DCCERR DccTransport_Fini(DCC_TRANSPORT_OBJECT * pObj) ; /************************************************************************** * * Function: DccTransport_Process * * Inputs: * pObj - object, previously init'ed * pInputBuf - input buffer, holds 1/more User Data * InputBufSize - size in bytes of input buffer * ulPicInfo - picture info from bcmMPIReadCCStatus * * Outputs: * p608BufInfo - describes output buf for 608, or NULL * pDTVCCBufInfo - describes output buf for DTVCC, or NULL * * Returns: dccSuccess or a standard DCCERR error code * * Description: * * Reads the input buffer and copies CC data to the output buffer(s). This * function parses the looking for DTVCC Closed Captioning data or the type * of 608 CC data specified in the DccTransport_Init function. This function * scans up to InputBufSize bytes of the pInputBuf buffer. The parsing logic * looks for Picture User Data start_codes, namely, the byte sequence 00 00 01 B2. * * If multiple Picture User Data areas are found, each will be processed in order, * and the CC bytes extracted from each will be copied to the output buffer(s). If * DTVCC Closed Captioning data is found and if pDTVCCBufInfo is not NULL, then * DTVCC data is parsed and copied to pDTVCCBufInfo. * * If p608BufInfo is not NULL, then this function will copy 608 Closed Captioning * data according to the OutputType argument in the DccTransport_Init( ) call: * * CC608_A53: Only valid CC bytes from ATSC A/53 will be output. * CC608_DVS157: Only valid CC Bytes from DVS157 will be output. * CC608_A53Preferred: This function will track the presence of both A53 * and DVS157 formats. If only one format is detected, * it will be output. If both formats are detected, A53 * will be output. This algorithm uses a sliding window * approach. * **************************************************************************/ DCCERR DccTransport_Process( DCC_TRANSPORT_OBJECT * pObj, unsigned char * pInputBuf, unsigned int InputBufSize, //unsigned long ulPicInfo, DCC_OUTBUF_INFO * p608BufInfo, DCC_OUTBUF_INFO * pDTVCCBufInfo) ; /************************************************************************** * * Function: DccTransport_QueryDetectedFormats * * Inputs: * pObj - object, previously init'ed * * Outputs: * pDetectedFormats - bitmask, each bit reps one format * DCC_TYPE_DVS157 * DCC_TYPE_A53_608 * DCC_TYPE_A53_DTVCC * DCC_TYPE_UNKNOWN * * Returns: dccSuccess or a standard DCCERR error code * * Description: * * This function retrieves a bitmask representing which formats have been * detected in the stream. This is useful because on any call to * DccTransport_Process, the caller cannot merely look at the number of bytes * output for each output buffer to determine the detected formats. * **************************************************************************/ DCCERR DccTransport_QueryDetectedFormats( DCC_TRANSPORT_OBJECT * pObj, unsigned int * pDetectedFormats) ; #ifdef __cplusplus } #endif #endif /* BCMDCCTRANSPORT_H */