diff options
Diffstat (limited to 'video/avi_decoder.cpp')
-rw-r--r-- | video/avi_decoder.cpp | 59 |
1 files changed, 6 insertions, 53 deletions
diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp index 4e561cfddf..0697d89c04 100644 --- a/video/avi_decoder.cpp +++ b/video/avi_decoder.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -34,13 +34,7 @@ #include "audio/decoders/raw.h" // Video Codecs -#include "video/codecs/cinepak.h" -#include "video/codecs/indeo3.h" -#include "video/codecs/mjpeg.h" -#include "video/codecs/mpeg.h" -#include "video/codecs/msvideo1.h" -#include "video/codecs/msrle.h" -#include "video/codecs/truemotion1.h" +#include "image/codecs/codec.h" namespace Video { @@ -74,18 +68,6 @@ namespace Video { #define ID_PRMI MKTAG('P','R','M','I') #define ID_STRN MKTAG('s','t','r','n') -// Codec tags -#define ID_RLE MKTAG('R','L','E',' ') -#define ID_CRAM MKTAG('C','R','A','M') -#define ID_MSVC MKTAG('m','s','v','c') -#define ID_WHAM MKTAG('W','H','A','M') -#define ID_CVID MKTAG('c','v','i','d') -#define ID_IV32 MKTAG('i','v','3','2') -#define ID_DUCK MKTAG('D','U','C','K') -#define ID_DUCK2 MKTAG('d','u','c','k') // Some videos have DUCK tag in lowercase -#define ID_MPG2 MKTAG('m','p','g','2') -#define ID_MJPG MKTAG('m','j','p','g') - // Stream Types enum { kStreamTypePaletteChange = MKTAG16('p', 'c'), @@ -266,9 +248,6 @@ void AVIDecoder::handleStreamHeader(uint32 size) { if (bmInfo.clrUsed == 0) bmInfo.clrUsed = 256; - if (sHeader.streamHandler == 0) - sHeader.streamHandler = bmInfo.compression; - byte *initialPalette = 0; if (bmInfo.bitCount == 8) { @@ -711,7 +690,7 @@ AVIDecoder::AVIVideoTrack::~AVIVideoTrack() { void AVIDecoder::AVIVideoTrack::decodeFrame(Common::SeekableReadStream *stream) { if (stream) { if (_videoCodec) - _lastFrame = _videoCodec->decodeImage(stream); + _lastFrame = _videoCodec->decodeFrame(*stream); } else { // Empty frame _lastFrame = 0; @@ -769,34 +748,8 @@ bool AVIDecoder::AVIVideoTrack::rewind() { return true; } -Codec *AVIDecoder::AVIVideoTrack::createCodec() { - switch (_vidsHeader.streamHandler) { - case ID_CRAM: - case ID_MSVC: - case ID_WHAM: - return new MSVideo1Decoder(_bmInfo.width, _bmInfo.height, _bmInfo.bitCount); - case ID_RLE: - return new MSRLEDecoder(_bmInfo.width, _bmInfo.height, _bmInfo.bitCount); - case ID_CVID: - return new CinepakDecoder(_bmInfo.bitCount); - case ID_IV32: - return new Indeo3Decoder(_bmInfo.width, _bmInfo.height); -#ifdef VIDEO_CODECS_TRUEMOTION1_H - case ID_DUCK: - case ID_DUCK2: - return new TrueMotion1Decoder(_bmInfo.width, _bmInfo.height); -#endif -#ifdef USE_MPEG2 - case ID_MPG2: - return new MPEGDecoder(); -#endif - case ID_MJPG: - return new MJPEGDecoder(); - default: - warning("Unknown/Unhandled compression format \'%s\'", tag2str(_vidsHeader.streamHandler)); - } - - return 0; +Image::Codec *AVIDecoder::AVIVideoTrack::createCodec() { + return Image::createBitmapCodec(_bmInfo.compression, _bmInfo.width, _bmInfo.height, _bmInfo.bitCount); } void AVIDecoder::AVIVideoTrack::forceTrackEnd() { |