VIDEO: YUV420 conversion for MKV decoder

This commit is contained in:
Eugene Sandulenko 2022-11-18 09:38:47 +01:00
parent 4613ab0fd9
commit b3dfca3cb1
2 changed files with 8 additions and 0 deletions

View File

@ -355,6 +355,9 @@ void MKVDecoder::readNextPacket() {
if (img->fmt != VPX_IMG_FMT_I420)
error("Movie error. The movie is not in I420 colour format, which is the only one I can hanlde at the moment.");
YUVToRGBMan.convert420(&_displaySurface, Graphics::YUVToRGBManager::kScaleITU, img->planes[0], img->planes[1], img->planes[2], img->d_w, img->d_h, img->stride[0], img->stride[1]);
unsigned int y;
#if 0
GLubyte *ytex = NULL;
@ -437,6 +440,7 @@ MKVDecoder::VPXVideoTrack::~VPXVideoTrack() {
}
bool MKVDecoder::VPXVideoTrack::decodePacket(ogg_packet &_oggPacket) {
warning("VPXVideoTrack::decodePacket()");
if (th_decode_packetin(_theoraDecode, &_oggPacket, 0) == 0) {
_curFrame++;
@ -588,6 +592,8 @@ static double rint(double v) {
#endif
bool MKVDecoder::VorbisAudioTrack::decodeSamples(ogg_packet &oggPacket) {
return true;
if(!vorbis_synthesis(&vorbisBlock, &oggPacket) ) {
if (vorbis_synthesis_blockin(&vorbisDspState, &vorbisBlock))
warning("Vorbis Synthesis block in error");

View File

@ -176,6 +176,8 @@ private:
int videoTrack = -1;
int audioTrack = -1;
Graphics::Surface _displaySurface;
};
} // End of namespace Video