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