Changeset 6486 in orxonox.OLD for branches/avi_play_merge/src/lib/graphics/importer/movie_player.h
- Timestamp:
- Jan 11, 2006, 4:01:06 PM (18 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/avi_play_merge/src/lib/graphics/importer/movie_player.h
r5960 r6486 8 8 #define _MOVIE_PLAYER 9 9 10 #include <SDL.h> 11 12 #ifdef HAVE_AVFORMAT_H 13 #include <avformat.h> 14 #else 15 #include <ffmpeg/avformat.h> 16 #endif 17 10 18 #include "glincl.h" 11 #include "sdlincl.h"12 19 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 14 26 #include "base_object.h" 15 27 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 20 29 typedef enum MP_STATUS { 21 30 PLAY, 22 31 PAUSE, 23 STOP, 24 RECORD 32 STOP 25 33 }; 26 34 … … 30 38 private: 31 39 32 char* filename; 33 unsigned int width; 34 unsigned int height; 40 Model* model; 41 Material* material; 35 42 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; 42 64 43 65 public: 44 66 45 67 MoviePlayer(const char* filename); 68 MoviePlayer(); 46 69 ~MoviePlayer(); 47 70 48 void start(unsigned int start_frame); 71 bool loadMovie(const char* filename); 72 73 void start(float start_time); 49 74 void resume(); 50 75 void pause(); 51 76 void stop(); 52 77 53 void tick(float time);78 void tick(float dt); 54 79 const void draw(); 55 80 56 void set Speed(float speed);57 float get Speed();81 void setFPS(float fps); 82 float getFPS(); 58 83 const MP_STATUS getStatus(); 84 void printInformation(); 85 86 private: 87 88 void init(); 89 void getNextFrame(); 90 void skipFrame(int frames); 91 bool gotoFrame(int frames); 59 92 60 93 }; … … 62 95 63 96 64 #endif / * _MOVIE_PLAYER */97 #endif // _MOVIE_PLAYER
Note: See TracChangeset
for help on using the changeset viewer.