/*! * @file media_container.h * Manages the media files */ #ifndef _MEDIA_CONTAINER #define _MEDIA_CONTAINER #ifdef HAVE_AVFORMAT_H #include #else #include #endif #include "glincl.h" /* include base_object.h since all classes are derived from this one */ #include "base_object.h" #include /* using namespace std is default, this needs to be here */ using namespace std; class MediaContainer : public BaseObject { private: double fps; Uint32 rmask, gmask, bmask; SDL_Surface *surface; uint8_t* data; AVFormatContext* format_context; AVCodecContext* codec_context; AVCodec* codec; AVFrame* frame; AVPacket packet; AVPicture* picture; AVFrame* RGB_frame; int num_bytes; uint8_t *buffer; int video_stream; public: MediaContainer(const char* filename); ~MediaContainer(); SDL_Surface* getFrame(int frame_number); SDL_Surface* getNextFrame(); void loadMedia(const char* filename); int getHeight(); int getWidth(); int getFrameNumber(); double getFPS(); /* prints some information about the media file for debug reasons */ void printMediaInformation(); void printPacketInformation(); void saveCurrentFrame(); }; #endif /* _MEDIA_CONTAINER */