Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

branches\avi_play: MoviePlayer works, at the moment not very fast

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  void gotoFrame(int frame_number);
61  GLuint getNextFrame();
62  GLuint skipFrame(int num_frames);
63  vector<GLuint> getFrameList();
64  void loadMedia(const char* filename);
65
66  int getHeight();
67  int getWidth();
68  int getFrameNumber();
69  double getFPS();
70
71  void saveCurrentFrame();
72
73  void printMediaInformation();
74  void printPacketInformation();
75
76};
77
78
79#endif /* _MEDIA_CONTAINER */
Note: See TracBrowser for help on using the repository browser.