Playback.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 PLAYBACK_H
  16. #define PLAYBACK_H
  17. #include "debug.h"
  18. #include "AviDecaps.h"
  19. #include "Codec.h"
  20. #include "VideoRenderer.h"
  21. #include "AudioCodec.h"
  22. #include "AudioRenderer.h"
  23. #include "VideoBuffer.h"
  24. #include "Subtitles.h"
  25. #include <windows.h>
  26. #include <winbase.h>
  27. #include <windowsx.h>
  28. /*
  29.  * Main Class
  30.  */
  31. class Playback {
  32. public:
  33. int            ok;
  34. int            playing;
  35. int            paused;
  36. int            volume;
  37. int            use_bilinear;
  38. int            fullscreen;
  39. int            fast_forward;
  40. int            rewind;
  41. int            has_subtitles;
  42. int            use_subtitles;
  43. int            loop;
  44. DWORD          baseTime;
  45. DWORD          stopTime;
  46. HANDLE         playbackMutex;
  47. HANDLE         videoThread;
  48. DWORD          id;
  49. HWND           hwnd;
  50. AviDecaps     *decaps;
  51. Codec         *codec;
  52. VideoRenderer *videoRenderer;
  53. AudioCodec    *audioCodec;
  54. AudioRenderer *audioRenderer;
  55. VideoBuffer   *videoBuffer;
  56. Subtitles     *subtitles;
  57. unsigned long video_frames;
  58. unsigned long displayed_frames;
  59. unsigned long audio_bytes;
  60. Playback();
  61. ~Playback();
  62. int Open(char *lpFilename, int type, HWND hwnd);
  63. int OK();
  64. int  Width();
  65. int  Height();
  66. unsigned long VideoTime();
  67. unsigned long AudioTime();
  68. BOOL   isPaused();
  69. BOOL   isPlaying();
  70. int    Play();
  71. int    Pause();
  72. int    NextFrame();
  73. int    Stop(int redraw);
  74. int    Close();
  75. int    FastForward();
  76. int    Rewind();
  77. int    Seek(int percent);
  78. int    SetVolume(int volume);
  79. int    SetLoop(int loop);
  80. double    GetProgress();
  81. int    GetTime();
  82. int    GetTotalTime();
  83. double GetCurrentFps();
  84. int    GetBufferingState();
  85. int    SetBilinear(int use_bilinear);
  86. int    SetChangeFullscreenRes(int change);
  87. int    SetUseSubtitles(int useSubtitles);
  88. int    Fullscreen(int active);
  89. int    isInFullscreen();
  90. };
  91. #endif