summaryrefslogtreecommitdiff
path: root/include/THPPlayer/THPPlayer.h
blob: bd9d2644e4249102ab993f5d19a9384bef59aa89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef _THP_THPPLAYER_H
#define _THP_THPPLAYER_H

#include "common.h"
#include "rvl/DVD/dvd.h"
#include "rvl/GX/GXFrameBuf.h"

#include <THPPlayer/THPBuffer.h>
#include <THPPlayer/THPFile.h>
#include <THPPlayer/THPInfo.h>

#ifdef __cplusplus
extern "C" {
#endif

#define THP_AUDIO_BUFFER_COUNT 3
#define THP_READ_BUFFER_COUNT  10
#define THP_TEXTURE_SET_COUNT  3

typedef struct THPPlayer {
	DVDFileInfo fileInfo;
	THPHeader header;
	THPFrameCompInfo compInfo;
	THPVideoInfo videoInfo;
	THPAudioInfo audioInfo;
	void* thpWork;
	BOOL open;
	u8 state;
	u8 internalState;
	u8 playFlag;
	u8 audioExist;
	s32 dvdError;
	s32 videoError;
	BOOL onMemory;
	u8* movieData;
	s32 initOffset;
	s32 initReadSize;
	s32 initReadFrame;
	u32 curField;
	s64 retaceCount;
	s32 prevCount;
	s32 curCount;
	s32 videoDecodeCount;
	f32 curVolume;
	f32 targetVolume;
	f32 deltaVolume;
	s32 rampCount;
	s32 curAudioTrack;
	s32 curVideoNumber;
	s32 curAudioNumber;
	THPTextureSet* dispTextureSet;
	THPAudioBuffer* playAudioBuffer;
	THPReadBuffer readBuffer[10];
	THPTextureSet textureSet[THP_TEXTURE_SET_COUNT];
	THPAudioBuffer audioBuffer[THP_AUDIO_BUFFER_COUNT];
} THPPlayer; // Size: 0x1d0

extern THPPlayer ActivePlayer;

BOOL THPPlayerInit(s32);
void THPPlayerQuit();
BOOL THPPlayerOpen(const char* fileName, BOOL onMemory);
BOOL THPPlayerClose();
BOOL THPPlayerPlay();
void THPPlayerStop();
BOOL THPPlayerPause();
BOOL THPPlayerPrepare(s32 offset, u8 flag, s32 audioTrack);

BOOL THPPlayerSetBuffer(u8* data);

u32 THPPlayerCalcNeedMemory();

BOOL THPPlayerGetVideoInfo(THPVideoInfo* videoInfo);
BOOL THPPlayerGetAudioInfo(THPAudioInfo* audioInfo);
// f32 THPPlayerGetFrameRate();
BOOL THPPlayerSetVolume(s32 vol, s32 duration);

s32 THPPlayerDrawCurrentFrame(u16, u16, u32, u32, u32, u32);
u32 THPPlayerGetTotalFrame();
s32 THPPlayerGetState();
void THPPlayerDrawDone();

void THPPlayerPostDrawDone();

#ifdef __cplusplus
}
#endif

void PrepareReady(int msg);

#endif