annotate VideoPlayer.h @ 2361:d6bba1e6249d

for eliminate memory flow in video
author Ritor1
date Sat, 19 Apr 2014 23:56:01 +0600
parents 08c4f1799ca1
children cb66a1082fcf
rev   line source
0
Ritor1
parents:
diff changeset
1 #pragma once
1802
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1458
diff changeset
2 #include "OSWindow.h"
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1253
diff changeset
3 #include "Texture.h"
2345
182effc4b0ee for MultimediaPlayer
Ritor1
parents: 2334
diff changeset
4 #include "MediaPlayer.h"
0
Ritor1
parents:
diff changeset
5
Ritor1
parents:
diff changeset
6 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
7
Ritor1
parents:
diff changeset
8 #pragma pack(pop)
Ritor1
parents:
diff changeset
9
Ritor1
parents:
diff changeset
10 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
11 #pragma pack(pop)
Ritor1
parents:
diff changeset
12
2290
d65414f65bd4 add MMT.cpp and MMT.h
Ritor1
parents: 2221
diff changeset
13 void ShowMM7IntroVideo_and_LoadingScreen();
0
Ritor1
parents:
diff changeset
14
2134
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
15 extern "C"
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
16 {
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
17 #include "lib/libavcodec/avcodec.h"
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
18 #include "lib/libavformat/avformat.h"
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
19 #include "lib/libavutil/avutil.h"
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
20 #include "lib/libavutil/imgutils.h"
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
21 #include "lib/libswscale/swscale.h"
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
22 #include "lib/libswresample/swresample.h"
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
23 #include "lib/libavutil/opt.h"
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
24 }
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
25 #pragma comment(lib, "avcodec.lib")
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
26 #pragma comment(lib, "avformat.lib")
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
27 #pragma comment(lib, "avutil.lib")
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
28 #pragma comment(lib, "swscale.lib")
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
29 #pragma comment(lib, "swresample.lib")
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
30
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
31 #include "lib/OpenAL/al.h"
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
32 #include "lib/OpenAL/alc.h"
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
33 #pragma comment(lib, "OpenAL32.lib")
992d2e6f907d preparation for libavcodec
zipi
parents: 1802
diff changeset
34
0
Ritor1
parents:
diff changeset
35 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
36 struct VideoPlayer
Ritor1
parents:
diff changeset
37 {
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1253
diff changeset
38 VideoPlayer();
0
Ritor1
parents:
diff changeset
39 //----- (004BECBD) --------------------------------------------------------
Ritor1
parents:
diff changeset
40 virtual ~VideoPlayer()
Ritor1
parents:
diff changeset
41 {
Ritor1
parents:
diff changeset
42 bStopBeforeSchedule = false;
165
Ritor1
parents: 0
diff changeset
43 pResetflag = 0;
0
Ritor1
parents:
diff changeset
44 pVideoFrame.Release();
Ritor1
parents:
diff changeset
45 }
Ritor1
parents:
diff changeset
46
1802
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1458
diff changeset
47 void Initialize(OSWindow *window);
0
Ritor1
parents:
diff changeset
48 void Unload();
2356
08c4f1799ca1 Elements of VideoPlayer structure moved
Ritor1
parents: 2347
diff changeset
49
898
10fa7dad1391 DrawPaperdoll clean
Ritor1
parents: 323
diff changeset
50 void OpenHouseMovie(const char *pMovieName, unsigned int a3_1);//0x4BF28F
2356
08c4f1799ca1 Elements of VideoPlayer structure moved
Ritor1
parents: 2347
diff changeset
51 void PlayDeathMovie();
0
Ritor1
parents:
diff changeset
52 bool AnyMovieLoaded();
898
10fa7dad1391 DrawPaperdoll clean
Ritor1
parents: 323
diff changeset
53 void OpenGlobalMovie(const char *pFilename, unsigned int bLoop, int a4);
0
Ritor1
parents:
diff changeset
54 void _4BF5B2();
898
10fa7dad1391 DrawPaperdoll clean
Ritor1
parents: 323
diff changeset
55 void SelectMovieType();//0x4BF73A
1802
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1458
diff changeset
56 void _inlined_in_463149();
2356
08c4f1799ca1 Elements of VideoPlayer structure moved
Ritor1
parents: 2347
diff changeset
57
2142
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2137
diff changeset
58 void MovieLoop(const char *pMovieName, int a2, int a3, int a4);
2356
08c4f1799ca1 Elements of VideoPlayer structure moved
Ritor1
parents: 2347
diff changeset
59 void UpdatePalette();
08c4f1799ca1 Elements of VideoPlayer structure moved
Ritor1
parents: 2347
diff changeset
60 static int readFunction(void *, uint8_t *, int);
08c4f1799ca1 Elements of VideoPlayer structure moved
Ritor1
parents: 2347
diff changeset
61 static int64_t seekFunction(void *, int64_t, int);
08c4f1799ca1 Elements of VideoPlayer structure moved
Ritor1
parents: 2347
diff changeset
62 void LoadMovie(const char *);
0
Ritor1
parents:
diff changeset
63
Ritor1
parents:
diff changeset
64 RGBTexture pVideoFrame;
Ritor1
parents:
diff changeset
65 int field_34;
2356
08c4f1799ca1 Elements of VideoPlayer structure moved
Ritor1
parents: 2347
diff changeset
66
165
Ritor1
parents: 0
diff changeset
67 int pResetflag;
0
Ritor1
parents:
diff changeset
68 int field_44;
2356
08c4f1799ca1 Elements of VideoPlayer structure moved
Ritor1
parents: 2347
diff changeset
69
0
Ritor1
parents:
diff changeset
70 int uBinkDirectDrawSurfaceType;
2137
d24ee391fd1f libavcodec playing movies and houses, loops not working yet
zipi
parents: 2134
diff changeset
71 int bBufferLoaded;
0
Ritor1
parents:
diff changeset
72 unsigned int bPlayingMovie;
Ritor1
parents:
diff changeset
73 unsigned int bFirstFrame;
Ritor1
parents:
diff changeset
74 unsigned int bUsingSmackerMMX;
Ritor1
parents:
diff changeset
75 unsigned int bLoopPlaying;
Ritor1
parents:
diff changeset
76 int field_68;
Ritor1
parents:
diff changeset
77 unsigned int bStopBeforeSchedule;
1802
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1458
diff changeset
78 OSWindow *window;
0
Ritor1
parents:
diff changeset
79 struct _SMACKBLIT *pSmackMovieBlit;
2356
08c4f1799ca1 Elements of VideoPlayer structure moved
Ritor1
parents: 2347
diff changeset
80
0
Ritor1
parents:
diff changeset
81 char field_88[20];
Ritor1
parents:
diff changeset
82 unsigned int uMovieFormat;
2137
d24ee391fd1f libavcodec playing movies and houses, loops not working yet
zipi
parents: 2134
diff changeset
83 int uMovieFormatSwapped;
0
Ritor1
parents:
diff changeset
84 char pCurrentMovieName[64];
Ritor1
parents:
diff changeset
85 char pVideoFrameTextureFilename[32];
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 165
diff changeset
86 int field_104;
2356
08c4f1799ca1 Elements of VideoPlayer structure moved
Ritor1
parents: 2347
diff changeset
87
2142
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2137
diff changeset
88 HANDLE hVidFile;
2137
d24ee391fd1f libavcodec playing movies and houses, loops not working yet
zipi
parents: 2134
diff changeset
89 int uSize;
d24ee391fd1f libavcodec playing movies and houses, loops not working yet
zipi
parents: 2134
diff changeset
90 int uOffset;
0
Ritor1
parents:
diff changeset
91 };
Ritor1
parents:
diff changeset
92 #pragma pack(pop)
Ritor1
parents:
diff changeset
93
Ritor1
parents:
diff changeset
94 extern VideoPlayer *pVideoPlayer;
2137
d24ee391fd1f libavcodec playing movies and houses, loops not working yet
zipi
parents: 2134
diff changeset
95 extern LRESULT __stdcall wWinProc(HWND hwnd, unsigned int msg, WPARAM wparam, LPARAM lparam);