diff options
author | davilla <davilla@svn> | 2010-07-02 15:53:14 +0000 |
---|---|---|
committer | davilla <davilla@svn> | 2010-07-02 15:53:14 +0000 |
commit | 6168da7a054dfbf0a79f469e4cee2132ba1d896d (patch) | |
tree | 70b1e5393e992615bd36f8dfed8915aa136c70b7 /lib | |
parent | 48073b85b5e635e00efb23b029522e270dc8c981 (diff) |
[chd] update chd headers to new API
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@31577 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcrystalhd/bc_dts_defs.h | 276 | ||||
-rw-r--r-- | lib/libcrystalhd/bc_dts_types.h | 25 | ||||
-rw-r--r-- | lib/libcrystalhd/libcrystalhd_if.h | 374 |
3 files changed, 579 insertions, 96 deletions
diff --git a/lib/libcrystalhd/bc_dts_defs.h b/lib/libcrystalhd/bc_dts_defs.h index 405bd1631e..5c2a7214bb 100644 --- a/lib/libcrystalhd/bc_dts_defs.h +++ b/lib/libcrystalhd/bc_dts_defs.h @@ -29,7 +29,7 @@ #include "bc_dts_types.h" /* BIT Mask */ -#define BC_BIT(_x) ( 1 << (_x) ) +#define BC_BIT(_x) (1 << (_x)) typedef enum _BC_STATUS { BC_STS_SUCCESS = 0, @@ -67,7 +67,7 @@ typedef enum _BC_STATUS { /*------------------------------------------------------* * Registry Key Definitions * *------------------------------------------------------*/ -#define BC_REG_KEY_MAIN_PATH "Software\\Broadcom\\MediaPC\\70010" +#define BC_REG_KEY_MAIN_PATH "Software\\Broadcom\\MediaPC\\CrystalHD" #define BC_REG_KEY_FWPATH "FirmwareFilePath" #define BC_REG_KEY_SEC_OPT "DbgOptions" @@ -125,7 +125,11 @@ enum _DtsDeviceFixMode { DTS_ADAPTIVE_OUTPUT_PER = BC_BIT(17), DTS_INTELLIMAP = BC_BIT(18), /* b[19]-b[21] : select clock frequency */ - DTS_PLAYBACK_DROP_RPT_MODE = BC_BIT(22) + DTS_PLAYBACK_DROP_RPT_MODE = BC_BIT(22), + DTS_DIAG_TEST_MODE = BC_BIT(23), + DTS_SINGLE_THREADED_MODE = BC_BIT(24), + DTS_FILTER_MODE = BC_BIT(25), + DTS_MFT_MODE = BC_BIT(26) }; #define DTS_DFLT_RESOLUTION(x) (x<<11) @@ -155,6 +159,7 @@ enum _DtsSetVideoParamsAlgo { BC_VID_ALGO_H264 = 0, BC_VID_ALGO_MPEG2 = 1, BC_VID_ALGO_VC1 = 4, + BC_VID_ALGO_DIVX = 6, BC_VID_ALGO_VC1MP = 7, }; @@ -195,9 +200,9 @@ typedef struct _BC_PIB_EXT_H264 { /* H264_VALID_PANSCAN */ uint32_t pan_scan_count; - int32_t pan_scan_left [3]; - int32_t pan_scan_right [3]; - int32_t pan_scan_top [3]; + int32_t pan_scan_left[3]; + int32_t pan_scan_right[3]; + int32_t pan_scan_top[3]; int32_t pan_scan_bottom[3]; /* H264_VALID_SPS_CROP */ @@ -241,8 +246,7 @@ typedef struct _BC_PIB_EXT_VC1 { #if defined(_WIN32) || defined(_WIN64) || defined(__LINUX_USER__) /* Values for 'pulldown' field. '0' means no pulldown information * was present for this picture. */ -enum -{ +enum { vdecNoPulldownInfo = 0, vdecTop = 1, vdecBottom = 2, @@ -257,8 +261,7 @@ enum }; /* Values for the 'frame_rate' field. */ -enum -{ +enum { vdecFrameRateUnknown = 0, vdecFrameRate23_97, vdecFrameRate24, @@ -271,8 +274,7 @@ enum }; /* Values for the 'aspect_ratio' field. */ -enum -{ +enum { vdecAspectRatioUnknown = 0, vdecAspectRatioSquare, vdecAspectRatio12_11, @@ -294,8 +296,7 @@ enum }; /* Values for the 'colour_primaries' field. */ -enum -{ +enum { vdecColourPrimariesUnknown = 0, vdecColourPrimariesBT709, vdecColourPrimariesUnspecified, @@ -307,43 +308,42 @@ enum vdecColourPrimariesGenericFilm, }; -enum -{ - vdecRESOLUTION_CUSTOM = 0x00000000, // custom - vdecRESOLUTION_480i = 0x00000001, // 480i - vdecRESOLUTION_1080i = 0x00000002, // 1080i (1920x1080, 60i) - vdecRESOLUTION_NTSC = 0x00000003, // NTSC (720x483, 60i) - vdecRESOLUTION_480p = 0x00000004, // 480p (720x480, 60p) - vdecRESOLUTION_720p = 0x00000005, // 720p (1280x720, 60p) - vdecRESOLUTION_PAL1 = 0x00000006, // PAL_1 (720x576, 50i) - vdecRESOLUTION_1080i25 = 0x00000007, // 1080i25 (1920x1080, 50i) - vdecRESOLUTION_720p50 = 0x00000008, // 720p50 (1280x720, 50p) - vdecRESOLUTION_576p = 0x00000009, // 576p (720x576, 50p) - vdecRESOLUTION_1080i29_97 = 0x0000000A, // 1080i (1920x1080, 59.94i) - vdecRESOLUTION_720p59_94 = 0x0000000B, // 720p (1280x720, 59.94p) - vdecRESOLUTION_SD_DVD = 0x0000000C, // SD DVD (720x483, 60i) - vdecRESOLUTION_480p656 = 0x0000000D, // 480p (720x480, 60p), output bus width 8 bit, clock 74.25MHz. - vdecRESOLUTION_1080p23_976 = 0x0000000E, // 1080p23_976 (1920x1080, 23.976p) - vdecRESOLUTION_720p23_976 = 0x0000000F, // 720p23_976 (1280x720p, 23.976p) - vdecRESOLUTION_240p29_97 = 0x00000010, // 240p (1440x240, 29.97p ) - vdecRESOLUTION_240p30 = 0x00000011, // 240p (1440x240, 30p) - vdecRESOLUTION_288p25 = 0x00000012, // 288p (1440x288p, 25p) - vdecRESOLUTION_1080p29_97 = 0x00000013, // 1080p29_97 (1920x1080, 29.97p) - vdecRESOLUTION_1080p30 = 0x00000014, // 1080p30 (1920x1080, 30p) - vdecRESOLUTION_1080p24 = 0x00000015, // 1080p24 (1920x1080, 24p) - vdecRESOLUTION_1080p25 = 0x00000016, // 1080p25 (1920x1080, 25p) - vdecRESOLUTION_720p24 = 0x00000017, // 720p24 (1280x720, 25p) - vdecRESOLUTION_720p29_97 = 0x00000018, // 720p29.97 (1280x720, 29.97p) - vdecRESOLUTION_480p23_976 = 0x00000019, // 480p23.976 (720*480, 23.976) - vdecRESOLUTION_480p29_97 = 0x0000001A, // 480p29.976 (720*480, 29.97p) - vdecRESOLUTION_576p25 = 0x0000001B, // 576p25 (720*576, 25p) - //For Zero Frame Rate - vdecRESOLUTION_480p0 = 0x0000001C, // 480p (720x480, 0p) - vdecRESOLUTION_480i0 = 0x0000001D, // 480i (720x480, 0i) - vdecRESOLUTION_576p0 = 0x0000001E, // 576p (720x576, 0p) - vdecRESOLUTION_720p0 = 0x0000001F, // 720p (1280x720, 0p) - vdecRESOLUTION_1080p0 = 0x00000020, // 1080p (1920x1080, 0p) - vdecRESOLUTION_1080i0 = 0x00000021, // 1080i (1920x1080, 0i) +enum { + vdecRESOLUTION_CUSTOM = 0x00000000, /* custom */ + vdecRESOLUTION_480i = 0x00000001, /* 480i */ + vdecRESOLUTION_1080i = 0x00000002, /* 1080i (1920x1080, 60i) */ + vdecRESOLUTION_NTSC = 0x00000003, /* NTSC (720x483, 60i) */ + vdecRESOLUTION_480p = 0x00000004, /* 480p (720x480, 60p) */ + vdecRESOLUTION_720p = 0x00000005, /* 720p (1280x720, 60p) */ + vdecRESOLUTION_PAL1 = 0x00000006, /* PAL_1 (720x576, 50i) */ + vdecRESOLUTION_1080i25 = 0x00000007, /* 1080i25 (1920x1080, 50i) */ + vdecRESOLUTION_720p50 = 0x00000008, /* 720p50 (1280x720, 50p) */ + vdecRESOLUTION_576p = 0x00000009, /* 576p (720x576, 50p) */ + vdecRESOLUTION_1080i29_97 = 0x0000000A, /* 1080i (1920x1080, 59.94i) */ + vdecRESOLUTION_720p59_94 = 0x0000000B, /* 720p (1280x720, 59.94p) */ + vdecRESOLUTION_SD_DVD = 0x0000000C, /* SD DVD (720x483, 60i) */ + vdecRESOLUTION_480p656 = 0x0000000D, /* 480p (720x480, 60p), output bus width 8 bit, clock 74.25MHz */ + vdecRESOLUTION_1080p23_976 = 0x0000000E, /* 1080p23_976 (1920x1080, 23.976p) */ + vdecRESOLUTION_720p23_976 = 0x0000000F, /* 720p23_976 (1280x720p, 23.976p) */ + vdecRESOLUTION_240p29_97 = 0x00000010, /* 240p (1440x240, 29.97p ) */ + vdecRESOLUTION_240p30 = 0x00000011, /* 240p (1440x240, 30p) */ + vdecRESOLUTION_288p25 = 0x00000012, /* 288p (1440x288p, 25p) */ + vdecRESOLUTION_1080p29_97 = 0x00000013, /* 1080p29_97 (1920x1080, 29.97p) */ + vdecRESOLUTION_1080p30 = 0x00000014, /* 1080p30 (1920x1080, 30p) */ + vdecRESOLUTION_1080p24 = 0x00000015, /* 1080p24 (1920x1080, 24p) */ + vdecRESOLUTION_1080p25 = 0x00000016, /* 1080p25 (1920x1080, 25p) */ + vdecRESOLUTION_720p24 = 0x00000017, /* 720p24 (1280x720, 25p) */ + vdecRESOLUTION_720p29_97 = 0x00000018, /* 720p29.97 (1280x720, 29.97p) */ + vdecRESOLUTION_480p23_976 = 0x00000019, /* 480p23.976 (720*480, 23.976) */ + vdecRESOLUTION_480p29_97 = 0x0000001A, /* 480p29.976 (720*480, 29.97p) */ + vdecRESOLUTION_576p25 = 0x0000001B, /* 576p25 (720*576, 25p) */ + /* For Zero Frame Rate */ + vdecRESOLUTION_480p0 = 0x0000001C, /* 480p (720x480, 0p) */ + vdecRESOLUTION_480i0 = 0x0000001D, /* 480i (720x480, 0i) */ + vdecRESOLUTION_576p0 = 0x0000001E, /* 576p (720x576, 0p) */ + vdecRESOLUTION_720p0 = 0x0000001F, /* 720p (1280x720, 0p) */ + vdecRESOLUTION_1080p0 = 0x00000020, /* 1080p (1920x1080, 0p) */ + vdecRESOLUTION_1080i0 = 0x00000021, /* 1080i (1920x1080, 0i) */ }; /* Bit definitions for 'flags' field */ @@ -363,13 +363,7 @@ enum #define VDEC_FLAG_PICTURE_META_DATA_PRESENT (0x40000) -#endif // _WIN32 || _WIN64 - -enum _BC_OUTPUT_FORMAT { - MODE420 = 0x0, - MODE422_YUY2 = 0x1, - MODE422_UYVY = 0x2, -}; +#endif /* _WIN32 || _WIN64 */ typedef struct _BC_PIC_INFO_BLOCK { /* Common fields. */ @@ -390,11 +384,10 @@ typedef struct _BC_PIC_INFO_BLOCK { uint32_t n_drop; /* number of non-reference frames remaining to be dropped */ /* Protocol-specific extensions. */ - union - { - BC_PIB_EXT_H264 h264; - BC_PIB_EXT_MPEG mpeg; - BC_PIB_EXT_VC1 vc1; + union { + BC_PIB_EXT_H264 h264; + BC_PIB_EXT_MPEG mpeg; + BC_PIB_EXT_VC1 vc1; } other; } BC_PIC_INFO_BLOCK, *PBC_PIC_INFO_BLOCK; @@ -418,15 +411,24 @@ enum _POUT_OPTIONAL_IN_FLAGS_{ BC_POUT_FLAGS_FLD_BOT = 0x80000, /* Bottom Field data */ }; +//Decoder Capability +enum DECODER_CAP_FLAGS +{ + BC_DEC_FLAGS_H264 = 0x01, + BC_DEC_FLAGS_MPEG2 = 0x02, + BC_DEC_FLAGS_VC1 = 0x04, + BC_DEC_FLAGS_M4P2 = 0x08, //MPEG-4 Part 2: Divx, Xvid etc. +}; + #if defined(__KERNEL__) || defined(__LINUX_USER__) -typedef BC_STATUS (*dts_pout_callback)(void *shnd, uint32_t width, uint32_t height, uint32_t stride, void *pOut); +typedef BC_STATUS(*dts_pout_callback)(void *shnd, uint32_t width, uint32_t height, uint32_t stride, void *pOut); #else -typedef BC_STATUS (*dts_pout_callback)(void *shnd, uint32_t width, uint32_t height, uint32_t stride, struct _BC_DTS_PROC_OUT *pOut); +typedef BC_STATUS(*dts_pout_callback)(void *shnd, uint32_t width, uint32_t height, uint32_t stride, struct _BC_DTS_PROC_OUT *pOut); #endif -//Line 21 Closed Caption -//User Data -#define MAX_UD_SIZE 1792 //1920 - 128 +/* Line 21 Closed Caption */ +/* User Data */ +#define MAX_UD_SIZE 1792 /* 1920 - 128 */ typedef struct _BC_DTS_PROC_OUT { uint8_t *Ybuff; /* Caller Supplied buffer for Y data */ @@ -444,8 +446,8 @@ typedef struct _BC_DTS_PROC_OUT { BC_PIC_INFO_BLOCK PicInfo; /* Picture Information Block Data */ - //Line 21 Closed Caption - //User Data + /* Line 21 Closed Caption */ + /* User Data */ uint32_t UserDataSz; uint8_t UserData[MAX_UD_SIZE]; @@ -478,20 +480,22 @@ typedef struct _BC_DTS_STATUS { uint32_t PIBMissCount; /* Amount of times a PIB is invalid. (reported by DIL) */ uint32_t cpbEmptySize; /* supported only for H.264, specifically changed for - * Adobe. Report size of CPB buffer available. + * SingleThreadedAppMode. Report size of CPB buffer available. * Reported by DIL */ uint64_t NextTimeStamp; /* TimeStamp of the next picture that will be returned - * by a call to ProcOutput. Added for Adobe. Reported - * back from the driver */ - uint8_t reserved__[16]; + * by a call to ProcOutput. Added for SingleThreadedAppMode. + * Reported back from the driver */ + uint8_t TxBufData; + + uint8_t reserved__[15]; } BC_DTS_STATUS; #define BC_SWAP32(_v) \ - ( (((_v) & 0xFF000000)>>24)| \ + ((((_v) & 0xFF000000)>>24)| \ (((_v) & 0x00FF0000)>>8)| \ (((_v) & 0x0000FF00)<<8)| \ - (((_v) & 0x000000FF)<<24) ) + (((_v) & 0x000000FF)<<24)) #define WM_AGENT_TRAYICON_DECODER_OPEN 10001 #define WM_AGENT_TRAYICON_DECODER_CLOSE 10002 @@ -500,5 +504,121 @@ typedef struct _BC_DTS_STATUS { #define WM_AGENT_TRAYICON_DECODER_RUN 10005 #define WM_AGENT_TRAYICON_DECODER_PAUSE 10006 - -#endif //_BC_DTS_DEFS_H_ +#define MAX_COLOR_SPACES 3 + +typedef enum _BC_OUTPUT_FORMAT { + MODE420 = 0x0, + MODE422_YUY2 = 0x1, + MODE422_UYVY = 0x2, + OUTPUT_MODE420 = 0x0, + OUTPUT_MODE422_YUY2 = 0x1, + OUTPUT_MODE422_UYVY = 0x2, + OUTPUT_MODE_INVALID = 0xFF, +} BC_OUTPUT_FORMAT; + +typedef struct _BC_COLOR_SPACES_ { + BC_OUTPUT_FORMAT OutFmt[MAX_COLOR_SPACES]; + uint16_t Count; +} BC_COLOR_SPACES; + + +typedef enum _BC_CAPS_FLAGS_ { + PES_CONV_SUPPORT = 1, /*Support PES Conversion*/ + MULTIPLE_DECODE_SUPPORT = 2 /*Support multiple stream decode*/ +} BC_CAPS_FLAGS; + +typedef struct _BC_HW_CAPABILITY_ { + BC_CAPS_FLAGS flags; + BC_COLOR_SPACES ColorCaps; + void* Reserved1; /* Expansion Of API */ + + //Decoder Capability + uint32_t DecCaps; //DECODER_CAP_FLAGS +} BC_HW_CAPS, *PBC_HW_CAPS; + +typedef struct _BC_SCALING_PARAMS_ { + uint32_t sWidth; + uint32_t sHeight; + uint32_t DNR; + uint32_t Reserved1; /*Expansion Of API*/ + uint8_t *Reserved2; /*Expansion OF API*/ + uint32_t Reserved3; /*Expansion Of API*/ + uint8_t *Reserved4; /*Expansion Of API*/ + +} BC_SCALING_PARAMS, *PBC_SCALING_PARAMS; + +typedef enum _BC_MEDIA_SUBTYPE_ { + BC_MSUBTYPE_INVALID = 0, + BC_MSUBTYPE_MPEG1VIDEO, + BC_MSUBTYPE_MPEG2VIDEO, + BC_MSUBTYPE_H264, + BC_MSUBTYPE_WVC1, + BC_MSUBTYPE_WMV3, + BC_MSUBTYPE_AVC1, + BC_MSUBTYPE_WMVA, + BC_MSUBTYPE_VC1, + BC_MSUBTYPE_DIVX, + BC_MSUBTYPE_DIVX311, + BC_MSUBTYPE_OTHERS /*Types to facilitate PES conversion*/ +} BC_MEDIA_SUBTYPE; + +typedef struct _BC_INPUT_FORMAT_ { + BOOL FGTEnable; /*Enable processing of FGT SEI*/ + BOOL MetaDataEnable; /*Enable retrieval of picture metadata to be sent to video pipeline.*/ + BOOL Progressive; /*Instruct decoder to always try to send back progressive + frames. If input content is 1080p, the decoder will + ignore pull-down flags and always give 1080p output. + If 1080i content is processed, the decoder will return + 1080i data. When this flag is not set, the decoder will + use pull-down information in the input stream to decide + the decoded data format.*/ + uint32_t OptFlags; /*In this field bits 0:3 are used pass default frame rate, bits 4:5 are for operation mode + (used to indicate Blu-ray mode to the decoder) and bit 6 is for the flag mpcOutPutMaxFRate + which when set tells the FW to output at the max rate for the resolution and ignore the + frame rate determined from the stream. Bit 7 is set to indicate that this is single threaded + mode and the driver will be peeked to get timestamps ahead of time*/ + BC_MEDIA_SUBTYPE mSubtype; /* Video Media Type*/ + uint32_t width; + uint32_t height; + uint32_t startCodeSz; /*Start code size for H264 clips*/ + uint8_t *pMetaData; /*Metadata buffer that is used to pass sequence header*/ + uint32_t metaDataSz; /*Metadata size*/ + uint8_t bEnableScaling; +} BC_INPUT_FORMAT; + +typedef struct _BC_INFO_CRYSTAL_ { + uint8_t device; + union { + struct { + uint32_t dilRelease:8; + uint32_t dilMajor:8; + uint32_t dilMinor:16; + }; + uint32_t version; + } dilVersion; + + union { + struct { + uint32_t drvRelease:4; + uint32_t drvMajor:8; + uint32_t drvMinor:12; + uint32_t drvBuild:8; + }; + uint32_t version; + } drvVersion; + + union { + struct { + uint32_t fwRelease:4; + uint32_t fwMajor:8; + uint32_t fwMinor:12; + uint32_t fwBuild:8; + }; + uint32_t version; + } fwVersion; + + uint32_t Reserved1; // For future expansion + uint32_t Reserved2; // For future expansion +} BC_INFO_CRYSTAL, *PBC_INFO_CRYSTAL; + +#endif /* _BC_DTS_DEFS_H_ */ diff --git a/lib/libcrystalhd/bc_dts_types.h b/lib/libcrystalhd/bc_dts_types.h index 17ab27c14b..39a3c17bec 100644 --- a/lib/libcrystalhd/bc_dts_types.h +++ b/lib/libcrystalhd/bc_dts_types.h @@ -25,7 +25,7 @@ #ifndef _BC_DTS_TYPES_H_ #define _BC_DTS_TYPES_H_ -#ifdef __LINUX_USER__ // Don't include these for KERNEL.. +#ifdef __LINUX_USER__ /* Don't include these for KERNEL.. */ #include <stdint.h> #endif @@ -39,7 +39,7 @@ typedef char S8; #endif #ifndef PVOID -typedef void * PVOID; +typedef void *PVOID; #endif #ifndef BOOL @@ -56,13 +56,13 @@ typedef int BOOL; #if !(defined(POINTER_32)) #define POINTER_32 __ptr32 #endif -#else //_WIN32 +#else /* _WIN32 */ #define POINTER_32 #endif #if defined(__KERNEL__) || defined(__LINUX_USER__) -#ifdef __LINUX_USER__ // Don't include these for KERNEL.. +#ifdef __LINUX_USER__ /* Don't include these for KERNEL */ typedef uint32_t ULONG; typedef int32_t LONG; typedef void *HANDLE; @@ -76,28 +76,27 @@ typedef uint32_t *LPDWORD; typedef unsigned char *PUCHAR; #ifndef TRUE -#define TRUE 1 + #define TRUE 1 #endif #ifndef FALSE -#define FALSE 0 + #define FALSE 0 #endif -#define TEXT #else + /* For Kernel usage.. */ typedef bool bc_bool_t; #endif #else -#ifndef _WIN32 #ifndef uint64_t -typedef struct _uint64_t { - uint32_t low_dw; - uint32_t hi_dw; -} uint64_t; -#endif +// typedef struct _uint64_t { +// uint32_t low_dw; +// uint32_t hi_dw; +// } uint64_t; +typedef unsigned long long uint64_t; #endif #ifndef int32_t diff --git a/lib/libcrystalhd/libcrystalhd_if.h b/lib/libcrystalhd/libcrystalhd_if.h index 5351eb9222..45fa7a63f8 100644 --- a/lib/libcrystalhd/libcrystalhd_if.h +++ b/lib/libcrystalhd/libcrystalhd_if.h @@ -31,10 +31,91 @@ #include "bc_dts_defs.h" +#define FLEA_MAX_TRICK_MODE_SPEED 6 + #ifdef __cplusplus extern "C" { #endif +/***************************************************************************** +****************************************************************************** + + Theory of operation + + + The Device Interface Library (DIL) allows application level code, such +as a DirectShow filter, to access the Broadcom CrystalHD decoder driver to +provide hardware decoding for MPEG-2, H.264 (AVC) and VC-1 streams. + + In the Microsoft DirectShow system, the overall system graph would look +like the following: + ++--------+ +---------------+ +---------------+ +--------------------+ +| Source |->| Demultiplexer |->| Audio decoder |->| DirectSound Device | ++--------+ +---------------+ +---------------+ +--------------------+ + | + | +-------------------------+ +----------------+ + +->| Broadcom decoder filter |->| Video Renderer | + +-------------------------+ +----------------+ + | | + +----------------+ + | Broadcom DIL | + +----------------+ + | | + +-----------------+ + | Broadcom Driver | + +-----------------+ + + From the view of the caller, the DIL will accept compressed video streams +and will output decoded video frames or fields to seperate Y and UV buffers. +The DIL is responsible solely for decoding video and has no responsibilities +for audio nor for rendering, as shown in the above diagram. Audio/video +sychronization is assisted by feeding the DIL with timestamps so that it +may pass those timestamps along with the decoded video. The timestamped +output video will then be presented at the appropriate time by the renderer. + +A minimal implementation would be: + + HANDLE hBRCMhandle; + uint8_t input_buffer[INPUT_SIZE]; + uint8_t y_output_buffer[WIDTH*HEIGHT]; + uint8_t uv_output_buffer[WIDTH*HEIGHT]; + BC_DTS_PROC_OUT sProcOutData = { fill in your values here }; + BC_PIC_INFO_BLOCK sPIB = { fill in your values here }; + + // Acquire handle for device. + DtsDeviceOpen(&hBRCMhandle, 0); + + // Elemental stream. + DtsOpenDecoder(hBRCMhandle, 0); + + // H.264, Enable FGT SEI, do not parse metadata, no forced progressive out + DtsSetVideoParams(hBRCMhandle,0,1,0,0,0); + + // Tell decoder to wait for input from host. (PC) + DtsStartDecoder(hBRCMhandle); + + // Input buffer address, input buffer size, no timestamp, Unencrypted + DtsProcInput(hBRCMhandle,input_buffer,sizeof(input_buffer),0,0); + + // Tell PC to wait for data from decoder. + DtsStartCapture(hBRCMhandle); + + // 16ms timeout, pass pointer to PIB then get the decoded picture. + DtsProcOutput(hBRCMhandle,16,&sPIB); + + // Stop the decoder. + DtsStopDecoder(hBRCMhandle); + + // Close the decoder + DtsCloseDecoder(hBRCMhandle); + + // Release handle for device. + DtsDeviceClose(hBRCMhandle); + +****************************************************************************** +*****************************************************************************/ + #define DRVIFLIB_API /***************************************************************************** @@ -353,8 +434,13 @@ Parameters: 1080i data. When this flag is not set, the decoder will use pull-down information in the input stream to decide the decoded data format. - Reserved This field is reserved for possible future expansion. - Set to 0. + OptFlags In this field bits 0:3 are used pass default frame rate, + bits 4:5 are for operation mode (used to indicate Blu-ray + mode to the decoder) and bit 6 is for the flag mpcOutPutMaxFRate + which when set tells the FW to output at the max rate for the + resolution and ignore the frame rate determined from the + stream. Bit 7 is set to indicate that this is single threaded mode + and the driver will be peeked to get timestamps ahead of time. Return: @@ -375,6 +461,36 @@ DtsSetVideoParams( Function name: + DtsSetInputFormat + +Description: + + Sets input video's various parameters that would be used by a subsequent call + to DtsStartDecoder. + + DtsSetInputFormat must always be called before DtsStartDecoder for the + decoder to start processing input data. The device must have been + previously opened for this call to succeed. + +Parameters: + hDevice Handle to device. This is obtained via a prior call to DtsDeviceOpen. + pInputFormat Pointer to the BC_INPUT_FORMAT data. + +Return: + + BC_STS_SUCCESS will be returned on successful completion. + +*****************************************************************************/ +DRVIFLIB_API BC_STATUS +DtsSetInputFormat( + HANDLE hDevice, + BC_INPUT_FORMAT *pInputFormat + ); + +/***************************************************************************** + +Function name: + DtsGetVideoParams Description: @@ -547,7 +663,68 @@ Return: *****************************************************************************/ DRVIFLIB_API BC_STATUS DtsResumeDecoder( - HANDLE hDevice + HANDLE hDevice + ); + +/***************************************************************************** + +Function name: + + DtsSetVideoPID + +Description: + + Sets the video PID in the input Transport Stream that the decoder + needs to process. + + The device must have been previously opened for this call to succeed. + +Parameters: + + hDevice Handle to device. This is obtained via a prior call to + DtsDeviceOpen. + PID PID value that decoder needs to process. + +Return: + + BC_STS_SUCCESS will be returned on successful completion. + +*****************************************************************************/ +DRVIFLIB_API BC_STATUS +DtsSetVideoPID( + HANDLE hDevice, + uint32_t pid + ); + + +/***************************************************************************** + +Function name: + + StartCaptureImmidiate + +Description: + + Instruct the driver to start capturing decoded frames for output. + + The device must have been previously opened for this call to succeed. + This function must be called before the first call to DtsProcInput. + This function instructs the receive path in the driver to start waiting + for valid data to be presented from the decoder. + +Parameters: + hDevice Handle to device. This is obtained via a prior call to + DtsDeviceOpen. + +Return: + + BC_STS_SUCCESS will be returned on successful completion. + +*****************************************************************************/ +DRVIFLIB_API BC_STATUS +DtsStartCaptureImmidiate( + HANDLE hDevice, + uint32_t Reserved ); @@ -590,7 +767,7 @@ Description: ***This function is deprecated and is for temporary use only.*** - Flush the driver’s queue of pictures and stops the capture process. These + Flush the driverÃs queue of pictures and stops the capture process. These functions will be replaced with automatic Stop (End of Sequence) detection. The device must have been previously opened for this call to succeed. @@ -760,6 +937,7 @@ Parameters: that is available in the buffer. If timestamp is present (i.e. non-zero), then this will be reflected in the output sample (picture) produced from the contents of this buffer. + Timestamp should be in units of 100 ns. Encrypted Flag to indicate that the data transfer is not in the clear and that the decoder needs to decrypt before it can decode the data. Note that due to complexity, it is preferred that @@ -784,6 +962,39 @@ DtsProcInput( Function name: + DtsGetColorPrimaries + +Description: + + Returns color primaries information from the stream being processed. + + The device must have been previously opened for this call to succeed. + In addition at least one picture must have been successfully decoded and + returned back from the decoder. + +Parameters: + + hDevice Handle to device. This is obtained via a prior call to + DtsDeviceOpen. + colorPrimaries Pointer to U32 to receive the color primaries information. + The values returned are described in the previous section + regarding the picture metadata. [OUTPUT] + +Return: + + BC_STS_SUCCESS will be returned on successful completion. + +*****************************************************************************/ +DRVIFLIB_API BC_STATUS +DtsGetColorPrimaries( + HANDLE hDevice, + uint32_t *colorPrimaries + ); + +/***************************************************************************** + +Function name: + DtsFlushInput Description: @@ -807,6 +1018,8 @@ Parameters: 2 Flushes all the decoder buffers, input, decoded and to be decoded. 3 Cancels the pending TX Request from the DIL/driver + 4 Flushes all the decoder buffers, input, decoded and + to be decoded data. Also flushes the drivers buffers Return: @@ -875,7 +1088,11 @@ Parameters: hDevice Handle to device. This is obtained via a prior call to DtsDeviceOpen. - rate 2x/ 1x + rate Inverse of speed x 10000. + Examples: + 1/2x playback speed = 20000 + 1x playback speed = 10000 + 2x playback speed = 5000 Return: @@ -1016,6 +1233,43 @@ DtsIs422Supported( Function name: + DtsSetColorSpace + +Description: + + This function sets the output sample's color space. + + The device must have been opened previously and must support 422 mode for + this call to succeed. + + Use "DtsIs422Supported" to find whether 422 mode is supported. + +Parameters: + + hDevice Handle to device. This is obtained via a prior call to + DtsDeviceOpen. + 422Mode Mode is defined by BC_OUTPUT_FORMAT as follows - + OUTPUT_MODE420 = 0x0, + OUTPUT_MODE422_YUY2 = 0x1, + OUTPUT_MODE422_UYVY = 0x2, + OUTPUT_MODE_INVALID = 0xFF + Valid values for this API are OUTPUT_MODE422_YUY2 and OUTPUT_MODE422_UYVY + +Return: + + BC_STS_SUCCESS will be returned on successful completion. + +*****************************************************************************/ +DRVIFLIB_API BC_STATUS +DtsSetColorSpace( + HANDLE hDevice, + BC_OUTPUT_FORMAT Mode422 + ); + +/***************************************************************************** + +Function name: + DtsSet422Mode Description: @@ -1140,9 +1394,119 @@ DtsGetDriverStatus( BC_DTS_STATUS *pStatus ); +/***************************************************************************** + +Function name: + + DtsGetCapabilities + +Description: + + This command returns output format support and hardware capabilities. + + The device must have been previously opened for this call to succeed. + +Parameters: + + hDevice Handle to device. This is obtained via a prior call to + DtsDeviceOpen. + pCapsBuffer Pointer to BC_HW_CAPS to receive HW Output capabilities. +Return: + + BC_STS_SUCCESS will be returned on successful completion. + +*****************************************************************************/ +DRVIFLIB_API BC_STATUS +DtsGetCapabilities ( + HANDLE hDevice, + PBC_HW_CAPS pCapsBuffer + ); + +/***************************************************************************** + +Function name: + + DtsSetScaleParams + +Description: + This command sets hardware scaling parameters. + +Parameters: + + hDevice Handle to device. This is obtained via a prior call to + DtsDeviceOpen. + + pScaleParams Pointer to BC_SCALING_PARAMS to set hardware scaling parameters. + +Return: + + BC_STS_SUCCESS will be returned on successful completion. + +*****************************************************************************/ +DRVIFLIB_API BC_STATUS +DtsSetScaleParams ( + HANDLE hDevice, + PBC_SCALING_PARAMS pScaleParams + ); + +/***************************************************************************** + +Function name: + + DtsIsEndOfStream + +Description: + + This command returns whether the end of stream(EOS) is reaching. +Parameters: + + hDevice Handle to device. This is obtained via a prior call to + DtsDeviceOpen. + + bEOS Pointer to uint8_t to indicate if EOS of not + +Return: + + BC_STS_SUCCESS will be returned on successful completion. + +*****************************************************************************/ +DRVIFLIB_API BC_STATUS +DtsIsEndOfStream( + HANDLE hDevice, + uint8_t* bEOS +); + +/***************************************************************************** + +Function name: + + DtsCrystalHDVersion + +Description: + + This API returns hw and sw version information for Crystal HD solutions +Parameters: + + hDevice Handle to device. This is obtained via a prior call to + DtsDeviceOpen. + + bCrystalInfo Pointer to structure to fill in with information + + device = 0 for BCM70012, 1 for BCM70015 + +Return: + + BC_STS_SUCCESS will be returned on successful completion. + +*****************************************************************************/ +DRVIFLIB_API BC_STATUS +DtsCrystalHDVersion( + HANDLE hDevice, + PBC_INFO_CRYSTAL bCrystalInfo +); #ifdef __cplusplus } |