Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

branches/avi_play: begin of the media_player implementation

File size: 1.2 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/* using namespace std is default, this needs to be here */
23using namespace std;
24
25class MediaContainer : public BaseObject
26{
27
28private:
29
30  double fps;
31  SDL_Surface* surface;
32  uint8_t* data;
33
34  AVFormatContext* format_context;
35  AVCodecContext* codec_context;
36  AVCodec* codec;
37  AVFrame* frame;
38  AVPacket packet;
39  AVFrame* RGB_frame;
40  AVPicture* picture;
41
42  int num_bytes;
43  uint8_t *buffer;
44  int video_stream;
45  int duration;
46
47  vector<SDL_Surface*>    surface_list;
48
49public:
50
51  MediaContainer(const char* filename);
52  MediaContainer();
53  ~MediaContainer();
54
55  SDL_Surface* getFrame(int frame_number);
56  SDL_Surface* getNextFrame();
57  vector<SDL_Surface*> getFrameList();
58  void loadMedia(const char* filename);
59
60  int getHeight();
61  int getWidth();
62  int getFrameNumber();
63  double getFPS();
64
65  void saveCurrentFrame();
66
67  void printMediaInformation();
68  void printPacketInformation();
69
70};
71
72
73#endif /* _MEDIA_CONTAINER */
Note: See TracBrowser for help on using the repository browser.