adding the code documentation guide lines
[mplayer/glamo.git] / libmpcodecs / vf.h
blobe14a9cc174ab386de7263ff51e847675b27eb32f
2 struct vf_instance_s;
3 struct vf_priv_s;
5 typedef struct vf_info_s {
6 const char *info;
7 const char *name;
8 const char *author;
9 const char *comment;
10 int (*open)(struct vf_instance_s* vf,char* args);
11 // Ptr to a struct dscribing the options
12 void* opts;
13 } vf_info_t;
15 typedef struct vf_image_context_s {
16 mp_image_t* static_images[2];
17 mp_image_t* temp_images[1];
18 mp_image_t* export_images[1];
19 int static_idx;
20 } vf_image_context_t;
22 typedef struct vf_instance_s {
23 vf_info_t* info;
24 // funcs:
25 int (*config)(struct vf_instance_s* vf,
26 int width, int height, int d_width, int d_height,
27 unsigned int flags, unsigned int outfmt);
28 int (*control)(struct vf_instance_s* vf,
29 int request, void* data);
30 int (*query_format)(struct vf_instance_s* vf,
31 unsigned int fmt);
32 void (*get_image)(struct vf_instance_s* vf,
33 mp_image_t *mpi);
34 int (*put_image)(struct vf_instance_s* vf,
35 mp_image_t *mpi);
36 void (*start_slice)(struct vf_instance_s* vf,
37 mp_image_t *mpi);
38 void (*draw_slice)(struct vf_instance_s* vf,
39 unsigned char** src, int* stride, int w,int h, int x, int y);
40 void (*uninit)(struct vf_instance_s* vf);
41 // caps:
42 unsigned int default_caps; // used by default query_format()
43 unsigned int default_reqs; // used by default config()
44 // data:
45 vf_image_context_t imgctx;
46 struct vf_instance_s* next;
47 mp_image_t *dmpi;
48 struct vf_priv_s* priv;
49 } vf_instance_t;
51 // control codes:
52 #include "mpc_info.h"
54 typedef struct vf_seteq_s
56 char *item;
57 int value;
58 } vf_equalizer_t;
60 #define VFCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */
61 #define VFCTRL_SET_PP_LEVEL 5 /* set postprocessing level */
62 #define VFCTRL_SET_EQUALIZER 6 /* set color options (brightness,contrast etc) */
63 #define VFCTRL_GET_EQUALIZER 8 /* gset color options (brightness,contrast etc) */
64 #define VFCTRL_DRAW_OSD 7
65 #define VFCTRL_CHANGE_RECTANGLE 9 /* Change the rectangle boundaries */
66 #define VFCTRL_FLIP_PAGE 10 /* Tell the vo to flip pages */
67 #define VFCTRL_DUPLICATE_FRAME 11 /* For encoding - encode zero-change frame */
68 #define VFCTRL_SKIP_NEXT_FRAME 12 /* For encoding - drop the next frame that passes thru */
70 #include "vfcap.h"
72 // functions:
73 void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h);
74 mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h);
76 vf_instance_t* vf_open_plugin(vf_info_t** filter_list, vf_instance_t* next, char *name, char **args);
77 vf_instance_t* vf_open_filter(vf_instance_t* next, char *name, char **args);
78 vf_instance_t* vf_open_encoder(vf_instance_t* next, char *name, char *args);
80 unsigned int vf_match_csp(vf_instance_t** vfp,unsigned int* list,unsigned int preferred);
81 void vf_clone_mpi_attributes(mp_image_t* dst, mp_image_t* src);
83 // default wrappers:
84 int vf_next_config(struct vf_instance_s* vf,
85 int width, int height, int d_width, int d_height,
86 unsigned int flags, unsigned int outfmt);
87 int vf_next_control(struct vf_instance_s* vf, int request, void* data);
88 int vf_next_query_format(struct vf_instance_s* vf, unsigned int fmt);
89 int vf_next_put_image(struct vf_instance_s* vf,mp_image_t *mpi);
90 void vf_next_draw_slice (struct vf_instance_s* vf, unsigned char** src, int* stride, int w,int h, int x, int y);
92 vf_instance_t* append_filters(vf_instance_t* last);
94 void vf_list_plugins();
96 void vf_uninit_filter(vf_instance_t* vf);
97 void vf_uninit_filter_chain(vf_instance_t* vf);