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);
104 virtual ~MPEGStream() {}
112 virtual StreamType getStreamType()
const = 0;
116 class MPEGVideoTrack :
public VideoTrack,
public MPEGStream {
121 bool endOfTrack()
const {
return _endOfTrack; }
122 uint16 getWidth()
const;
123 uint16 getHeight()
const;
126 int getCurFrame()
const {
return _curFrame; }
127 uint32 getNextFrameStartTime()
const {
return _nextFrameStartTime.msecs(); }
131 StreamType getStreamType()
const {
return kStreamTypeVideo; }
133 void setEndOfTrack() { _endOfTrack =
true; }
149 Image::MPEGDecoder *_mpegDecoder;
155 class MPEGAudioTrack :
public AudioTrack,
public MPEGStream {
161 StreamType getStreamType()
const {
return kStreamTypeAudio; }
172 class AC3AudioTrack :
public AudioTrack,
public MPEGStream {
178 StreamType getStreamType()
const {
return kStreamTypeAudio; }
188 class PS2AudioTrack :
public AudioTrack,
public MPEGStream {
194 StreamType getStreamType()
const {
return kStreamTypeAudio; }
213 uint32 _blockPos, _blockUsed;
215 uint32 calculateSampleCount(uint32 packetSize)
const;
219 enum PrivateStreamType {
220 kPrivateStreamUnknown,
223 kPrivateStreamDVDPCM,
224 kPrivateStreamPS2Audio
229 bool addFirstVideoTrack();
232 MPEGPSDemuxer *_demuxer;
236 StreamMap _streamMap;
Definition: video_decoder.h:711
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:577