00001 /* === S Y N F I G ========================================================= */ 00025 /* === S T A R T =========================================================== */ 00026 00027 #ifndef __SYNFIG_MPTR_FFMPEG_H 00028 #define __SYNFIG_MPTR_FFMPEG_H 00029 00030 /* === H E A D E R S ======================================================= */ 00031 00032 #include <synfig/importer.h> 00033 #include <sys/types.h> 00034 #include <stdio.h> 00035 #include "string.h" 00036 #ifdef HAVE_TERMIOS_H 00037 #include <termios.h> 00038 00039 #endif 00040 00041 #include <synfig/surface.h> 00042 /* === M A C R O S ========================================================= */ 00043 00044 /* === T Y P E D E F S ===================================================== */ 00045 00046 /* === C L A S S E S & S T R U C T S ======================================= */ 00047 00048 class ffmpeg_mptr : public synfig::Importer 00049 { 00050 SYNFIG_IMPORTER_MODULE_EXT 00051 public: 00052 private: 00053 pid_t pid; 00054 synfig::String filename; 00055 FILE *file; 00056 int cur_frame; 00057 synfig::Surface frame; 00058 float fps; 00059 #ifdef HAVE_TERMIOS_H 00060 struct termios oldtty; 00061 #endif 00062 00063 bool seek_to(int frame); 00064 bool grab_frame(void); 00065 00066 public: 00067 ffmpeg_mptr(const char *filename); 00068 ~ffmpeg_mptr(); 00069 00070 virtual bool is_animated(); 00071 00072 virtual bool get_frame(synfig::Surface &surface,synfig::Time time, synfig::ProgressCallback *callback); 00073 }; 00074 00075 /* === E N D =============================================================== */ 00076 00077 #endif