2315
|
1 #pragma once
|
|
2
|
|
3 namespace Media
|
|
4 {
|
|
5 class ITrack
|
|
6 {
|
|
7 public: virtual void Play(bool loop = false) = 0;
|
|
8 };
|
|
9
|
|
10 class IMovie
|
|
11 {
|
|
12 public: virtual void Play() = 0;
|
|
13 virtual void GetNextFrame(double dt, void *target_surface) = 0;
|
|
14 };
|
|
15
|
2356
|
16 class MPlayer
|
2315
|
17 {
|
|
18 public:
|
2356
|
19 MPlayer();
|
|
20 virtual ~MPlayer();
|
2315
|
21
|
|
22 ITrack *LoadTrack(const wchar_t *name);
|
|
23 IMovie *LoadMovie(const wchar_t *name, int width, int height, int cache_ms);
|
2345
|
24 IMovie *LoadMovieFromLOD(HANDLE h, int readFunction(void*, uint8_t*, int), int64_t seekFunction(void*, int64_t, int), int width, int height);
|
2315
|
25 };
|
2345
|
26 };
|
|
27
|
2356
|
28 extern Media::MPlayer *pMediaPlayer;
|
|
29 extern Media::IMovie *pMovie;
|
|
30 extern Media::ITrack *pTrack;
|
|
31
|
2345
|
32 extern bool end_current_file;
|
|
33 extern bool loop_current_file;
|
|
34 extern DWORD time_video_begin;
|
|
35 extern int current_movie_width;
|
|
36 extern int current_movie_height;
|
2347
|
37
|
2359
|
38 extern int mSourceID;
|
|
39
|
2347
|
40 int64_t seekFunction(void* opaque, int64_t offset, int whence);
|
2356
|
41 extern void PlayMovie(const wchar_t * pFilename);
|
|
42 extern void PlayAudio(const wchar_t * pFilename);
|
2347
|
43
|
2356
|
44 //////////////////////////////////////////////////////////////////////////
|
|
45 //Included from a VideoPlayer.h file/вставлено из файла VideoPlayer.h/
|
|
46 //////////////////////////////////////////////////////////////////////////
|
|
47
|
|
48 //used in void VideoPlayer::Initialize(OSWindow *target_window) for open .vid files
|
|
49 struct MovieHeader
|
|
50 {
|
|
51 char pVideoName[40];
|
|
52 unsigned int uFileOffset;
|
|
53 };
|
|
54
|
|
55 extern MovieHeader *pMightVideoHeaders;
|
|
56 extern MovieHeader *pMagicVideoHeaders;
|
|
57 extern HANDLE hMightVid;
|
|
58 extern HANDLE hMagicVid;
|
|
59 extern unsigned __int64 uBinkVersion;
|
|
60 extern unsigned int uNumMightVideoHeaders;
|
|
61 extern unsigned int uNumMagicVideoHeaders;
|
|
62 // |