Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/avi_play/src/lib/graphics/importer/media_container.h @ 6317

Last change on this file since 6317 was 6317, checked in by hdavid, 18 years ago

branches\avi_play: MediaContainer returns a texture not a surface, it's faster. MoviePlayer can display the textures, playspeed not yet implemented

File size: 1.3 KB
Line 
1/*!
2 * @file media_container.h
3  *  Manages the media files
4
5*/
6
7#ifndef _MEDIA_CONTAINER
8#define _MEDIA_CONTAINER
9
10#include <SDL.h>
11#include <vector>
12
13#ifdef HAVE_AVFORMAT_H
14  #include <avformat.h>
15#else
16  #include <ffmpeg/avformat.h>
17#endif
18
19/* include base_object.h since all classes are derived from this one */
20#include "base_object.h"
21
22#include "glincl.h"
23
24/* using namespace std is default, this needs to be here */
25using namespace std;
26
27class MediaContainer : public BaseObject
28{
29
30private:
31
32  double fps;
33  SDL_Surface* surface;
34  GLuint texture;
35  uint8_t* data;
36
37  AVFormatContext* format_context;
38  AVCodecContext* codec_context;
39  AVCodec* codec;
40  AVFrame* frame;
41  AVPacket packet;
42  AVFrame* RGB_frame;
43  AVPicture* picture;
44
45  int num_bytes;
46  uint8_t *buffer;
47  int video_stream;
48  int duration;
49  int frame_num;
50
51  vector<GLuint>    texture_list;
52
53public:
54
55  MediaContainer(const char* filename);
56  MediaContainer();
57  ~MediaContainer();
58
59  void init();
60  GLuint getFrame(int frame_number);
61  GLuint getNextFrame();
62  vector<GLuint> getFrameList();
63  void loadMedia(const char* filename);
64
65  int getHeight();
66  int getWidth();
67  int getFrameNumber();
68  double getFPS();
69
70  void saveCurrentFrame();
71
72  void printMediaInformation();
73  void printPacketInformation();
74
75};
76
77
78#endif /* _MEDIA_CONTAINER */
Note: See TracBrowser for help on using the repository browser.