Mercurial > mm7
annotate MediaPlayer.h @ 2438:c10c639f8365
* Fixed releasing movie for movie-less transitions.
author | a.parshin |
---|---|
date | Thu, 24 Jul 2014 00:31:49 +0300 |
parents | cb66a1082fcf |
children | 90349b8048a5 |
rev | line source |
---|---|
2315 | 1 #pragma once |
2 | |
3 namespace Media | |
4 { | |
5 class ITrack | |
6 { | |
2391 | 7 public: |
2430
cb66a1082fcf
* ITrack, IMovie now properly propogate destructors
a.parshin
parents:
2406
diff
changeset
|
8 virtual ~ITrack() {} |
cb66a1082fcf
* ITrack, IMovie now properly propogate destructors
a.parshin
parents:
2406
diff
changeset
|
9 |
cb66a1082fcf
* ITrack, IMovie now properly propogate destructors
a.parshin
parents:
2406
diff
changeset
|
10 virtual void Play(bool loop = false) = 0; |
cb66a1082fcf
* ITrack, IMovie now properly propogate destructors
a.parshin
parents:
2406
diff
changeset
|
11 virtual void Release() = 0; |
2315 | 12 }; |
13 | |
14 class IMovie | |
15 { | |
2391 | 16 public: |
2430
cb66a1082fcf
* ITrack, IMovie now properly propogate destructors
a.parshin
parents:
2406
diff
changeset
|
17 virtual ~IMovie() {} |
cb66a1082fcf
* ITrack, IMovie now properly propogate destructors
a.parshin
parents:
2406
diff
changeset
|
18 |
cb66a1082fcf
* ITrack, IMovie now properly propogate destructors
a.parshin
parents:
2406
diff
changeset
|
19 virtual void Play() = 0; |
cb66a1082fcf
* ITrack, IMovie now properly propogate destructors
a.parshin
parents:
2406
diff
changeset
|
20 virtual void GetNextFrame(double dt, void *target_surface) = 0; |
cb66a1082fcf
* ITrack, IMovie now properly propogate destructors
a.parshin
parents:
2406
diff
changeset
|
21 virtual void Release() = 0; |
2315 | 22 }; |
23 | |
2356 | 24 class MPlayer |
2315 | 25 { |
26 public: | |
2356 | 27 MPlayer(); |
28 virtual ~MPlayer(); | |
2315 | 29 |
30 ITrack *LoadTrack(const wchar_t *name); | |
31 IMovie *LoadMovie(const wchar_t *name, int width, int height, int cache_ms); | |
2345 | 32 IMovie *LoadMovieFromLOD(HANDLE h, int readFunction(void*, uint8_t*, int), int64_t seekFunction(void*, int64_t, int), int width, int height); |
2315 | 33 }; |
2345 | 34 }; |
35 | |
2356 | 36 extern Media::MPlayer *pMediaPlayer; |
2394 | 37 extern Media::IMovie *pMovie_Track; |
38 extern Media::ITrack *pAudio_Track; | |
2360 | 39 extern class Movie *movie; |
2356 | 40 |
2345 | 41 extern bool end_current_file; |
42 extern bool loop_current_file; | |
43 extern DWORD time_video_begin; | |
44 extern int current_movie_width; | |
45 extern int current_movie_height; | |
2347 | 46 |
2359 | 47 extern int mSourceID; |
48 | |
2360 | 49 //int64_t seekFunction(void* opaque, int64_t offset, int whence); |
2356 | 50 extern void PlayMovie(const wchar_t * pFilename); |
51 extern void PlayAudio(const wchar_t * pFilename); | |
2360 | 52 extern void MovieRelease(); |
2347 | 53 |
2356 | 54 ////////////////////////////////////////////////////////////////////////// |
55 //Included from a VideoPlayer.h file/вставлено из файла VideoPlayer.h/ | |
56 ////////////////////////////////////////////////////////////////////////// | |
57 | |
58 //used in void VideoPlayer::Initialize(OSWindow *target_window) for open .vid files | |
59 struct MovieHeader | |
60 { | |
61 char pVideoName[40]; | |
62 unsigned int uFileOffset; | |
63 }; | |
64 | |
65 extern MovieHeader *pMightVideoHeaders; | |
66 extern MovieHeader *pMagicVideoHeaders; | |
67 extern HANDLE hMightVid; | |
68 extern HANDLE hMagicVid; | |
69 extern unsigned __int64 uBinkVersion; | |
70 extern unsigned int uNumMightVideoHeaders; | |
71 extern unsigned int uNumMagicVideoHeaders; | |
72 // |