initial revision.
[swftools.git] / avi2swf / v2swf.h
1 /*  v2swf.c 
2     header file for v2swf.h - part of SWFTools
3
4     Copyright (C) 2003 Matthias Kramm <kramm@quiss.org>
5
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
19 #ifndef __video_h__
20 #define __video_h__
21
22 #ifdef __cplusplus
23 extern "C" {
24 #else
25 typedef unsigned char bool;
26 #endif
27
28 typedef struct _videoreader_t
29 {
30     void*internal;
31
32     /* video */
33     int width;
34     int height;
35     double fps;
36
37     /* audio */
38     int channels;
39     int rate;
40
41     int (*getsamples) (struct _videoreader_t*, void*buffer, int num);
42     /* buffer must be big enough to hold width*height*4 bytes: */
43     int (*getimage) (struct _videoreader_t*, void*buffer);
44     bool (*eof) (struct _videoreader_t*);
45     /* multi purpose functions */
46     void (*setparameter) (struct _videoreader_t*, char*name, char*value);
47     void* (*getinfo) (struct _videoreader_t*, char*name);
48     void (*close) (struct _videoreader_t*);
49 } videoreader_t;
50
51 #define videoreader_getsamples(v, buffer, num) ((v)->getsamples((v),(buffer),(num)))
52 #define videoreader_getimage(v, buffer) ((v)->getimage((v),(buffer)))
53 #define videoreader_eof(v) ((v)->eof(v))
54 #define videoreader_setparameter(v,name,value) ((v)->setparameter((v),(name),(value)))
55 #define videoreader_getinfo(v,name) ((v)->getinfo((v),(name)))
56 #define videoreader_close(v) ((v)->close(v))
57
58 typedef struct _v2swf_t
59 {
60     void*internal;
61 } v2swf_t;
62
63 int v2swf_init(v2swf_t*v2swf, videoreader_t * video);
64 int v2swf_read(v2swf_t*v2swf, void*buffer, int len);
65 void v2swf_setparameter(v2swf_t*v2swf, char*name, char*value);
66 void v2swf_close(v2swf_t*v2swf);
67 void v2swf_backpatch(v2swf_t*v2swf, char*filename);
68
69 #ifdef __cplusplus
70 }
71 #endif
72
73 #endif