Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

branches\avi_play: added ability to get the frames in a list

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
46  vector<SDL_Surface*>    surface_list;
47
48public:
49
50  MediaContainer(const char* filename);
51  ~MediaContainer();
52
53  SDL_Surface* getFrame(int frame_number);
54  SDL_Surface* getNextFrame();
55  vector<SDL_Surface*> getFrameList();
56  void loadMedia(const char* filename);
57
58  int getHeight();
59  int getWidth();
60  int getFrameNumber();
61  double getFPS();
62
63  void saveCurrentFrame();
64
65  void printMediaInformation();
66  void printPacketInformation();
67
68};
69
70
71#endif /* _MEDIA_CONTAINER */
Note: See TracBrowser for help on using the repository browser.