Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 11, 2006, 4:01:06 PM (18 years ago)
Author:
bensch
Message:

orxonox/branches/avi_play_merge: merged the trunk, commit for testing

File:
1 copied

Legend:

Unmodified
Added
Removed
  • branches/avi_play_merge/src/lib/graphics/importer/movie_player.h

    r5960 r6486  
    88#define _MOVIE_PLAYER
    99
     10#include <SDL.h>
     11
     12#ifdef HAVE_AVFORMAT_H
     13  #include <avformat.h>
     14#else
     15  #include <ffmpeg/avformat.h>
     16#endif
     17
    1018#include "glincl.h"
    11 #include "sdlincl.h"
    1219
    13 /* include base_object.h since all classes are derived from this one */
     20#include "light.h"
     21#include "texture.h"
     22#include "material.h"
     23#include "primitive_model.h"
     24
     25// include base_object.h since all classes are derived from this one
    1426#include "base_object.h"
    1527
    16 /* using namespace std is default, this needs to be here */
    17 using namespace std;
    18 
    19 /* The state of the MoviePlayer */
     28// The state of the MoviePlayer
    2029typedef enum MP_STATUS {
    2130  PLAY,
    2231        PAUSE,
    23         STOP,
    24         RECORD
     32        STOP
    2533};
    2634
     
    3038private:
    3139
    32         char* filename;
    33         unsigned int width;
    34         unsigned int height;
     40  Model* model;
     41  Material* material;
    3542
    36         unsigned int frame_rate;
    37         unsigned int current_frame;
    38         float time_since_last_frame;
    39         float speed;
    40        
    41         SDL_Surface* screen;
     43  AVFormatContext* format_context;
     44  AVCodecContext* codec_context;
     45  AVCodec* codec;
     46  AVFrame* frame;
     47  AVPacket packet;
     48  AVFrame* RGB_frame;
     49
     50  GLuint texture;
     51  uint8_t* data;
     52  uint8_t* buffer;
     53  int num_bytes;
     54  int video_stream;
     55
     56  MP_STATUS status;     
     57  float timer;
     58  int start_frame;
     59  int actual_frame;
     60  int frame_number;
     61  float fps;
     62  int duration;
     63  bool loading; 
    4264
    4365public:
    4466
    4567  MoviePlayer(const char* filename);
     68  MoviePlayer();
    4669  ~MoviePlayer();
    4770
    48         void start(unsigned int start_frame);
     71  bool loadMovie(const char* filename);
     72
     73        void start(float start_time);
    4974        void resume();
    5075        void pause();
    5176        void stop();
    5277
    53         void tick(float time);
     78        void tick(float dt);
    5479        const void draw();
    5580
    56         void setSpeed(float speed);
    57         float getSpeed();
     81        void setFPS(float fps);
     82        float getFPS();
    5883        const MP_STATUS getStatus();
     84  void printInformation();
     85
     86private:
     87 
     88  void init();
     89  void getNextFrame();
     90  void skipFrame(int frames);
     91  bool gotoFrame(int frames);
    5992
    6093};
     
    6295
    6396
    64 #endif /* _MOVIE_PLAYER */
     97#endif // _MOVIE_PLAYER
Note: See TracChangeset for help on using the changeset viewer.