22 #include "common/scummsys.h" 26 #ifndef VIDEO_MKV_DECODER_H 27 #define VIDEO_MKV_DECODER_H 29 #include "common/queue.h" 30 #include "video/video_decoder.h" 31 #include "audio/mixer.h" 32 #include "graphics/surface.h" 35 #include <tremor/ivorbiscodec.h> 37 #include <vorbis/codec.h> 40 #include <vpx/vpx_decoder.h> 41 #include <vpx/vp8dx.h> 45 class SeekableReadStream;
50 class QueuingAudioStream;
73 class MKVDecoder :
public VideoDecoder {
76 virtual ~MKVDecoder();
86 void readNextPacket();
89 class VPXVideoTrack :
public VideoTrack {
94 bool endOfTrack()
const;
95 uint16 getWidth()
const {
return _width; }
96 uint16 getHeight()
const {
return _height; }
101 _pixelFormat = format;
105 int getCurFrame()
const {
return _curFrame; }
106 uint32 getNextFrameStartTime()
const {
return (uint32)(_nextFrameStartTime * 1000); }
108 bool decodeFrame(byte *frame,
long size);
109 void setEndOfVideo() { _endOfVideo =
true; }
114 double _nextFrameStartTime;
123 vpx_codec_ctx_t *_codec =
nullptr;
126 class VorbisAudioTrack :
public AudioTrack {
131 bool decodeSamples(byte *frame,
long size);
132 bool hasAudio()
const;
133 bool needsAudio()
const;
134 bool synthesizePacket(byte *frame,
long size);
135 void setEndOfAudio() { _endOfAudio =
true; }
143 vorbis_block _vorbisBlock;
144 vorbis_dsp_state _vorbisDSP;
146 vorbis_info _vorbisInfo;
149 ogg_packet oggPacket;
152 bool queueAudio(
long size);
156 bool _hasVideo, _hasAudio;
158 VPXVideoTrack *_videoTrack =
nullptr;
159 VorbisAudioTrack *_audioTrack =
nullptr;
161 mkvparser::MkvReader *_reader =
nullptr;
168 byte *_frame =
nullptr;
169 int _frameCounter = 0;
Definition: mkvparser.h:299
Definition: mkvparser.h:71
Definition: mkvparser.h:13
Definition: mkvparser.h:119
Definition: mkvparser.h:1050
Definition: algorithm.h:29
Definition: mkvparser.h:566
Definition: audiostream.h:50
Definition: mkvparser.h:970
Definition: audiostream.h:370
Definition: avi_frames.h:36