wavelength 1.0.0
Loading...
Searching...
No Matches
psmovie.h
Go to the documentation of this file.
1#pragma once
2
3#include <libipu.h>
4
5#include "rnd/rndmovie.h"
6
16class PsMovie : public RndMovie {
17public:
19 struct Header {
20 char mMagic[4];
21 int mSize;
22 unsigned short mWidth;
23 unsigned short mHeight;
25 };
26
34 explicit PsMovie(const char *pszName);
35
42 ~PsMovie() override {
43 CloseData();
44 }
45
53 float EndFrame() override {
54 return kEndFrame;
55 }
56
69 int SetFrameSelf(float fFrame) override;
70
77 void Open() override {
79 OpenData();
80 }
81
88 void Close() override {
89 CloseData();
91 }
92
103 void Replace(RndObject *pFrom, RndObject *pTo) override;
104
113 void OpenData();
114
123 void CloseData();
124
134
145
155 static void Init();
156
165 static void Terminate();
166
175 static void RemoveHandler();
176
185 static void InstallHandler();
186
197 static int DmacHandler(int nChannel);
198
207 static RndObject *New(const char *pszName) {
208 return new PsMovie(pszName);
209 }
210
212 static constexpr float kEndFrame = 10.0f;
213
220 static int sHandlerId;
221
229
230private:
231 void *mData;
232 int mDataSize;
233 int mWidth;
234 int mHeight;
235 int mNumFrames;
236 int mFrame;
237 int mNumBlocks;
238 unsigned long long *mIpuTags;
239 sceIpuDmaEnv mIpuEnv;
240 PsMovie *mNext;
241};
static void Init()
Install the movie factory for the class Movie of a .rnd file, reset the IPU, and install the interrup...
int SetFrameSelf(float fFrame) override
Queue the decode of the frame after the one decoded last, or of the first frame when the requested fr...
void StartFrame()
Start the IPU decoding the next frame into the bitmap of the texture.
static void Terminate()
Remove the interrupt handler and restore the generic movie factory.
static void InstallHandler()
Install the interrupt handler unless it is installed.
static void RemoveHandler()
Remove the interrupt handler.
~PsMovie() override
Release the data.
Definition psmovie.h:42
static PsMovie * sActive
The movie decoding, or null.
Definition psmovie.h:228
static constexpr float kEndFrame
The frame EndFrame() reports.
Definition psmovie.h:212
void OpenData()
Load the file, size the texture for it, and build the IPU input chain.
void Replace(RndObject *pFrom, RndObject *pTo) override
Wait while the movie is queued when the texture is replaced, then replace it.
void Open() override
Take a reference on the texture, then load the data.
Definition psmovie.h:77
void Close() override
Release the data, then drop the reference on the texture.
Definition psmovie.h:88
static RndObject * New(const char *pszName)
Create a movie.
Definition psmovie.h:207
PsMovie(const char *pszName)
Construct a movie without data.
void FinishFrame()
End the decode of a frame, mark the texture for upload, and start the next movie queued.
static int DmacHandler(int nChannel)
End the frame of the movie decoding, the interrupt handler of the IPU output channel.
float EndFrame() override
Report the last frame, fixed at 10 whatever the length of the file.
Definition psmovie.h:53
static int sHandlerId
The interrupt handler, or -1 while it is removed.
Definition psmovie.h:220
void CloseData()
Wait while the movie is queued, then release the data and the IPU input chain.
virtual void Open()
Take a reference on the texture.
virtual void Close()
Drop the reference on the texture.
RndMovie(const char *pszName)
Construct a movie without a file or a texture.
RndObject(const char *pszName)
Construct an object and register it under a name.
The header of an IPU movie file.
Definition psmovie.h:19
int mSize
Definition psmovie.h:21
int mNumFrames
Definition psmovie.h:24
unsigned short mHeight
Definition psmovie.h:23
unsigned short mWidth
Definition psmovie.h:22
char mMagic[4]
Definition psmovie.h:20