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