Skip to content

Commit

Permalink
[chd] update crystalhd headers for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
davilla committed May 4, 2011
1 parent 3e43e50 commit 073b6f9
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 58 deletions.
17 changes: 14 additions & 3 deletions lib/libcrystalhd/bc_dts_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ typedef struct _BC_PIB_EXT_VC1 {
/*------------------------------------------------------*
* Picture Information Block *
*------------------------------------------------------*/
#if defined(_WIN32) || defined(_WIN64) || defined(__LINUX_USER__)
#if defined(__LINUX_USER__)
/* Values for 'pulldown' field. '0' means no pulldown information
* was present for this picture. */
enum {
Expand Down Expand Up @@ -271,6 +271,8 @@ enum {
vdecFrameRate50,
vdecFrameRate59_94,
vdecFrameRate60,
vdecFrameRate14_985,
vdecFrameRate7_496,
};

/* Values for the 'aspect_ratio' field. */
Expand Down Expand Up @@ -363,7 +365,7 @@ enum {

#define VDEC_FLAG_PICTURE_META_DATA_PRESENT (0x40000)

#endif /* _WIN32 || _WIN64 */
#endif /* __LINUX_USER__ */

typedef struct _BC_PIC_INFO_BLOCK {
/* Common fields. */
Expand Down Expand Up @@ -403,6 +405,8 @@ enum _POUT_OPTIONAL_IN_FLAGS_{
BC_POUT_FLAGS_SIZE = 0x04, /* Take size information from Application */
BC_POUT_FLAGS_INTERLACED = 0x08, /* copy only half the bytes */
BC_POUT_FLAGS_INTERLEAVED = 0x10, /* interleaved frame */
BC_POUT_FLAGS_STRIDE_UV = 0x20, /* Stride size is valid (for UV buffers). */
BC_POUT_FLAGS_MODE = 0x40, /* Take output mode from Application, overrides YV12 flag if on */

/* Flags from Device to APP */
BC_POUT_FLAGS_FMT_CHANGE = 0x10000, /* Data is not VALID when this flag is set */
Expand Down Expand Up @@ -457,6 +461,7 @@ typedef struct _BC_DTS_PROC_OUT {
uint8_t b422Mode; /* Picture output Mode */
uint8_t bPibEnc; /* PIB encrypted */
uint8_t bRevertScramble;
uint32_t StrideSzUV; /* Caller supplied Stride Size */

} BC_DTS_PROC_OUT;

Expand Down Expand Up @@ -487,7 +492,11 @@ typedef struct _BC_DTS_STATUS {
* Reported back from the driver */
uint8_t TxBufData;

uint8_t reserved__[15];
uint8_t reserved__[3];

uint32_t picNumFlags; /* Picture number and flags of the next picture to be delivered from the driver */

uint8_t reserved___[8];

} BC_DTS_STATUS;

Expand All @@ -513,6 +522,7 @@ typedef enum _BC_OUTPUT_FORMAT {
OUTPUT_MODE420 = 0x0,
OUTPUT_MODE422_YUY2 = 0x1,
OUTPUT_MODE422_UYVY = 0x2,
OUTPUT_MODE420_NV12 = 0x0,
OUTPUT_MODE_INVALID = 0xFF,
} BC_OUTPUT_FORMAT;

Expand Down Expand Up @@ -584,6 +594,7 @@ typedef struct _BC_INPUT_FORMAT_ {
uint8_t *pMetaData; /*Metadata buffer that is used to pass sequence header*/
uint32_t metaDataSz; /*Metadata size*/
uint8_t bEnableScaling;
BC_SCALING_PARAMS ScalingParams;
} BC_INPUT_FORMAT;

typedef struct _BC_INFO_CRYSTAL_ {
Expand Down
56 changes: 2 additions & 54 deletions lib/libcrystalhd/bc_dts_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@
#include <stdint.h>
#endif

#if defined(_WIN64) || defined(_WIN32)
typedef uint32_t U32;
typedef int32_t S32;
typedef uint16_t U16;
typedef int16_t S16;
typedef unsigned char U8;
typedef char S8;
#endif

#ifndef PVOID
typedef void *PVOID;
#endif
Expand All @@ -46,22 +37,6 @@ typedef void *PVOID;
typedef int BOOL;
#endif

#ifdef WIN32
typedef unsigned __int64 U64;
#elif defined(_WIN64)
typedef uint64_t U64;
#endif

#ifdef _WIN64
#if !(defined(POINTER_32))
#define POINTER_32 __ptr32
#endif
#else /* _WIN32 */
#define POINTER_32
#endif

#if defined(__KERNEL__) || defined(__LINUX_USER__)

#ifdef __LINUX_USER__ /* Don't include these for KERNEL */
typedef uint32_t ULONG;
typedef int32_t LONG;
Expand All @@ -83,38 +58,11 @@ typedef unsigned char *PUCHAR;
#define FALSE 0
#endif

#else
#else /* !__LINUX_USER__ */

/* For Kernel usage.. */
typedef bool bc_bool_t;
#endif

#else

#ifndef uint64_t
// typedef struct _uint64_t {
// uint32_t low_dw;
// uint32_t hi_dw;
// } uint64_t;
typedef unsigned long long uint64_t;
#endif

#ifndef int32_t
typedef signed long int32_t;
#endif

#ifndef uint32_t
typedef unsigned long uint32_t;
#endif

#ifndef uint16_t
typedef unsigned short uint16_t;
#endif

#ifndef uint8_t
typedef unsigned char uint8_t;
#endif
#endif
#endif /* __LINUX_USER__ */

#endif

26 changes: 25 additions & 1 deletion lib/libcrystalhd/libcrystalhd_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ Function name:
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
DtsSetInputFormat must always be called before DtsOpenDecoder for the
decoder to start processing input data. The device must have been
previously opened for this call to succeed.
Expand Down Expand Up @@ -1508,6 +1508,30 @@ DtsCrystalHDVersion(
PBC_INFO_CRYSTAL bCrystalInfo
);

/*****************************************************************************
Function name:
DtsTxFreeSize
Description:
This API returns the amount of free space in the tx circular buffer
Parameters:
hDevice Handle to device. This is obtained via a prior call to
DtsDeviceOpen.
Return:
uint32_t value of number of free bytes in the tx circular buffer
*****************************************************************************/
DRVIFLIB_API uint32_t
DtsTxFreeSize(
HANDLE hDevice
);

#ifdef __cplusplus
}
#endif
Expand Down
82 changes: 82 additions & 0 deletions lib/libcrystalhd/libcrystalhd_version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/********************************************************************
* Copyright(c) 2006-2009 Broadcom Corporation.
*
* Name: libcrystalhd_version.h
*
* Description: Version numbering for the driver use.
*
* AU
*
* HISTORY:
*
********************************************************************
* This header is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 2.1 of the License.
*
* This header is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License
* along with this header. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************/

#ifndef _BC_DTS_VERSION_LNX_
#define _BC_DTS_VERSION_LNX_
//
// The version format that we are adopting is
// MajorVersion.MinorVersion.Revision
// This will be the same for all the components.
//
//
#define STRINGIFY_VERSION(MAJ,MIN,REV) STRINGIFIED_VERSION(MAJ,MIN,REV)
#define STRINGIFIED_VERSION(MAJ,MIN,REV) #MAJ "." #MIN "." #REV

#define STRINGIFY_VERSION_W(MAJ,MIN,REV) STRINGIFIED_VERSION_W(MAJ,MIN,REV)
#define STRINGIFIED_VERSION_W(MAJ,MIN,REV) #MAJ "." #MIN "." #REV

//
// Product Version number is:
// x.y.z.a
//
// x = Major release. 1 = Dozer, 2 = Dozer + Link
// y = Minor release. Should increase +1 per "real" release.
// z = Branch release. 0 for main branch. This is +1 per branch release.
// a = Build number +1 per candidate release. Reset to 0 every "real" release.
//
//
// Enabling Check-In rules enforcement 08092007
//
#define INVALID_VERSION 0xFFFF

/*========================== Common For All Components =================================*/
#define BRCM_MAJOR_VERSION 3

// Note: the driver doesn't currently use these defines, it has its own
// version information (which should match) stored in bc_dts_glob_lnx.h
#define DRIVER_MAJOR_VERSION BRCM_MAJOR_VERSION
#define DRIVER_MINOR_VERSION 8
#define DRIVER_REVISION 0

#define RC_FILE_VERSION STRINGIFY_VERSION(DRIVER_MAJOR_VERSION,DRIVER_MINOR_VERSION,DRIVER_REVISION) ".0"

/*======================= Device Interface Library ========================*/
#define DIL_MAJOR_VERSION BRCM_MAJOR_VERSION
#define DIL_MINOR_VERSION 20
#define DIL_REVISION 0

#define DIL_RC_FILE_VERSION STRINGIFY_VERSION(DIL_MAJOR_VERSION,DIL_MINOR_VERSION,DIL_REVISION)

/*========================== deconf utility ==============================*/
#define DECONF_MAJOR_VERSION BRCM_MAJOR_VERSION
#define DECONF_MINOR_VERSION 9
#define DECONF_REVISION 18
#define DECONF_RC_FILE_VERSION STRINGIFY_VERSION(DIL_MAJOR_VERSION,DIL_MINOR_VERSION,DIL_REVISION)

/*========================== Firmware ==============================*/
#define FW_MAJOR_VERSION BRCM_MAJOR_VERSION
#define FW_MINOR_VERSION 60
#define FW_REVISION 39

#endif

0 comments on commit 073b6f9

Please sign in to comment.