| 1 | /**************************************************************************** |
|---|
| 2 | * Copyright (c) 2004 DST Technologies Inc. All Rights Reserved. |
|---|
| 3 | * |
|---|
| 4 | * Module: dsthhalvideo.h |
|---|
| 5 | * |
|---|
| 6 | * Description: DST HAL VIDEO Interface function definition |
|---|
| 7 | * |
|---|
| 8 | * |
|---|
| 9 | * |
|---|
| 10 | * notes: jfet0525 |
|---|
| 11 | * |
|---|
| 12 | ***************************************************************************/ |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | #if !defined (_DSTHALERROR_H_) |
|---|
| 16 | #define _DSTHALERROR_H_ |
|---|
| 17 | |
|---|
| 18 | #if defined __cplusplus |
|---|
| 19 | extern "C" { |
|---|
| 20 | #endif |
|---|
| 21 | |
|---|
| 22 | typedef enum { |
|---|
| 23 | DHL_SYS=1, /* 1 */ |
|---|
| 24 | DHL_DMX, /* 2 */ |
|---|
| 25 | DHL_DTV, /* 3 */ |
|---|
| 26 | DHL_FE, /* 4 */ |
|---|
| 27 | DHL_DEV, /* 5 */ |
|---|
| 28 | DHL_COMM, /* 6 */ |
|---|
| 29 | DHL_CAP, /* 7 */ |
|---|
| 30 | DHL_UTIL /* 8 */ |
|---|
| 31 | } DHL_COMPONENT; |
|---|
| 32 | |
|---|
| 33 | #define DHL_COMPONENT_BASE(x) (x<<16) |
|---|
| 34 | |
|---|
| 35 | typedef enum { |
|---|
| 36 | DHL_OK=0, |
|---|
| 37 | DHL_FAIL, /* 0x01 - Generic Failure -------------- */ |
|---|
| 38 | |
|---|
| 39 | DHL_FAIL_NULL_POINTER, /* 0x02 - passed NULL pointer ---------- */ |
|---|
| 40 | DHL_FAIL_INVALID_COMPONENT, /* 0x03 - invalid component name used -- */ |
|---|
| 41 | DHL_FAIL_INVALID_HANDLE, /* 0x04 - Passed wrong handle or Id. --- */ |
|---|
| 42 | DHL_FAIL_INVALID_STREAM, /* 0x05 - invalid or wrong stream_id use */ |
|---|
| 43 | DHL_FAIL_INVALID_POWER_MODE, /* 0x06 - wrong component power mode use */ |
|---|
| 44 | DHL_FAIL_INVALID_SIZE, /* 0x07 - wrong input buffer/struct size */ |
|---|
| 45 | DHL_FAIL_INVALID_PARAM, /* 0x08 - invalid API input argument use */ |
|---|
| 46 | DHL_FAIL_INVALID_NAME, /* 0x09 - invalid component object name */ |
|---|
| 47 | |
|---|
| 48 | DHL_FAIL_OUT_OF_RESOURCE, /* 0x0A - allHW resources already in use */ |
|---|
| 49 | DHL_FAIL_OUT_OF_RANGE, /* 0x0B - input parameter out of range */ |
|---|
| 50 | |
|---|
| 51 | DHL_FAIL_TOO_MANY_INSTANCES, /* 0x0C - additional instance is invalid */ |
|---|
| 52 | DHL_FAIL_BUFFER_TOO_SMALL, /* 0x0D - small allocated input buffer */ |
|---|
| 53 | |
|---|
| 54 | DHL_FAIL_CORE_DRIVER, /* 0x0E - Lower Device Driver failure -- */ |
|---|
| 55 | DHL_FAIL_EXCEED_CAPS, /* 0x0F - capabilities not supported --- */ |
|---|
| 56 | DHL_FAIL_NOT_CONNECTED, /* 0x10 - connect first, before any use */ |
|---|
| 57 | DHL_FAIL_STILL_CONNECTED, /* 0x11 - disconnect first, before go on */ |
|---|
| 58 | DHL_FAIL_NOT_STREAMING, /* 0x12 - start streaming API not called */ |
|---|
| 59 | DHL_FAIL_STILL_STREAMING, /* 0x13 - stop streaming before this API */ |
|---|
| 60 | DHL_FAIL_CONNECTION_FAILS, /* 0x14 - failure at downstream connect */ |
|---|
| 61 | DHL_FAIL_RESOURCE_ATTACHED, /* 0x15 - can't close, resource attached */ |
|---|
| 62 | DHL_FAIL_NO_HARDWARE_SUPPORT, /* 0x16 - feature not supported by ASIC */ |
|---|
| 63 | DHL_FAIL_NO_HARDWARE_ACCESS, /* 0x17 - feature blocked by HWSW design */ |
|---|
| 64 | DHL_FAIL_BUSY, /* 0x18 - resource is busy, try later... */ |
|---|
| 65 | DHL_FAIL_NOT_SHARED, /* 0x19 - resource can't be shared ... */ |
|---|
| 66 | DHL_FAIL_NOT_IMPLEMENTED, /* 0x1A - API is not implemented yet ... */ |
|---|
| 67 | DHL_FAIL_NOT_INITIALIZED, /* 0x1B - attempt to use before init ... */ |
|---|
| 68 | DHL_FAIL_GENERIC, /* 0x1C - any other freestyle error type */ |
|---|
| 69 | DHL_FAIL_OBSOLETE_API, /* 0x1D - API has been replaced with newer API */ |
|---|
| 70 | DHL_FAIL_STANDBY, /* 0x1E - Clock(s) associated with a component is OFF */ |
|---|
| 71 | |
|---|
| 72 | /*2004.06.03. added by jina.*/ |
|---|
| 73 | DHL_FAIL_TIMEOUT, /* 0x1F - Timeout occured.*/ |
|---|
| 74 | DHL_FAIL_NOT_FOUND, /* 0x20 - Not found.*/ |
|---|
| 75 | DHL_FAIL_NOT_AVAILABLE, /* 0x21 - Not avaiable to use.*/ |
|---|
| 76 | DHL_FAIL_INVALID_STATE, /* 0x22 - Inavlid state to do something.*/ |
|---|
| 77 | |
|---|
| 78 | DHL_FAIL_INVALID_TABLEID, /* 0x23 - Invalid tableId.*/ |
|---|
| 79 | DHL_FAIL_INVALID_VERSION, /* 0x24 - Invalid versionNumber.*/ |
|---|
| 80 | DHL_WARN_SCRAMBLED, /* 0x25 - CA descriptor exist in PMT.*/ |
|---|
| 81 | DHL_FAIL_NO_SIGNAL, /* 0x26 - the signal is no activity" */ |
|---|
| 82 | DHL_FAIL_CANCELLED, |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | /*************************************************************************/ |
|---|
| 86 | DHL_SYS_BASE = DHL_COMPONENT_BASE( DHL_SYS ), |
|---|
| 87 | |
|---|
| 88 | /*************************************************************************/ |
|---|
| 89 | DHL_DMX_BASE = DHL_COMPONENT_BASE( DHL_DMX ), |
|---|
| 90 | |
|---|
| 91 | /*************************************************************************/ |
|---|
| 92 | DHL_DTV_BASE = DHL_COMPONENT_BASE( DHL_DTV ), /*0x30000 - AV BASE */ |
|---|
| 93 | DHL_DTV_FAIL_OPEN, /*0x30001 - AV COMPs open fail */ |
|---|
| 94 | DHL_DTV_FAIL_INIT, /*0x30002 - AV COMPs init fail */ |
|---|
| 95 | DHL_DTV_FAIL_CONNECT, /*0x30003 - AV COMPs connect fail */ |
|---|
| 96 | DHL_DTV_FAIL_START, /*0x30004 - AV COMPs start fail */ |
|---|
| 97 | DHL_DTV_FAIL_STOP, /*0x30005 - AV COMPs stop fail */ |
|---|
| 98 | DHL_DTV_FAIL_DISCONNECT, /*0x30006 - AV COMPs disconnect fail*/ |
|---|
| 99 | DHL_DTV_FAIL_CLOSE, /*0x30007 - AV COMPs close fail */ |
|---|
| 100 | DHL_DTV_FAIL_GET_V_FIFO_DEPTH = 0x30008, /*0x30008 - GET THE VIDEO ALIVE INFO. fail*/ |
|---|
| 101 | DHL_DTV_FAIL_GET_A_FIFO_DEPTH = 0x30010, /*0x30010 - GET THE AUDIO ALIVE INFO. fail*/ |
|---|
| 102 | |
|---|
| 103 | /*************************************************************************/ |
|---|
| 104 | DHL_FE_BASE = DHL_COMPONENT_BASE( DHL_FE ), |
|---|
| 105 | |
|---|
| 106 | /*************************************************************************/ |
|---|
| 107 | DHL_DEV_BASE = DHL_COMPONENT_BASE( DHL_DEV ), |
|---|
| 108 | DHL_DEV_FAIL_NOTALIGN, |
|---|
| 109 | |
|---|
| 110 | /*************************************************************************/ |
|---|
| 111 | DHL_COMM_BASE = DHL_COMPONENT_BASE( DHL_COMM ), |
|---|
| 112 | |
|---|
| 113 | /*************************************************************************/ |
|---|
| 114 | DHL_CAP_BASE = DHL_COMPONENT_BASE( DHL_CAP ), |
|---|
| 115 | |
|---|
| 116 | /*************************************************************************/ |
|---|
| 117 | DHL_UTIL_BASE = DHL_COMPONENT_BASE( DHL_UTIL ), |
|---|
| 118 | DHL_UTIL_FAIL_COMMERR, /* Communication Error */ |
|---|
| 119 | DHL_UTIL_FAIL_CHECKSUMERR, /* Checksum Error */ |
|---|
| 120 | DHL_UTIL_FAIL_ERASEERR, /* Erase Error */ |
|---|
| 121 | DHL_UTIL_FAIL_PROGRAMERR, /* Write Error */ |
|---|
| 122 | DHL_UTIL_FAIL_VERIFYERR, /* Verify Error */ |
|---|
| 123 | DHL_UTIL_FAIL_INVALIDPKTSIZE, /* Invalid Packet Size */ |
|---|
| 124 | DHL_UTIL_FAIL_INVALIDAREA, /* Invalid Area */ |
|---|
| 125 | DHL_UTIL_FAIL_CRCERR, /* CRC32 Error */ |
|---|
| 126 | |
|---|
| 127 | DHL_FAIL_COMMON_LAST |
|---|
| 128 | |
|---|
| 129 | } DHL_RESULT; |
|---|
| 130 | |
|---|
| 131 | #define DHL_ERROR(x) (x!=DHL_OK) |
|---|
| 132 | |
|---|
| 133 | #ifndef SysASSERT |
|---|
| 134 | #define SysASSERT(cond) do { if (!(cond)) { fprintf(stderr, "|%s:%d| ASSERT failed.\n", __FUNCTION__, __LINE__); } } while(0) |
|---|
| 135 | #endif |
|---|
| 136 | |
|---|
| 137 | #ifndef SysREQUIRE |
|---|
| 138 | #define SysREQUIRE(cond) do { if (!(cond)) { fprintf(stderr, "|%s:%d| REQUIRE failed.\n", __FUNCTION__, __LINE__); } } while(0) |
|---|
| 139 | #endif |
|---|
| 140 | |
|---|
| 141 | #ifndef SysENSURE |
|---|
| 142 | # if 0 |
|---|
| 143 | # define SysENSURE(cond) do { if ((cond)) { fprintf(stderr, "|%s:%d| Success.\n", __FUNCTION__); } \ |
|---|
| 144 | else { fprintf(stderr, "|%s:%d| Failure.\n", __FUNCTION__); } while(0) |
|---|
| 145 | # else |
|---|
| 146 | # define SysENSURE(cond) do { if (!(cond)) { fprintf(stderr, "|%s:%d| Failure.\n", __FUNCTION__, __LINE__); } } while (0) |
|---|
| 147 | # endif |
|---|
| 148 | #endif |
|---|
| 149 | |
|---|
| 150 | #ifndef SysCHECK |
|---|
| 151 | #define SysCHECK(cond) do { if (!(cond)) { fprintf(stderr, "|%s:%d| CHECK failed.\n", __FUNCTION__, __LINE__); } } while(0) |
|---|
| 152 | #endif |
|---|
| 153 | |
|---|
| 154 | #ifndef SysIMPLIES |
|---|
| 155 | #define SysIMPLIES(c1, c2) do { if ((c1)) { if (!(c2)) { fprintf(stderr, "|%s:%d| IMPLIES failed.\n", __FUNCTION__, __LINE__); } } } while(0) |
|---|
| 156 | #endif |
|---|
| 157 | |
|---|
| 158 | #ifndef SysNEVER_GET_HERE |
|---|
| 159 | #define SysNEVER_GET_HERE() do { fprintf(stderr, "|%s:%d| NEVER GET HERE!\n", __FUNCTION__, __LINE__); } while(0) |
|---|
| 160 | #endif |
|---|
| 161 | |
|---|
| 162 | #if defined __cplusplus |
|---|
| 163 | } |
|---|
| 164 | #endif |
|---|
| 165 | |
|---|
| 166 | #endif /* _DSTHALERROR_H_ */ |
|---|
| 167 | |
|---|