22 #ifndef VIDEO_MPEGPS_DECODER_H 23 #define VIDEO_MPEGPS_DECODER_H 25 #include "common/hashmap.h" 26 #include "common/queue.h" 27 #include "graphics/surface.h" 28 #include "video/video_decoder.h" 31 class PacketizedAudioStream;
35 class SeekableReadStream;
64 void readNextPacket();
82 Packet(
Common::SeekableReadStream *stream, int32 startCode, uint32 pts, uint32 dts) : _stream(stream), _startCode(startCode), _pts(pts), _dts(dts) {}
89 bool queueNextPacket();
91 int readNextPacketHeader(int32 &startCode, uint32 &pts, uint32 &dts);
92 int findNextStartCode(uint32 &size);
93 uint32 readPTS(
int c);
94 void parseProgramStreamMap(
int length);
106 virtual ~MPEGStream() {}
114 virtual StreamType getStreamType()
const = 0;
118 class MPEGVideoTrack :
public VideoTrack,
public MPEGStream {
123 bool endOfTrack()
const {
return _endOfTrack; }
124 uint16 getWidth()
const;
125 uint16 getHeight()
const;
128 int getCurFrame()
const {
return _curFrame; }
129 uint32 getNextFrameStartTime()
const {
return _nextFrameStartTime.msecs(); }
133 StreamType getStreamType()
const {
return kStreamTypeVideo; }
135 void setEndOfTrack() { _endOfTrack =
true; }
151 Image::MPEGDecoder *_mpegDecoder;
157 class MPEGAudioTrack :
public AudioTrack,
public MPEGStream {
163 StreamType getStreamType()
const {
return kStreamTypeAudio; }
174 class AC3AudioTrack :
public AudioTrack,
public MPEGStream {
180 StreamType getStreamType()
const {
return kStreamTypeAudio; }
190 class PS2AudioTrack :
public AudioTrack,
public MPEGStream {
196 StreamType getStreamType()
const {
return kStreamTypeAudio; }
215 uint32 _blockPos, _blockUsed;
217 uint32 calculateSampleCount(uint32 packetSize)
const;
221 enum PrivateStreamType {
222 kPrivateStreamUnknown,
225 kPrivateStreamDVDPCM,
226 kPrivateStreamPS2Audio
231 bool addFirstVideoTrack();
234 MPEGPSDemuxer *_demuxer;
238 StreamMap _streamMap;
Definition: video_decoder.h:723
Definition: timestamp.h:83
Definition: audiostream.h:446
SoundType
Definition: mixer.h:62
bool useAudioSync() const
Definition: mpegps_decoder.h:65
Definition: video_decoder.h:53
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: audiostream.h:50
Definition: avi_frames.h:36
Definition: mpegps_decoder.h:55
Definition: movie_decoder.h:32
Definition: video_decoder.h:589