00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MPLAYER_VF_H
00020 #define MPLAYER_VF_H
00021
00022
00023 #include "mp_image.h"
00024
00025
00026
00027
00028 struct vf_instance;
00029 struct vf_priv_s;
00030
00031 typedef struct vf_info_s {
00032 const char *info;
00033 const char *name;
00034 const char *author;
00035 const char *comment;
00036 int (*vf_open)(struct vf_instance *vf,char* args);
00037
00038 const void* opts;
00039 } vf_info_t;
00040
00041 #define NUM_NUMBERED_MPI 50
00042
00043 typedef struct vf_image_context_s {
00044 mp_image_t* static_images[2];
00045 mp_image_t* temp_images[1];
00046 mp_image_t* export_images[1];
00047 mp_image_t* numbered_images[NUM_NUMBERED_MPI];
00048 int static_idx;
00049 } vf_image_context_t;
00050
00051 typedef struct vf_format_context_t {
00052 int have_configured;
00053 int orig_width, orig_height, orig_fmt;
00054 } vf_format_context_t;
00055
00056 typedef struct vf_instance {
00057 const vf_info_t* info;
00058
00059 int (*config)(struct vf_instance *vf,
00060 int width, int height, int d_width, int d_height,
00061 unsigned int flags, unsigned int outfmt);
00062 int (*control)(struct vf_instance *vf,
00063 int request, void* data);
00064 int (*query_format)(struct vf_instance *vf,
00065 unsigned int fmt);
00066 void (*get_image)(struct vf_instance *vf,
00067 mp_image_t *mpi);
00068 int (*put_image)(struct vf_instance *vf,
00069 mp_image_t *mpi, double pts);
00070 void (*start_slice)(struct vf_instance *vf,
00071 mp_image_t *mpi);
00072 void (*draw_slice)(struct vf_instance *vf,
00073 unsigned char** src, int* stride, int w,int h, int x, int y);
00074 void (*uninit)(struct vf_instance *vf);
00075
00076 int (*continue_buffered_image)(struct vf_instance *vf);
00077
00078 unsigned int default_caps;
00079 unsigned int default_reqs;
00080
00081 int w, h;
00082 vf_image_context_t imgctx;
00083 vf_format_context_t fmt;
00084 struct vf_instance *next;
00085 mp_image_t *dmpi;
00086 struct vf_priv_s* priv;
00087 } vf_instance_t;
00088
00089
00090 #include "mpc_info.h"
00091
00092 typedef struct vf_seteq_s
00093 {
00094 const char *item;
00095 int value;
00096 } vf_equalizer_t;
00097
00098 #define VFCTRL_QUERY_MAX_PP_LEVEL 4
00099 #define VFCTRL_SET_PP_LEVEL 5
00100 #define VFCTRL_SET_EQUALIZER 6
00101 #define VFCTRL_GET_EQUALIZER 8
00102 #define VFCTRL_DRAW_OSD 7
00103 #define VFCTRL_CHANGE_RECTANGLE 9
00104 #define VFCTRL_FLIP_PAGE 10
00105 #define VFCTRL_DUPLICATE_FRAME 11
00106 #define VFCTRL_SKIP_NEXT_FRAME 12
00107 #define VFCTRL_FLUSH_FRAMES 13
00108 #define VFCTRL_SCREENSHOT 14
00109 #define VFCTRL_INIT_EOSD 15
00110 #define VFCTRL_DRAW_EOSD 16
00111 #define VFCTRL_GET_PTS 17
00112 #define VFCTRL_SET_DEINTERLACE 18
00113 #define VFCTRL_GET_DEINTERLACE 19
00114
00115 #include "vfcap.h"
00116
00117
00118 #define MP_NOPTS_VALUE (-1LL<<63) //both int64_t and double should be able to represent this exactly
00119
00120
00121
00122 void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h);
00123 mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h);
00124
00125 vf_instance_t* vf_open_plugin(const vf_info_t* const* filter_list, vf_instance_t* next, const char *name, char **args);
00126 vf_instance_t* vf_open_filter(vf_instance_t* next, const char *name, char **args);
00127 vf_instance_t* vf_add_before_vo(vf_instance_t **vf, char *name, char **args);
00128 vf_instance_t* vf_open_encoder(vf_instance_t* next, const char *name, char *args);
00129
00130 unsigned int vf_match_csp(vf_instance_t** vfp,const unsigned int* list,unsigned int preferred);
00131 void vf_clone_mpi_attributes(mp_image_t* dst, mp_image_t* src);
00132 void vf_queue_frame(vf_instance_t *vf, int (*)(vf_instance_t *));
00133 int vf_output_queued_frame(vf_instance_t *vf);
00134
00135
00136 int vf_next_config(struct vf_instance *vf,
00137 int width, int height, int d_width, int d_height,
00138 unsigned int flags, unsigned int outfmt);
00139 int vf_next_control(struct vf_instance *vf, int request, void* data);
00140 void vf_extra_flip(struct vf_instance *vf);
00141 int vf_next_query_format(struct vf_instance *vf, unsigned int fmt);
00142 int vf_next_put_image(struct vf_instance *vf,mp_image_t *mpi, double pts);
00143 void vf_next_draw_slice (struct vf_instance *vf, unsigned char** src, int* stride, int w,int h, int x, int y);
00144
00145 vf_instance_t* append_filters(vf_instance_t* last);
00146
00147 void vf_uninit_filter(vf_instance_t* vf);
00148 void vf_uninit_filter_chain(vf_instance_t* vf);
00149
00150 int vf_config_wrapper(struct vf_instance *vf,
00151 int width, int height, int d_width, int d_height,
00152 unsigned int flags, unsigned int outfmt);
00153
00154 static inline int norm_qscale(int qscale, int type)
00155 {
00156 switch (type) {
00157 case 0:
00158 return qscale;
00159 case 1:
00160 return qscale >> 1;
00161 case 2:
00162 return qscale >> 2;
00163 case 3:
00164 return (63 - qscale + 2) >> 2;
00165 }
00166 return qscale;
00167 }
00168
00169 #endif