source:
orxonox.OLD/trunk/src/lib/graphics/importer/media_container.h
@
8929
Last change on this file since 8929 was 7221, checked in by bensch, 19 years ago | |
---|---|
File size: 982 bytes |
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 | ||
[6607] | 10 | #include "sdlincl.h" |
[5937] | 11 | |
[5959] | 12 | #ifdef HAVE_AVFORMAT_H |
13 | #include <avformat.h> | |
14 | #else | |
15 | #include <ffmpeg/avformat.h> | |
16 | #endif | |
17 | ||
[5937] | 18 | /* include base_object.h since all classes are derived from this one */ |
19 | #include "base_object.h" | |
[6486] | 20 | #include "texture_sequence.h" |
[5937] | 21 | |
[6486] | 22 | #include "glincl.h" |
[5937] | 23 | |
[6486] | 24 | class MediaContainer : public TextureSequence |
[5937] | 25 | { |
26 | ||
27 | private: | |
28 | ||
[6486] | 29 | AVFormatContext* format_context; |
30 | AVCodecContext* codec_context; | |
31 | AVCodec* codec; | |
32 | AVFrame* frame; | |
33 | AVPacket packet; | |
34 | AVFrame* RGB_frame; | |
[5937] | 35 | |
[6486] | 36 | GLuint texture; |
37 | uint8_t* data; | |
38 | uint8_t* buffer; | |
39 | int num_bytes; | |
40 | int video_stream; | |
41 | double fps; | |
[6731] | 42 | bool mediaLoaded; |
[5937] | 43 | |
44 | public: | |
45 | ||
[7221] | 46 | MediaContainer(const std::string& filename = ""); |
[6981] | 47 | virtual ~MediaContainer(); |
[5937] | 48 | |
[7221] | 49 | bool loadMedia(const std::string& filename); |
[6486] | 50 | void loadFrames(); |
[5937] | 51 | |
[6486] | 52 | double getFPS(); |
53 | ||
54 | private: | |
[6981] | 55 | |
[6486] | 56 | GLuint getNextFrame(); |
[6731] | 57 | void unloadMedia(); |
[5937] | 58 | }; |
59 | ||
60 | ||
61 | #endif /* _MEDIA_CONTAINER */ |
Note: See TracBrowser
for help on using the repository browser.