Rev | Line | |
---|
[5937] | 1 | /*! |
---|
| 2 | * @file media_container.h |
---|
| 3 | * Manages the media files |
---|
| 4 | |
---|
| 5 | */ |
---|
| 6 | |
---|
| 7 | #ifndef _MEDIA_CONTAINER |
---|
| 8 | #define _MEDIA_CONTAINER |
---|
| 9 | |
---|
| 10 | /* FFmpeg */ |
---|
[5959] | 11 | //#include "ffmpeg/avformat.h" |
---|
[5937] | 12 | |
---|
[5959] | 13 | #ifdef HAVE_AVFORMAT_H |
---|
| 14 | #include <avformat.h> |
---|
| 15 | #else |
---|
| 16 | #include <ffmpeg/avformat.h> |
---|
| 17 | #endif |
---|
| 18 | |
---|
[5937] | 19 | #include "glincl.h" |
---|
| 20 | |
---|
| 21 | /* include base_object.h since all classes are derived from this one */ |
---|
| 22 | #include "base_object.h" |
---|
| 23 | |
---|
| 24 | /* using namespace std is default, this needs to be here */ |
---|
| 25 | using namespace std; |
---|
| 26 | |
---|
| 27 | class MediaContainer : public BaseObject |
---|
| 28 | { |
---|
| 29 | |
---|
| 30 | private: |
---|
| 31 | |
---|
| 32 | char* filename; |
---|
| 33 | int current_frame; |
---|
| 34 | |
---|
| 35 | AVFormatContext* format_context; |
---|
| 36 | AVCodecContext* codec_context; |
---|
| 37 | AVCodec* codec; |
---|
| 38 | AVFrame* frame; |
---|
| 39 | AVPacket packet; |
---|
| 40 | |
---|
| 41 | int num_bytes; |
---|
| 42 | int video_stream; |
---|
| 43 | |
---|
| 44 | public: |
---|
| 45 | |
---|
[5939] | 46 | MediaContainer(const char* filename); |
---|
[5937] | 47 | ~MediaContainer(); |
---|
| 48 | |
---|
| 49 | GLuint getFrame(int frame_number); |
---|
| 50 | GLuint getNextFrame(); |
---|
| 51 | void loadMedia(char* filename); |
---|
| 52 | |
---|
| 53 | int getHeight(); |
---|
| 54 | int getWidth(); |
---|
| 55 | int getFrameRate(); |
---|
| 56 | void getStream(/* stream */); |
---|
| 57 | |
---|
| 58 | }; |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | |
---|
| 62 | #endif /* _MEDIA_CONTAINER */ |
---|
Note: See
TracBrowser
for help on using the repository browser.