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

流媒体/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 CODEC_H
  16. #define CODEC_H
  17. #include <stdio.h>
  18. #include <io.h>
  19. #include <windows.h>
  20. #include <vfw.h>
  21. #include "debug.h"
  22. #include "decore.h"
  23. /*
  24.  * Video modes enum
  25.  */
  26. enum {
  27. VIDEO_MODE_ERROR,
  28. VIDEO_MODE_RGB16,
  29. VIDEO_MODE_RGB24,
  30. VIDEO_MODE_RGB32,
  31. /*
  32.  * Add YUV modes here
  33.  */
  34. };
  35. class Codec {
  36. private:
  37. /*
  38.  * for VFW codecs
  39.  */
  40. HIC        hic;
  41. BITMAPINFO in_bih;
  42. BITMAPINFO out_bih;
  43. /*
  44.  * for the DIVX codec
  45.  */
  46. DEC_SET   dec_set;
  47. DEC_PARAM dec_param;
  48. DEC_FRAME dec_frame;
  49. /*
  50.  * Video Mode  
  51.  */
  52. int   videoMode;
  53. DWORD divx;
  54. public:
  55. Codec(BITMAPINFOHEADER *bih);
  56. ~Codec();
  57. int IsOK();
  58. int Decompress(char *in, long in_size, char *out);
  59. int Drop(char *in, long in_size, char *out);
  60. int GetVideoMode();
  61. int SetVideoMode(int depth);
  62. char *GetCodecName();
  63. int Close();
  64. };
  65. #endif