ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

image/codecs/mpeg.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifdef USE_MPEG2
00024 
00025 #ifndef IMAGE_CODECS_MPEG_H
00026 #define IMAGE_CODECS_MPEG_H
00027 
00028 #include "common/inttypes.h"
00029 #include "image/codecs/codec.h"
00030 #include "graphics/pixelformat.h"
00031 
00032 extern "C" {
00033     #include <mpeg2dec/mpeg2.h>
00034 }
00035 
00036 namespace Common {
00037 class SeekableReadStream;
00038 }
00039 
00040 namespace Graphics {
00041 struct Surface;
00042 }
00043 
00044 namespace Image {
00045 
00051 class MPEGDecoder : public Codec {
00052 public:
00053     MPEGDecoder();
00054     ~MPEGDecoder();
00055 
00056     // Codec interface
00057     const Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream);
00058     Graphics::PixelFormat getPixelFormat() const { return _pixelFormat; }
00059 
00060     // MPEGPSDecoder call
00061     bool decodePacket(Common::SeekableReadStream &packet, uint32 &framePeriod, Graphics::Surface *dst = 0);
00062 
00063 private:
00064     Graphics::PixelFormat _pixelFormat;
00065     Graphics::Surface *_surface;
00066 
00067     enum {
00068         BUFFER_SIZE = 4096
00069     };
00070 
00071     byte _buffer[BUFFER_SIZE];
00072     mpeg2dec_t *_mpegDecoder;
00073     const mpeg2_info_t *_mpegInfo;
00074 };
00075 
00076 } // End of namespace Image
00077 
00078 #endif // IMAGE_CODECS_MPEG_H
00079 
00080 #endif // USE_MPEG2


Generated on Sat May 25 2019 05:00:50 for ResidualVM by doxygen 1.7.1
curved edge   curved edge