mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Can't just do that, might get the vtbl. Arg.
This commit is contained in:
parent
7509a2b83a
commit
cb0538c4db
3 changed files with 76 additions and 23 deletions
|
@ -86,8 +86,39 @@ struct StreamInfo
|
||||||
int num;
|
int num;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef std::map<u32, StreamInfo> StreamInfoMap;
|
||||||
|
|
||||||
// Internal structure
|
// Internal structure
|
||||||
struct MpegContextSimple {
|
struct MpegContext {
|
||||||
|
void DoState(PointerWrap &p) {
|
||||||
|
p.Do(defaultFrameWidth);
|
||||||
|
p.Do(videoFrameCount);
|
||||||
|
p.Do(audioFrameCount);
|
||||||
|
p.Do(endOfAudioReached);
|
||||||
|
p.Do(endOfVideoReached);
|
||||||
|
p.Do(videoPixelMode);
|
||||||
|
p.Do(mpegMagic);
|
||||||
|
p.Do(mpegVersion);
|
||||||
|
p.Do(mpegRawVersion);
|
||||||
|
p.Do(mpegOffset);
|
||||||
|
p.Do(mpegStreamSize);
|
||||||
|
p.Do(mpegFirstTimestamp);
|
||||||
|
p.Do(mpegLastTimestamp);
|
||||||
|
p.Do(mpegFirstDate);
|
||||||
|
p.Do(mpegLastDate);
|
||||||
|
p.Do(mpegRingbufferAddr);
|
||||||
|
p.Do(mpegStreamAddr);
|
||||||
|
p.DoArray(esBuffers, NUM_ES_BUFFERS);
|
||||||
|
p.Do(avc);
|
||||||
|
p.Do(avcRegistered);
|
||||||
|
p.Do(atracRegistered);
|
||||||
|
p.Do(pcmRegistered);
|
||||||
|
p.Do(isAnalyzed);
|
||||||
|
p.Do<StreamInfo>(streamMap);
|
||||||
|
mediaengine->DoState(p);
|
||||||
|
p.DoMarker("MpegContext");
|
||||||
|
}
|
||||||
|
|
||||||
u32 defaultFrameWidth;
|
u32 defaultFrameWidth;
|
||||||
int videoFrameCount;
|
int videoFrameCount;
|
||||||
int audioFrameCount;
|
int audioFrameCount;
|
||||||
|
@ -113,17 +144,6 @@ struct MpegContextSimple {
|
||||||
bool pcmRegistered;
|
bool pcmRegistered;
|
||||||
|
|
||||||
bool isAnalyzed;
|
bool isAnalyzed;
|
||||||
};
|
|
||||||
typedef std::map<u32, StreamInfo> StreamInfoMap;
|
|
||||||
|
|
||||||
struct MpegContext : public MpegContextSimple {
|
|
||||||
void DoState(PointerWrap &p) {
|
|
||||||
p.Do<MpegContextSimple>(*this);
|
|
||||||
p.Do<StreamInfo>(streamMap);
|
|
||||||
// Media engine has nothing exotic.
|
|
||||||
p.Do<MediaEngine>(*mediaengine);
|
|
||||||
p.DoMarker("MpegContext");
|
|
||||||
}
|
|
||||||
|
|
||||||
StreamInfoMap streamMap;
|
StreamInfoMap streamMap;
|
||||||
MediaEngine *mediaengine;
|
MediaEngine *mediaengine;
|
||||||
|
|
|
@ -56,7 +56,14 @@ class PsmfStream;
|
||||||
// we read it manually.
|
// we read it manually.
|
||||||
// TODO: Change to work directly with the data in RAM instead of this
|
// TODO: Change to work directly with the data in RAM instead of this
|
||||||
// JPSCP-esque class.
|
// JPSCP-esque class.
|
||||||
struct PsmfSimple {
|
typedef std::map<int, PsmfStream *> PsmfStreamMap;
|
||||||
|
class Psmf {
|
||||||
|
public:
|
||||||
|
Psmf(u32 data);
|
||||||
|
~Psmf();
|
||||||
|
u32 getNumStreams() { return 2; }
|
||||||
|
void DoState(PointerWrap &p);
|
||||||
|
|
||||||
u32 magic;
|
u32 magic;
|
||||||
u32 version;
|
u32 version;
|
||||||
u32 streamOffset;
|
u32 streamOffset;
|
||||||
|
@ -82,14 +89,6 @@ struct PsmfSimple {
|
||||||
int videoHeight;
|
int videoHeight;
|
||||||
int audioChannels;
|
int audioChannels;
|
||||||
int audioFrequency;
|
int audioFrequency;
|
||||||
};
|
|
||||||
typedef std::map<int, PsmfStream *> PsmfStreamMap;
|
|
||||||
class Psmf : public PsmfSimple {
|
|
||||||
public:
|
|
||||||
Psmf(u32 data);
|
|
||||||
~Psmf();
|
|
||||||
u32 getNumStreams() { return 2; }
|
|
||||||
void DoState(PointerWrap &p);
|
|
||||||
|
|
||||||
PsmfStreamMap streamMap;
|
PsmfStreamMap streamMap;
|
||||||
};
|
};
|
||||||
|
@ -125,7 +124,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoState(PointerWrap &p) {
|
void DoState(PointerWrap &p) {
|
||||||
p.Do<PsmfStream>(*this);
|
p.Do(type);
|
||||||
|
p.Do(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
int type;
|
int type;
|
||||||
|
@ -178,7 +178,28 @@ Psmf::~Psmf() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Psmf::DoState(PointerWrap &p) {
|
void Psmf::DoState(PointerWrap &p) {
|
||||||
p.Do<PsmfSimple>(*this);
|
p.Do(magic);
|
||||||
|
p.Do(version);
|
||||||
|
p.Do(streamOffset);
|
||||||
|
p.Do(streamSize);
|
||||||
|
p.Do(headerOffset);
|
||||||
|
p.Do(streamDataTotalSize);
|
||||||
|
p.Do(presentationStartTime);
|
||||||
|
p.Do(presentationEndTime);
|
||||||
|
p.Do(streamDataNextBlockSize);
|
||||||
|
p.Do(streamDataNextInnerBlockSize);
|
||||||
|
p.Do(numStreams);
|
||||||
|
|
||||||
|
p.Do(currentStreamNum);
|
||||||
|
p.Do(currentAudioStreamNum);
|
||||||
|
p.Do(currentVideoStreamNum);
|
||||||
|
|
||||||
|
p.Do(EPMapOffset);
|
||||||
|
p.Do(EPMapEntriesNum);
|
||||||
|
p.Do(videoWidth);
|
||||||
|
p.Do(videoHeight);
|
||||||
|
p.Do(audioChannels);
|
||||||
|
p.Do(audioFrequency);
|
||||||
|
|
||||||
int n = (int) streamMap.size();
|
int n = (int) streamMap.size();
|
||||||
p.Do(n);
|
p.Do(n);
|
||||||
|
|
|
@ -72,6 +72,18 @@ public:
|
||||||
int readLength() { return readLength_; }
|
int readLength() { return readLength_; }
|
||||||
void setReadLength(int len) { readLength_ = len; }
|
void setReadLength(int len) { readLength_ = len; }
|
||||||
|
|
||||||
|
void DoState(PointerWrap &p) {
|
||||||
|
p.Do(fakeMode_);
|
||||||
|
p.Do(bufferAddr_);
|
||||||
|
p.Do(mpegStreamSize_);
|
||||||
|
p.Do(mpegOffset_);
|
||||||
|
p.Do(readLength_);
|
||||||
|
p.Do(videoWidth_);
|
||||||
|
p.Do(videoHeight_);
|
||||||
|
p.Do(fakeFrameCounter_);
|
||||||
|
p.DoMarker("MediaEngine");
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool fakeMode_;
|
bool fakeMode_;
|
||||||
u32 bufferAddr_;
|
u32 bufferAddr_;
|
||||||
|
|
Loading…
Add table
Reference in a new issue