vf: Remove unused VFCTRL_FLIP_PAGE
[mplayer.git] / libmpcodecs / vf.h
blobd0e3c1cba491e6a074bdb6a4754367ee6c98aa9f
1 #ifndef MPLAYER_VF_H
2 #define MPLAYER_VF_H
4 #include "mp_image.h"
6 struct MPOpts;
7 struct vf_instance;
8 struct vf_priv_s;
10 typedef struct vf_info_s {
11 const char *info;
12 const char *name;
13 const char *author;
14 const char *comment;
15 int (*open)(struct vf_instance* vf,char* args);
16 // Ptr to a struct dscribing the options
17 const void* opts;
18 } vf_info_t;
20 #define NUM_NUMBERED_MPI 50
22 typedef struct vf_image_context_s {
23 mp_image_t* static_images[2];
24 mp_image_t* temp_images[1];
25 mp_image_t* export_images[1];
26 mp_image_t* numbered_images[NUM_NUMBERED_MPI];
27 int static_idx;
28 } vf_image_context_t;
30 typedef struct vf_format_context_t {
31 int have_configured;
32 int orig_width, orig_height, orig_fmt;
33 } vf_format_context_t;
35 typedef struct vf_instance {
36 const vf_info_t* info;
37 // funcs:
38 int (*config)(struct vf_instance* vf,
39 int width, int height, int d_width, int d_height,
40 unsigned int flags, unsigned int outfmt);
41 int (*control)(struct vf_instance* vf,
42 int request, void* data);
43 int (*query_format)(struct vf_instance* vf,
44 unsigned int fmt);
45 void (*get_image)(struct vf_instance* vf,
46 mp_image_t *mpi);
47 int (*put_image)(struct vf_instance* vf,
48 mp_image_t *mpi, double pts);
49 void (*start_slice)(struct vf_instance* vf,
50 mp_image_t *mpi);
51 void (*draw_slice)(struct vf_instance* vf,
52 unsigned char** src, int* stride, int w,int h, int x, int y);
53 void (*uninit)(struct vf_instance* vf);
55 int (*continue_buffered_image)(struct vf_instance* vf);
56 // caps:
57 unsigned int default_caps; // used by default query_format()
58 unsigned int default_reqs; // used by default config()
59 // data:
60 int w, h;
61 vf_image_context_t imgctx;
62 vf_format_context_t fmt;
63 struct vf_instance* next;
64 mp_image_t *dmpi;
65 struct vf_priv_s* priv;
66 struct MPOpts *opts;
67 } vf_instance_t;
69 // control codes:
70 #include "mpc_info.h"
72 typedef struct vf_seteq_s
74 const char *item;
75 int value;
76 } vf_equalizer_t;
78 #define VFCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */
79 #define VFCTRL_SET_PP_LEVEL 5 /* set postprocessing level */
80 #define VFCTRL_SET_EQUALIZER 6 /* set color options (brightness,contrast etc) */
81 #define VFCTRL_GET_EQUALIZER 8 /* gset color options (brightness,contrast etc) */
82 #define VFCTRL_DRAW_OSD 7
83 #define VFCTRL_CHANGE_RECTANGLE 9 /* Change the rectangle boundaries */
84 #define VFCTRL_DUPLICATE_FRAME 11 /* For encoding - encode zero-change frame */
85 #define VFCTRL_SKIP_NEXT_FRAME 12 /* For encoding - drop the next frame that passes thru */
86 #define VFCTRL_FLUSH_FRAMES 13 /* For encoding - flush delayed frames */
87 #define VFCTRL_SCREENSHOT 14 /* Make a screenshot */
88 #define VFCTRL_INIT_EOSD 15 /* Select EOSD renderer */
89 #define VFCTRL_DRAW_EOSD 16 /* Render EOSD */
90 #define VFCTRL_SET_DEINTERLACE 18 /* Set deinterlacing status */
91 #define VFCTRL_GET_DEINTERLACE 19 /* Get deinterlacing status */
92 /* Hack to make the OSD state object available to vf_expand which accesses
93 * the OSD state outside of normal OSD draw time. */
94 #define VFCTRL_SET_OSD_OBJ 20
95 #define VFCTRL_REDRAW_OSD 21 /* Change user-visible OSD immediately */
97 #include "vfcap.h"
99 //FIXME this should be in a common header, but i dunno which
100 #define MP_NOPTS_VALUE (-1LL<<63) //both int64_t and double should be able to represent this exactly
103 // functions:
104 void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h);
105 mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h);
107 vf_instance_t* vf_open_plugin(struct MPOpts *opts, const vf_info_t* const* filter_list, vf_instance_t* next, const char *name, char **args);
108 vf_instance_t* vf_open_filter(struct MPOpts *opts, vf_instance_t* next, const char *name, char **args);
109 vf_instance_t* vf_add_before_vo(vf_instance_t **vf, char *name, char **args);
110 vf_instance_t* vf_open_encoder(struct MPOpts *opts, vf_instance_t* next, const char *name, char *args);
112 unsigned int vf_match_csp(vf_instance_t** vfp,const unsigned int* list,unsigned int preferred);
113 void vf_clone_mpi_attributes(mp_image_t* dst, mp_image_t* src);
114 void vf_queue_frame(vf_instance_t *vf, int (*)(vf_instance_t *));
115 int vf_output_queued_frame(vf_instance_t *vf);
117 // default wrappers:
118 int vf_next_config(struct vf_instance* vf,
119 int width, int height, int d_width, int d_height,
120 unsigned int flags, unsigned int outfmt);
121 int vf_next_control(struct vf_instance* vf, int request, void* data);
122 int vf_next_query_format(struct vf_instance* vf, unsigned int fmt);
123 int vf_next_put_image(struct vf_instance* vf,mp_image_t *mpi, double pts);
124 void vf_next_draw_slice (struct vf_instance* vf, unsigned char** src, int* stride, int w,int h, int x, int y);
126 struct m_obj_settings;
127 vf_instance_t* append_filters(vf_instance_t* last, struct m_obj_settings *vf_settings);
129 void vf_uninit_filter(vf_instance_t* vf);
130 void vf_uninit_filter_chain(vf_instance_t* vf);
132 int vf_config_wrapper(struct vf_instance* vf,
133 int width, int height, int d_width, int d_height,
134 unsigned int flags, unsigned int outfmt);
136 #endif /* MPLAYER_VF_H */