wavelength 1.0.0
Loading...
Searching...
No Matches
PsMovie Class Reference

Movie, PlayStation 2. More...

#include <psmovie.h>

Inheritance diagram for PsMovie:
Collaboration diagram for PsMovie:

Classes

struct  Header
 The header of an IPU movie file. More...

Public Member Functions

 PsMovie (const char *pszName)
 Construct a movie without data.
 ~PsMovie () override
 Release the data.
float EndFrame () override
 Report the last frame, fixed at 10 whatever the length of the file.
int SetFrameSelf (float fFrame) override
 Queue the decode of the frame after the one decoded last, or of the first frame when the requested frame is earlier.
void Open () override
 Take a reference on the texture, then load the data.
void Close () override
 Release the data, then drop the reference on the texture.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Wait while the movie is queued when the texture is replaced, then replace it.
void OpenData ()
 Load the file, size the texture for it, and build the IPU input chain.
void CloseData ()
 Wait while the movie is queued, then release the data and the IPU input chain.
void FinishFrame ()
 End the decode of a frame, mark the texture for upload, and start the next movie queued.
void StartFrame ()
 Start the IPU decoding the next frame into the bitmap of the texture.
Public Member Functions inherited from RndMovie
 RndMovie (const char *pszName)
 Construct a movie without a file or a texture.
 ~RndMovie () override
 Close the movie.
void * operator new (size_t nSize)
 Allocate a movie, billed to the class name.
void operator delete (void *pBlock)
 Release a movie.
void ListAnimObjects (std::list< RndObject * > &objects) override
 Add the texture to a list, then the objects of the children.
void DumpText (PrnStream &stream) override
 Write a description of the movie and its base.
void Save (BinStream &stream) override
 Write the movie and its base.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Replace the texture with another.
const char * ClassName () const override
 Report the class name.
void Copy (const RndObject *pSource, int nFlags) override
 Copy another movie and its base, closing the movie first and opening it after.
void Load (BinStream &stream) override
 Read what Save() wrote, or an earlier version of it, closing the movie first and opening it after.
const FilePath & GetFile () const
RndTex * GetTex () const
Public Member Functions inherited from RndAnimatable
 RndAnimatable ()
 Construct an animatable at frame 0 without children or filters.
 ~RndAnimatable () override
 Drop the references on the children and delete the filters.
RndAnimatable * Parent ()
 Find the animatable whose children include this one.
void SetFrame (float fFrame)
 Filter a frame, apply it, and pass the result on to the children.
float FilterFrame (float fValue)
 Run a frame through the filters.
float UnfilterFrame (float fValue)
 Run a filtered frame back through the filters, last first.
float ChildrenEndFrame ()
 Report the latest end frame of the children, unfiltered through this animatable.
bool AddAnim (RndAnimatable *pAnim)
 Append a child.
void RemoveAnim (RndAnimatable *pAnim)
 Remove a child.
void RemoveAllAnims ()
 Remove every child.
const std::list< Filter * > & GetFilters () const
float GetFrame () const
float GetFilteredFrame () const
const std::list< RndAnimatable * > & GetAnims () const
std::list< Filter * > & GetFilters ()
Public Member Functions inherited from RndObject
 RndObject (const char *pszName)
 Construct an object and register it under a name.
virtual ~RndObject ()
 Notify every referrer, then erase the registration.
void SetName (const char *pszName)
 Register the object under a different name.
void AddRef (RndObject *pReferrer)
 Register an object as a store of a pointer to this one.
void RemoveRef (RndObject *pReferrer)
 Drop the first registration AddRef() made for a referrer.
const char * GetName () const
const std::list< RndObject * > & GetRefs () const
int GetInternal () const
void SetInternal (int nInternal)

Static Public Member Functions

static void Init ()
 Install the movie factory for the class Movie of a .rnd file, reset the IPU, and install the interrupt handler.
static void Terminate ()
 Remove the interrupt handler and restore the generic movie factory.
static void RemoveHandler ()
 Remove the interrupt handler.
static void InstallHandler ()
 Install the interrupt handler unless it is installed.
static int DmacHandler (int nChannel)
 End the frame of the movie decoding, the interrupt handler of the IPU output channel.
static RndObject * New (const char *pszName)
 Create a movie.
Static Public Member Functions inherited from RndMovie
static RndObject * New (const char *pszName)
 Create a movie.
Static Public Member Functions inherited from RndAnimatable
static Filter * NewFilter (int nType)
 Create a filter stage of a type, with its parameters unset.
static void CollectChildren (std::list< RndObject * > &objects, RndAnimatable *pAnimatable)
 Append every animation descendant of an animatable, depth first, each before its descendants.

Static Public Attributes

static constexpr float kEndFrame = 10.0f
 The frame EndFrame() reports.
static int sHandlerId
 The interrupt handler, or -1 while it is removed.
static PsMovie * sActive
 The movie decoding, or null.
Static Public Attributes inherited from RndMovie
static const char * sClassName
 The class name a .rnd file writes, Movie.
static int sRev
 The format version Save() writes and Load() accepts.
Static Public Attributes inherited from RndAnimatable
static int sRev
 The format version Save() writes and Load() accepts.
Static Public Attributes inherited from RndObject
static constexpr int kCopyChildLists = 0x200
 The bit of the Copy() flags that copies the child lists of the mix-ins.

Additional Inherited Members

Public Types inherited from RndAnimatable
enum  FilterType {
  kFilterScaleOffset = 0 , kFilterMinMaxLoop = 1 , kFilterZeroOrder = 2 , kFilterFirstOrder = 3 ,
  kFilterSecondOrder = 4
}
 The type tags of the filters, as Save() writes them. More...
Protected Member Functions inherited from RndAnimatable
void ReleaseObjects ()
 Drop the references on the children without emptying the list, and delete the filters.
void AcquireAnimRefs ()
 Take a reference on every child.
Protected Attributes inherited from RndMovie
FilePath mFile
RndTex * mTex
Protected Attributes inherited from RndAnimatable
std::list< RndAnimatable * > mAnims
std::list< Filter * > mFilters
float mFrame
float mFilteredFrame
Protected Attributes inherited from RndObject
std::list< RndObject * > mRefs
String mName

Detailed Description

Movie, PlayStation 2.

The RTTI includes the class name and records RndMovie as the one base. The movie file is an IPU stream that the IPU decodes one frame at a time straight into the bitmap of the texture, as 16-bit colour. One movie decodes at a time. A movie that requests a frame while another decodes waits in the queue that mNext links, and the interrupt handler of the IPU output channel starts the next one.

Constructor & Destructor Documentation

◆ PsMovie()

PsMovie::PsMovie ( const char * pszName)
explicit

Construct a movie without data.

Parameters
pszNameThe registry key.
Ghidra address:
NTSC-U/C: 0x00216678
Ghidra address:
PAL: 0x0021f490

◆ ~PsMovie()

PsMovie::~PsMovie ( )
inlineoverride

Release the data.

Ghidra address:
NTSC-U/C: 0x0037cd28
Ghidra address:
PAL: 0x003eb458

Member Function Documentation

◆ EndFrame()

float PsMovie::EndFrame ( )
inlineoverridevirtual

Report the last frame, fixed at 10 whatever the length of the file.

Returns
10.
Ghidra address:
NTSC-U/C: 0x0037ce68
Ghidra address:
PAL: 0x003eb598

Reimplemented from RndAnimatable.

◆ SetFrameSelf()

int PsMovie::SetFrameSelf ( float fFrame)
overridevirtual

Queue the decode of the frame after the one decoded last, or of the first frame when the requested frame is earlier.

The frame wraps to the length of the movie. A movie still queued from an earlier request waits for its decode first. The request does not seek.

Parameters
fFrameThe frame.
Returns
1.
Ghidra address:
NTSC-U/C: 0x00216b60
Ghidra address:
PAL: 0x0021f978

Reimplemented from RndAnimatable.

◆ Open()

void PsMovie::Open ( )
inlineoverridevirtual

Take a reference on the texture, then load the data.

Ghidra address:
NTSC-U/C: 0x0037ced0
Ghidra address:
PAL: 0x003eb600

Reimplemented from RndMovie.

◆ Close()

void PsMovie::Close ( )
inlineoverridevirtual

Release the data, then drop the reference on the texture.

Ghidra address:
NTSC-U/C: 0x0037cf00
Ghidra address:
PAL: 0x003eb630

Reimplemented from RndMovie.

◆ Replace()

void PsMovie::Replace ( RndObject * pFrom,
RndObject * pTo )
overridevirtual

Wait while the movie is queued when the texture is replaced, then replace it.

mNext is read once. A queued movie waits forever.

Parameters
pFromThe object being replaced.
pToThe replacement, or null.
Ghidra address:
NTSC-U/C: 0x00216370
Ghidra address:
PAL: 0x0021f188

Implements RndObject.

◆ OpenData()

void PsMovie::OpenData ( )

Load the file, size the texture for it, and build the IPU input chain.

A movie of 2048 macroblocks or more is refused and its data released. The name is inferred.

Ghidra address:
NTSC-U/C: 0x002167b8
Ghidra address:
PAL: 0x0021f5d0

◆ CloseData()

void PsMovie::CloseData ( )

Wait while the movie is queued, then release the data and the IPU input chain.

mNext is read once. A queued movie waits forever. The name is inferred.

Ghidra address:
NTSC-U/C: 0x00216910
Ghidra address:
PAL: 0x0021f728

◆ FinishFrame()

void PsMovie::FinishFrame ( )

End the decode of a frame, mark the texture for upload, and start the next movie queued.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00216990
Ghidra address:
PAL: 0x0021f7a8

◆ StartFrame()

void PsMovie::StartFrame ( )

Start the IPU decoding the next frame into the bitmap of the texture.

The first frame resets the IPU and starts the input chain from the beginning. The name is inferred.

Ghidra address:
NTSC-U/C: 0x00216a18
Ghidra address:
PAL: 0x0021f830

◆ Init()

void PsMovie::Init ( )
static

Install the movie factory for the class Movie of a .rnd file, reset the IPU, and install the interrupt handler.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x002163c0
Ghidra address:
PAL: 0x0021f1d8

◆ Terminate()

void PsMovie::Terminate ( )
static

Remove the interrupt handler and restore the generic movie factory.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x002164e0
Ghidra address:
PAL: 0x0021f2f8

◆ RemoveHandler()

void PsMovie::RemoveHandler ( )
static

Remove the interrupt handler.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x002165f8
Ghidra address:
PAL: 0x0021f410

◆ InstallHandler()

void PsMovie::InstallHandler ( )
static

Install the interrupt handler unless it is installed.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00216630
Ghidra address:
PAL: 0x0021f448

◆ DmacHandler()

int PsMovie::DmacHandler ( int nChannel)
static

End the frame of the movie decoding, the interrupt handler of the IPU output channel.

The name is inferred.

Parameters
nChannelThe channel.
Returns
0.
Ghidra address:
NTSC-U/C: 0x00216340
Ghidra address:
PAL: 0x0021f158

◆ New()

RndObject * PsMovie::New ( const char * pszName)
inlinestatic

Create a movie.

Parameters
pszNameThe registry key.
Returns
The movie.
Ghidra address:
NTSC-U/C: 0x0037ce78
Ghidra address:
PAL: 0x003eb5a8

Member Data Documentation

◆ kEndFrame

float PsMovie::kEndFrame = 10.0f
staticconstexpr

The frame EndFrame() reports.

◆ sHandlerId

int PsMovie::sHandlerId
static

The interrupt handler, or -1 while it is removed.

Ghidra address:
NTSC-U/C: 0x003b07d0
Ghidra address:
PAL: 0x0042f668

◆ sActive

PsMovie* PsMovie::sActive
static

The movie decoding, or null.

Ghidra address:
NTSC-U/C: 0x003b07d4
Ghidra address:
PAL: 0x0042f66c

The documentation for this class was generated from the following file: