video.h
上传用户:wstnjxml
上传日期:2014-04-03
资源大小:7248k
文件大小:6k
源码类别:

Windows CE

开发平台:

C/C++

  1. /*****************************************************************************
  2.  *
  3.  * This program is free software ; you can redistribute it and/or modify
  4.  * it under the terms of the GNU General Public License as published by
  5.  * the Free Software Foundation; either version 2 of the License, or
  6.  * (at your option) any later version.
  7.  *
  8.  * This program is distributed in the hope that it will be useful,
  9.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11.  * GNU General Public License for more details.
  12.  *
  13.  * You should have received a copy of the GNU General Public License
  14.  * along with this program; if not, write to the Free Software
  15.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  16.  *
  17.  * $Id: video.h 585 2006-01-16 09:48:55Z picard $
  18.  *
  19.  * The Core Pocket Media Player
  20.  * Copyright (c) 2004-2005 Gabor Kovacs
  21.  *
  22.  ****************************************************************************/
  23. #ifndef __VIDEO_H
  24. #define __VIDEO_H
  25. //---------------------------------------------------------------
  26. //pixelformat flags
  27. #define PF_FOURCC 0x0001
  28. #define PF_PALETTE 0x0002
  29. #define PF_RGB 0x0004
  30. #define PF_YUV 0x0008
  31. #define PF_INVERTED 0x0020
  32. #define PF_READONLY 0x0040
  33. #define PF_FRAGMENTED 0x0080
  34. #define PF_PIXELDOUBLE 0x0100
  35. #define PF_16BITACCESS 0x0200
  36. #define PF_16ALIGNED 0x0400
  37. #define PF_SAFEBORDER 0x0800
  38. #define PF_NOPREROTATE 0x4000
  39. #define PF_GRAYSCALE 0x8000
  40. #define PF_PTS 0x20000
  41. #define PV_YUV_TV 0x00000
  42. #define PF_YUV_PC 0x40000
  43. #define PF_YUV_BT601 0x00000
  44. #define PF_YUV_BT709 0x80000
  45. #define PF_YUV420 0x0010
  46. #define PF_YUV422 0x1000
  47. #define PF_YUV444 0x2000
  48. #define PF_YUV410 0x10000
  49. //---------------------------------------------------------------
  50. //private rgb fourcc
  51. #define FOURCC_RGB32  FOURCC('R','3','2','_')
  52. #define FOURCC_RGB24  FOURCC('R','2','4','_')
  53. #define FOURCC_RGB16  FOURCC('R','1','6','_')
  54. #define FOURCC_RGB15  FOURCC('R','1','5','_')
  55. #define FOURCC_BGR32  FOURCC('B','3','2','_')
  56. #define FOURCC_BGR24  FOURCC('B','2','4','_')
  57. #define FOURCC_BGR16  FOURCC('B','1','6','_')
  58. #define FOURCC_BGR15  FOURCC('B','1','5','_')
  59. //---------------------------------------------------------------
  60. //planar YUV420 formats
  61. #define FOURCC_YV12  FOURCC('Y','V','1','2')
  62. #define FOURCC_IYUV  FOURCC('I','Y','U','V')
  63. #define FOURCC_I420  FOURCC('I','4','2','0')
  64. #define FOURCC_IMC2  FOURCC('I','M','C','2')
  65. #define FOURCC_IMC4  FOURCC('I','M','C','4')
  66. //planar YUV422 formats
  67. #define FOURCC_YV16  FOURCC('Y','V','1','6')
  68. //planar YUV410 formats
  69. #define FOURCC_YVU9  FOURCC('Y','V','U','9')
  70. #define FOURCC_YUV9  FOURCC('Y','U','V','9')
  71. //---------------------------------------------------------------
  72. //packed YUV formats
  73. #define FOURCC_YUY2  FOURCC('Y','U','Y','2')
  74. #define FOURCC_YUNV  FOURCC('Y','U','N','V')
  75. #define FOURCC_V422  FOURCC('V','4','2','2')
  76. #define FOURCC_YUYV  FOURCC('Y','U','Y','V')
  77. #define FOURCC_YVYU  FOURCC('Y','V','Y','U')
  78. #define FOURCC_UYVY  FOURCC('U','Y','V','Y')
  79. #define FOURCC_Y422 FOURCC('Y','4','2','2')
  80. #define FOURCC_UYNV FOURCC('U','Y','N','V')
  81. #define FOURCC_VYUY  FOURCC('V','Y','U','Y')
  82. //---------------------------------------------------------------
  83. //direction flags
  84. #define DIR_SWAPXY 0x001
  85. #define DIR_MIRRORLEFTRIGHT 0x002
  86. #define DIR_MIRRORUPDOWN 0x004
  87. //---------------------------------------------------------------
  88. //vide caps
  89. #define VC_DITHER 0x0001
  90. #define VC_BRIGHTNESS 0x0002
  91. #define VC_CONTRAST 0x0004
  92. #define VC_SATURATION 0x0008
  93. #define VC_RGBADJUST 0x0010
  94. #define SCALE_ONE (1<<16)
  95. #define ASPECT_ONE (1<<16)
  96. #define ASPECT_RATIO(num,den)  ((int)(((int64_t)num<<16)/den))
  97. typedef uint32_t rgbval_t;
  98. #define CRGB(r,g,b) INT32LE((r)|((g)<<8)|((b)<<16))
  99. #define RGB_NULL ((rgbval_t)-1)
  100. typedef union rgb
  101. {
  102. struct 
  103. {
  104. uint8_t r;
  105. uint8_t g;
  106. uint8_t b;
  107. uint8_t a;
  108. } c;
  109. uint8_t ch[4];
  110. rgbval_t v;
  111. } rgb;
  112. typedef struct point
  113. {
  114. int x;
  115. int y;
  116. } point;
  117. typedef struct rect
  118. {
  119. int x;
  120. int y;
  121. int Width;
  122. int Height;
  123. } rect;
  124. typedef struct pixel
  125. {
  126. int Flags;
  127. uint32_t FourCC;
  128. int BitCount;
  129. uint32_t BitMask[3];
  130. rgb *Palette;
  131. } pixel;
  132. typedef struct video
  133. {
  134. int Direction; // direction flags
  135. int Aspect; // 16.16 fixed point
  136. int Width; // phyisical width of surface
  137. int Height; // phyisical height of surface
  138. int Pitch;
  139. pixel Pixel;
  140. } video;
  141. //---------------------------------------------------------------
  142. #define VBUFFER_ID FOURCC('V','B','U','F')
  143. //---------------------------------------------------------------
  144. // video output (abstract)
  145. #define VOUT_CLASS FOURCC('V','O','U','T')
  146. #define VOUT_IDCT_CLASS(n) INT32BE((INT32BE(n) & ~0xFF)|'I')
  147. // primary display (bool_t readonly)
  148. #define VOUT_PRIMARY 0x70
  149. // hardware accelerated idct (idct* readonly)
  150. #define VOUT_IDCT 0x74
  151. // allow showahead display or not
  152. #define VOUT_PLAY 0x7D
  153. // blit fx options (blitfx)
  154. #define VOUT_FX 0x75
  155. // window handle (int)
  156. #define VOUT_WND 0x76
  157. // overlay visible (bool_t)
  158. #define VOUT_VISIBLE 0x77
  159. // gui clipping needed (bool_t)
  160. #define VOUT_CLIPPING 0x7F
  161. // viewport rectangle (rect)
  162. #define VOUT_VIEWPORT 0x78
  163. // actuall output rectangle (rect readonly)
  164. #define VOUT_OUTPUTRECT 0x79
  165. // color key (rgb)
  166. #define VOUT_COLORKEY 0x7A
  167. // prerotate portrait input
  168. #define VOUT_AUTOPREROTATE 0x7C
  169. // aspect ratio
  170. #define VOUT_ASPECT 0x81
  171. // reset
  172. #define VOUT_RESET 0x80
  173. // voutput caps
  174. #define VOUT_CAPS 0x84
  175. // begin/end update (bool_t)
  176. #define VOUT_UPDATING 0x85
  177. // overlay display (bool_t readonly)
  178. #define VOUT_OVERLAY 0x86
  179. // fullscren
  180. #define VOUT_FULLSCREEN 0x87
  181. #define VOUT_ERROR_SIZE 0x100
  182. void Video_Init();
  183. void Video_Done();
  184. int VOutEnum(void* p, int* No, datadef* Param);
  185. DLL bool_t VOutIDCT(int Class);
  186. #endif