marked stable
[synfig.git] / synfig-core / tags / stable / src / modules / mod_ffmpeg / mptr_ffmpeg.h
1 /*! ========================================================================
2 ** Sinfg
3 ** Template Header File
4 ** $Id: mptr_ffmpeg.h,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $
5 **
6 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
7 **
8 ** This software and associated documentation
9 ** are CONFIDENTIAL and PROPRIETARY property of
10 ** the above-mentioned copyright holder.
11 **
12 ** You may not copy, print, publish, or in any
13 ** other way distribute this software without
14 ** a prior written agreement with
15 ** the copyright holder.
16 **
17 ** === N O T E S ===========================================================
18 **
19 ** ========================================================================= */
20
21 /* === S T A R T =========================================================== */
22
23 #ifndef __SINFG_MPTR_FFMPEG_H
24 #define __SINFG_MPTR_FFMPEG_H
25
26 /* === H E A D E R S ======================================================= */
27
28 #include <sinfg/importer.h>
29 #include <stdio.h>
30 #include "string.h"
31 #ifdef HAVE_TERMIOS_H
32 #include <termios.h>
33
34 #endif
35
36 #include <sinfg/surface.h>
37 /* === M A C R O S ========================================================= */
38
39 /* === T Y P E D E F S ===================================================== */
40
41 /* === C L A S S E S & S T R U C T S ======================================= */
42
43 class ffmpeg_mptr : public sinfg::Importer
44 {
45         SINFG_IMPORTER_MODULE_EXT
46 public:
47 private:
48         sinfg::String filename;
49         FILE *file;
50         int cur_frame;
51         sinfg::Surface frame;
52         float fps;
53 #ifdef HAVE_TERMIOS_H
54         struct termios oldtty;
55 #endif
56
57         bool seek_to(int frame);
58         bool grab_frame(void);
59         
60 public:
61         ffmpeg_mptr(const char *filename);
62         ~ffmpeg_mptr();
63
64
65         virtual bool get_frame(sinfg::Surface &,sinfg::Time, sinfg::ProgressCallback *);
66 };
67
68 /* === E N D =============================================================== */
69
70 #endif