/*************************************************************************** * Copyright (c) 2003-2006, 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: $ * $brcm_Revision: $ * $brcm_Date: $ * * Module Description: * * Revision History: * * $brcm_Log: $ * ***************************************************************************/ #ifndef BSETTOP_DECODE_H__ #define BSETTOP_DECODE_H__ #include "bsettop_types.h" #include "bsettop_stream.h" #define XVD_ST_RAP_NOT_DETECTED 0x100 #define XVD_ST_UNSUPPORTED_FEATURE_DETECTED 0x200 #define XVD_ST_IMAGE_SIZE_TOO_BIG 0x400 #ifdef __cplusplus extern "C" { #endif /*=************************* The decode interface is used to decode both digital and analog streams. It controls both video and audio decode. The source for a decode is a stream (bstream_t). Streams can generated either from a tuner (btuner_t), a playback engine (bplayback_t) or streamer (bstreamer_t). The destination of a decode is a decode window (bdecode_window_t) which is connected to a display (bdisplay_t). For PIP or dual output systems, there are two decoders. Otherwise there is only one decoder. ****************************/ /* Summary: Open a decode engine. Description: */ bdecode_t bdecode_open( bobject_t decode_id /* decode object id */ ); /* Summary: Close a decode engine. Description: The decode should be stopped before closing. After closing, the bdecode_t handle is invalid. */ void bdecode_close( bdecode_t decode /* handle returned by bdecode_open */ ); /* Summary: Start decoding a stream. */ bresult bdecode_start( bdecode_t decode, /* handle returned by bdecode_open */ bstream_t source, /* source for the decode, either analog or digital */ bdecode_window_t window /* window to render decode */ ); /* Summary: Stop decoding a stream. Description: The stream remains valid after decode is stopped. Decode could be restarted without retuning or restarting playback. */ void bdecode_stop( bdecode_t decode /* handle returned by bdecode_open */ ); typedef struct { unsigned int width; unsigned int height; unsigned int pitch; unsigned char *buffer; }bdecode_buffer; /* Summary: Decode status returned by bdecode_get_status */ typedef struct bdecode_status { unsigned int source_width; /* width in pixels of the source video */ unsigned int source_height; /* height in pixels of the source video */ unsigned int display_width; /* width in pixels of the source video */ unsigned int display_height; /* height in pixels of the source video */ unsigned int video_fifo_depth; /* depth in bytes of the compressed video buffer (VBV) */ unsigned int video_fifo_size; /* size in bytes of the compressed video buffer (VBV) */ unsigned int video_pts; /* current PTS of the video decoder */ unsigned int video_stc; /* current STC used by the video decoder */ unsigned int video_pts_error; /* current pcr offset value held by decoder */ unsigned video_aspect_ratio; /* value of aspect_ration_information field from decoded MPEG stream (see ISO/IEC 13818-2) */ unsigned int video_format; unsigned int video_framerate; unsigned int first_pts_ticks; /* os ticks until first pts */ unsigned int seq_ticks; /* os ticks until sequence header/format info */ int hPanScan; /* horizontal PanScan */ int vPanScan; /* vertical PanScan */ unsigned int watchdog_cnt; unsigned int pts_err_cnt; unsigned int req_stc_cnt; unsigned int first_pts_cnt; unsigned int offset_cnt; unsigned int decode_err_cnt; unsigned int pic_info_cnt; unsigned int decoder_drop_cnt; unsigned int display_drop_cnt; unsigned int pic_received; unsigned int TSM_Mode; unsigned int underflow_cnt; unsigned int bitRate; unsigned int profile; unsigned int level; unsigned short vPID; unsigned short pcrPID; bool bStreamProgressive; bool bFrameProgressive; bool bPCR_Lock; /* PCR Lock interrupt */ bool bVideoDecoding; unsigned int xvdch_status; } bdecode_status; /* Summary: Get the status of the decoder and current source. */ bresult bdecode_get_status( bdecode_t decode, /* handle returned by bdecode_open */ bdecode_status *status /* [out] status to be populated */ ); /* Summary: Decode config structure */ typedef struct bdecode_config { void (*xds_callback)( int xds_class, /* the class (0 - current, used for vchip) */ int xds_type, /* the xds type (5 - vchip) */ unsigned char* data, /* the data buffer, containing data_len valid bytes */ int data_len /* the number of valid bytes in data */ ); void (*cc_callback)(unsigned char* data,int data_len,bool banalog); void (*xpt_callback)(void *data); void *xpt_callback_data; void *channel; /* opaque reference to the mvd channel to work around MVD pid filter configuation issues */ unsigned int mute : 1; /* mute video when non-zero */ unsigned int widescreen : 2; /* now 4 modes, full, letterbox, pillar and auto */ unsigned int rmm_enabled : 1; /* reduced memory mode enabled when non-zero */ unsigned int cc_enabled : 1; /* closed captioning output enabled when non -zero */ unsigned int crc_enabled : 1; /* enable CRC capture - in debug build only */ unsigned int channel_change : 2; /* 0 - mute on channel change, 1 - display last frame, 2 -display initial frame */ unsigned int block_vbi; unsigned int crc[2]; /* Luma,Chroma component CRC for last field */ void *static_fields[2]; /* Static fields for testing feeder */ void (*first_pts_callback)(void); void (*seq_hdr_callback)(void); }bdecode_config; /* Summary: General bdecode configuration function used to configure internal operation parameters. */ void bdecode_set_config( bdecode_t decode, /* handle returned by bdecode_open */ bdecode_config *p_cfg /* configuration structure reference */ ); /* Summary: General bdecode configuration function used to get the internal operation parameters. */ void bdecode_get_config( bdecode_t decode, /* handle returned by bdecode_open */ bdecode_config *p_cfg /* [out] configuration to be populated */ ); /** Summary: Supported video format. Returns NULL if stream_type (from PMT) not supported. **/ bsettop_av_stream_type_t *bdecode_supported_video(unsigned char stream_type); #if SUPPORT_DST_PLATFORM #include "bxvd.h" enum bdecode_callback_type{ bdecode_callback_type_userdata = 10, bdecode_callback_type_vec_isr, bdecode_callback_type_seq_hdr_isr, bdecode_callback_type_picture_isr, bdecode_callback_type_video_err, } ; //neverdai modify bdecode_callback_typeÃß°¡ typedef void (*bdecode_callback_t)(enum bdecode_callback_type cb_type, void *param); /* Summary: Register decode callbacks */ bdecode_callback_t bdecode_register_callback( enum bdecode_callback_type type, bdecode_callback_t fn ); /* void bdecode_debug(int arg); void bdecode_force_update_picture_config(int count, int widescreenmode); */ BXVD_PictureParameterInfo *bdecode_get_stream_info(BXVD_PictureParameterInfo *status); BAVC_USERDATA_info *bdecode_get_userdata_info(BAVC_USERDATA_info *status); #endif /* SUPPORT_DST_PLATFORM */ /* End of Decode API */ #ifdef __cplusplus } #endif #endif /* BSETTOP_DECODE_H__ */