VideoBuffer.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 _VIDEO_BUFFER_H
  16. #define _VIDEO_BUFFER_H
  17. #include "AviDecaps.h"
  18. #include "Codec.h"
  19. #define BUFFER_SIZE            5
  20. #define VIDEO_BUFFER_SIZE 100000
  21. enum {
  22. VIDEO_BUFFER_ACTIVE,
  23. VIDEO_BUFFER_INACTIVE,
  24. };
  25. class VideoBuffer {
  26. public:
  27. AviDecaps *decaps;
  28. Codec     *codec;
  29. char      *frames[BUFFER_SIZE];
  30. char      *input_buffer;
  31. int        free_slots;
  32. int        frame_size;
  33. int        running;
  34. HANDLE     fillThread;
  35. DWORD      id;
  36. HANDLE     mutex;
  37. DWORD      mode;
  38. VideoBuffer(AviDecaps *decaps, Codec *codec);
  39. ~VideoBuffer();
  40. void Start();
  41. void Stop();
  42. char *GiveMeAFrame();
  43. void  Drop();
  44. };
  45. #endif