Last change
on this file since 6057 was
6057,
checked in by hdavid, 18 years ago
|
branches\avi_play: MediaContainer opens a videofile and prints some information
|
File size:
1.2 KB
|
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 | |
---|
[5959] | 11 | #ifdef HAVE_AVFORMAT_H |
---|
| 12 | #include <avformat.h> |
---|
| 13 | #else |
---|
| 14 | #include <ffmpeg/avformat.h> |
---|
| 15 | #endif |
---|
| 16 | |
---|
[5962] | 17 | |
---|
[5937] | 18 | #include "glincl.h" |
---|
| 19 | |
---|
| 20 | /* include base_object.h since all classes are derived from this one */ |
---|
| 21 | #include "base_object.h" |
---|
| 22 | |
---|
| 23 | /* using namespace std is default, this needs to be here */ |
---|
| 24 | using namespace std; |
---|
| 25 | |
---|
[6003] | 26 | /* Forward Declaration */ |
---|
| 27 | struct SDL_Surface; |
---|
| 28 | |
---|
[5937] | 29 | class MediaContainer : public BaseObject |
---|
| 30 | { |
---|
| 31 | |
---|
| 32 | private: |
---|
| 33 | |
---|
| 34 | int current_frame; |
---|
[6003] | 35 | int num_frames; |
---|
[5937] | 36 | |
---|
| 37 | AVFormatContext* format_context; |
---|
| 38 | AVCodecContext* codec_context; |
---|
| 39 | AVCodec* codec; |
---|
| 40 | AVFrame* frame; |
---|
| 41 | AVPacket packet; |
---|
| 42 | |
---|
| 43 | int num_bytes; |
---|
| 44 | int video_stream; |
---|
[6057] | 45 | bool frames_left; |
---|
[5937] | 46 | |
---|
| 47 | public: |
---|
| 48 | |
---|
[5939] | 49 | MediaContainer(const char* filename); |
---|
[5937] | 50 | ~MediaContainer(); |
---|
| 51 | |
---|
[6003] | 52 | //GLuint getFrame(int frame_number); |
---|
| 53 | SDL_Surface* getFrame(int frame_number); |
---|
| 54 | //GLuint getNextFrame(); |
---|
| 55 | SDL_Surface* getNextFrame(); |
---|
[5975] | 56 | void loadMedia(const char* filename); |
---|
[5937] | 57 | |
---|
| 58 | int getHeight(); |
---|
| 59 | int getWidth(); |
---|
| 60 | int getFrameRate(); |
---|
| 61 | void getStream(/* stream */); |
---|
| 62 | |
---|
[6057] | 63 | bool framesLeft(); |
---|
| 64 | |
---|
| 65 | /* prints some information about the |
---|
| 66 | media file for debug reasons */ |
---|
| 67 | void printMediaInformation(); |
---|
| 68 | |
---|
[5937] | 69 | }; |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | #endif /* _MEDIA_CONTAINER */ |
---|
Note: See
TracBrowser
for help on using the repository browser.