VideoRenderer.h
上传用户:lusi_8715
上传日期:2007-01-08
资源大小:199k
文件大小:3k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. /**************************************************************************************
  2.  *                                                                                    *
  3.  * This application contains code from OpenDivX and is released as a "Larger Work"    *
  4.  * under that license. Consistant with that license, this application is released     *
  5.  * under the GNU General Public License.                                              *
  6.  *                                                                                    *
  7.  * The OpenDivX license can be found at: http://www.projectmayo.com/opendivx/docs.php *
  8.  * The GPL can be found at: http://www.gnu.org/copyleft/gpl.html                      *
  9.  *                                                                                    *
  10.  * Copyright (c) 2001 - Project Mayo                                                  *
  11.  *                                                                                    *
  12.  * Authors: Damien Chavarria <adrc at projectmayo.com>                                *
  13.  *                                                                                    *
  14.  **************************************************************************************/
  15. #ifndef VIDEO_H
  16. #define VIDEO_H
  17. #include "codec.h"
  18. #include <windows.h>
  19.  
  20. #define D3D_OVERLOADS
  21. #include <d3d.h> 
  22. #include <ddraw.h>
  23. #include <d3dtypes.h> 
  24. #include <vfw.h>
  25. #include <stdio.h>
  26. class VideoRenderer {
  27. private:
  28. int codecDepth;
  29. /*
  30.  * Switch
  31.  */
  32. int use_bilinear;
  33. int fullscreen;
  34. int change_fullscreen_res;
  35. /*
  36.  * Fullscreen Variables
  37.  */
  38. int screen_size_x;
  39. int screen_size_y;
  40. int video_width;
  41. int video_height;
  42. /*
  43.  * bilinear FIltering Stuff
  44.  */
  45. LPDIRECTDRAW7        lpDD;
  46. LPDIRECTDRAWSURFACE7 lpDDSPrimary;
  47. LPDIRECTDRAWSURFACE7 lpDDSBack;
  48. LPDIRECTDRAWSURFACE7 lpDDSImage;
  49. LPDIRECT3D7          lpD3D;
  50. LPDIRECT3DDEVICE7    lpDevice;
  51. LPDIRECTDRAWCLIPPER  lpDDClipper;
  52. DDSURFACEDESC2       ddsd;
  53. DDSCAPS              ddscaps;
  54. /*
  55.  * Normal Stuff
  56.  *
  57.  */
  58. LPDIRECTDRAWCLIPPER lpDDClipper1;
  59. HRESULT              ddrval;
  60. HWND                 hwnd;
  61. BITMAPINFOHEADER    *bih;
  62. BOOL restoreAll(void);
  63. int  copyPixels(void *src, void *dst, int in_depth, 
  64.     int out_depth, int width, int height, int pitch);
  65. public:
  66. VideoRenderer();
  67. ~VideoRenderer();
  68. int SetBilinear(int use_bilinear);
  69. int SetChangeFullscreenRes(int change_full);
  70. int Fullscreen(int onOff);
  71. int Open(HWND hwnd, BITMAPINFOHEADER *bih);
  72. int OpenFullscreen(HWND hwnd, BITMAPINFOHEADER *bih);
  73. int GetVideoMode();
  74. int SetCodecVideoMode(int depth);
  75. int Draw(char *buffer, int has_subtitles);
  76. int DrawFullscreen(char *buffer);
  77. int Close();
  78. };
  79. #endif