on2rvdecapi.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /*------------------------------------------------------------------------------
  2. -- --
  3. -- This software is confidential and proprietary and may be used --
  4. -- only as expressly authorized by a licensing agreement from --
  5. -- --
  6. -- Hantro Products Oy. --
  7. -- --
  8. -- (C) COPYRIGHT 2007 HANTRO PRODUCTS OY --
  9. -- ALL RIGHTS RESERVED --
  10. -- --
  11. -- The entire notice above must be reproduced --
  12. -- on all copies and should not be removed. --
  13. -- --
  14. --------------------------------------------------------------------------------
  15. --
  16. -- Description : API for the 8190 RV Decoder
  17. --
  18. --------------------------------------------------------------------------------
  19. --
  20. -- Version control information, please leave untouched.
  21. --
  22. -- $RCSfile: on2rvdecapi.h,v $
  23. -- $Date: 2010/02/24 08:25:12 $
  24. -- $Revision: 1.3 $
  25. --
  26. ------------------------------------------------------------------------------*/
  27. #ifndef __ON2RVDECAPI_H__
  28. #define __ON2RVDECAPI_H__
  29. #ifdef __cplusplus
  30. extern "C"
  31. {
  32. #endif
  33. #include "basetype.h"
  34. /* return values */
  35. #define MAKE_RESULT(sev,fac,code) \
  36. (((u32)sev << 31) | ((u32)4 << 16) | ((fac<<6) | (code)))
  37. #define ON2RVDEC_OK MAKE_RESULT(0,0,0x0000)
  38. #define ON2RVDEC_OUTOFMEMORY MAKE_RESULT(1,7,0x000e)
  39. #define ON2RVDEC_INVALID_PARAMETER MAKE_RESULT(1,7,0x0057)
  40. #define ON2RVDEC_NOTIMPL MAKE_RESULT(1,0,0x4001)
  41. #define ON2RVDEC_POINTER MAKE_RESULT(1,0,0x4003)
  42. #define ON2RVDEC_FAIL MAKE_RESULT(1,0,0x4005)
  43. typedef u32 On2RvDecRet;
  44. /* custom message handling */
  45. #define ON2RV_MSG_ID_Set_RVDecoder_RPR_Sizes 36
  46. typedef u32 On2RvCustomMessage_ID;
  47. typedef struct
  48. {
  49. On2RvCustomMessage_ID message_id;
  50. u32 num_sizes;
  51. u32 *sizes;
  52. } On2RvMsgSetDecoderRprSizes;
  53. /* input and output flag definitions */
  54. #define ON2RV_DECODE_MORE_FRAMES 0x00000001
  55. #define ON2RV_DECODE_DONT_DRAW 0x00000002
  56. #define ON2RV_DECODE_KEY_FRAME 0x00000004
  57. #define ON2RV_DECODE_B_FRAME 0x00000008
  58. #define ON2RV_DECODE_LAST_FRAME 0x00000200
  59. /* input and output structures */
  60. typedef struct
  61. {
  62. i32 bIsValid;
  63. u32 ulSegmentOffset;
  64. } codecSegmentInfo;
  65. typedef struct
  66. {
  67. u32 dataLength;
  68. i32 bInterpolateImage;
  69. u32 numDataSegments;
  70. codecSegmentInfo *pDataSegments;
  71. u32 flags;
  72. u32 timestamp;
  73. u32 streamBusAddr;
  74. } On2DecoderInParams;
  75. typedef struct
  76. {
  77. u32 numFrames;
  78. u32 notes;
  79. u32 timestamp;
  80. u32 width;
  81. u32 height;
  82. u8 *pOutFrame;
  83. } On2DecoderOutParams;
  84. /* decoder initialization structure */
  85. typedef struct
  86. {
  87. u16 outtype;
  88. u16 pels;
  89. u16 lines;
  90. u16 nPadWidth;
  91. u16 nPadHeight;
  92. u16 pad_to_32;
  93. u32 ulInvariants;
  94. i32 packetization;
  95. u32 ulStreamVersion;
  96. } On2DecoderInit;
  97. /* decoding function */
  98. On2RvDecRet On2RvDecDecode(u8 *pRV10Packets,
  99. u8 *pDecodedFrameBuffer, /* unused */
  100. void *pInputParams,
  101. void *pOutputParams,
  102. void *decInst);
  103. /* initialization function */
  104. On2RvDecRet On2RvDecInit(void *pRV10Init,
  105. void **pDecInst);
  106. /* release function */
  107. On2RvDecRet On2RvDecFree(void *decInst);
  108. /* custom message handling function. Only Set_RPR_Sizes message implemented */
  109. On2RvDecRet On2RvDecCustomMessage(void *msg_id, void *decInst);
  110. /* unused, always returns DEC_NOTIMPL */
  111. On2RvDecRet On2RvDecHiveMessage(void *msg, void *decInst);
  112. /* function to obtain last decoded picture out from the decoder */
  113. On2RvDecRet On2RvDecPeek(void *pOutputParams, void *decInst);
  114. #ifdef __cplusplus
  115. }
  116. #endif
  117. #endif /* __ON2RVDECAPI_H__ */