summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_expand.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/vf_expand.c')
-rw-r--r--libmpcodecs/vf_expand.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/libmpcodecs/vf_expand.c b/libmpcodecs/vf_expand.c
index 44a5549e19..0ed82f586f 100644
--- a/libmpcodecs/vf_expand.c
+++ b/libmpcodecs/vf_expand.c
@@ -7,6 +7,7 @@
#include "config.h"
#include "mp_msg.h"
#include "help_mp.h"
+#include "options.h"
#include "img_format.h"
#include "mp_image.h"
@@ -44,13 +45,10 @@ static struct vf_priv_s {
0
};
-extern int opt_screen_size_x;
-extern int opt_screen_size_y;
-
//===========================================================================//
#ifdef OSD_SUPPORT
-static struct vf_instance_s* vf=NULL; // fixme (needs sub.c changes)
+static struct vf_instance* vf=NULL; // fixme (needs sub.c changes)
static int orig_w,orig_h;
static void remove_func_2(int x0,int y0, int w,int h){
@@ -96,7 +94,7 @@ static void remove_func(int x0,int y0, int w,int h){
}
}
-static void draw_func(int x0,int y0, int w,int h,unsigned char* src, unsigned char *srca, int stride){
+static void draw_func(void *ctx, int x0,int y0, int w,int h,unsigned char* src, unsigned char *srca, int stride){
unsigned char* dst;
if(!vo_osd_changed_flag && vf->dmpi->planes[0]==vf->priv->fb_ptr){
// ok, enough to update the area inside the video, leave the black bands
@@ -156,7 +154,7 @@ static void draw_func(int x0,int y0, int w,int h,unsigned char* src, unsigned ch
}
}
-static void draw_osd(struct vf_instance_s* vf_,int w,int h){
+static void draw_osd(struct vf_instance* vf_,int w,int h){
vf=vf_;orig_w=w;orig_h=h;
// printf("======================================\n");
if(vf->priv->exp_w!=w || vf->priv->exp_h!=h ||
@@ -177,7 +175,7 @@ static void draw_osd(struct vf_instance_s* vf_,int w,int h){
vo_remove_text(vf->priv->exp_w,vf->priv->exp_h,remove_func);
}
}
- vo_draw_text(vf->priv->exp_w,vf->priv->exp_h,draw_func);
+ osd_draw_text(vf->priv->exp_w,vf->priv->exp_h,draw_func, NULL);
// save buffer pointer for double buffering detection - yes, i know it's
// ugly method, but note that codecs with DR support does the same...
if(vf->dmpi)
@@ -187,9 +185,11 @@ static void draw_osd(struct vf_instance_s* vf_,int w,int h){
#endif
//===========================================================================//
-static int config(struct vf_instance_s* vf,
+static int config(struct vf_instance* vf,
int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt){
+ unsigned int flags, unsigned int outfmt)
+{
+ struct MPOpts *opts = vf->opts;
if(outfmt == IMGFMT_MPEGPES) {
vf->priv->passthrough = 1;
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
@@ -225,7 +225,7 @@ static int config(struct vf_instance_s* vf,
if(vf->priv->exp_y<0 || vf->priv->exp_y+height>vf->priv->exp_h) vf->priv->exp_y=(vf->priv->exp_h-height)/2;
vf->priv->fb_ptr=NULL;
- if(!opt_screen_size_x && !opt_screen_size_y){
+ if(!opts->screen_size_x && !opts->screen_size_y){
d_width=d_width*vf->priv->exp_w/width;
d_height=d_height*vf->priv->exp_h/height;
}
@@ -238,7 +238,7 @@ static int config(struct vf_instance_s* vf,
// codec -copy-> expand --DR--> vo
// codec -copy-> expand -copy-> vo (worst case)
-static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){
+static void get_image(struct vf_instance* vf, mp_image_t *mpi){
// if(mpi->type==MP_IMGTYPE_IPB) return; // not yet working
#ifdef OSD_SUPPORT
if(vf->priv->osd && (mpi->flags&MP_IMGFLAG_PRESERVE)){
@@ -285,7 +285,7 @@ static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){
}
}
-static void start_slice(struct vf_instance_s* vf, mp_image_t *mpi){
+static void start_slice(struct vf_instance* vf, mp_image_t *mpi){
// printf("start_slice called! flag=%d\n",mpi->flags&MP_IMGFLAG_DRAW_CALLBACK);
if(!vf->next->draw_slice){
mpi->flags&=~MP_IMGFLAG_DRAW_CALLBACK;
@@ -303,7 +303,7 @@ static void start_slice(struct vf_instance_s* vf, mp_image_t *mpi){
vf->priv->first_slice = 1;
}
-static void draw_top_blackbar_slice(struct vf_instance_s* vf,
+static void draw_top_blackbar_slice(struct vf_instance* vf,
unsigned char** src, int* stride, int w,int h, int x, int y){
if(vf->priv->exp_y>0 && y == 0) {
vf_next_draw_slice(vf, vf->dmpi->planes, vf->dmpi->stride,
@@ -312,7 +312,7 @@ static void draw_top_blackbar_slice(struct vf_instance_s* vf,
}
-static void draw_bottom_blackbar_slice(struct vf_instance_s* vf,
+static void draw_bottom_blackbar_slice(struct vf_instance* vf,
unsigned char** src, int* stride, int w,int h, int x, int y){
if(vf->priv->exp_y+vf->h<vf->dmpi->h && y+h == vf->h) {
unsigned char *src2[MP_MAX_PLANES];
@@ -332,7 +332,7 @@ static void draw_bottom_blackbar_slice(struct vf_instance_s* vf,
}
}
-static void draw_slice(struct vf_instance_s* vf,
+static void draw_slice(struct vf_instance* vf,
unsigned char** src, int* stride, int w,int h, int x, int y){
// printf("draw_slice() called %d at %d\n",h,y);
@@ -355,7 +355,7 @@ static void draw_slice(struct vf_instance_s* vf,
vf->priv->first_slice = 0;
}
-static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
+static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
if (vf->priv->passthrough) {
mp_image_t *dmpi = vf_get_image(vf->next, IMGFMT_MPEGPES,
MP_IMGTYPE_EXPORT, 0, mpi->w, mpi->h);
@@ -410,7 +410,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
//===========================================================================//
-static int control(struct vf_instance_s* vf, int request, void* data){
+static int control(struct vf_instance* vf, int request, void* data){
#ifdef OSD_SUPPORT
switch(request){
case VFCTRL_DRAW_OSD:
@@ -420,7 +420,7 @@ static int control(struct vf_instance_s* vf, int request, void* data){
return vf_next_control(vf,request,data);
}
-static int query_format(struct vf_instance_s* vf, unsigned int fmt){
+static int query_format(struct vf_instance* vf, unsigned int fmt){
return (vf_next_query_format(vf,fmt));
}
@@ -444,7 +444,7 @@ static int open(vf_instance_t *vf, char* args){
}
#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
-static m_option_t vf_opts_fields[] = {
+static const m_option_t vf_opts_fields[] = {
{"w", ST_OFF(exp_w), CONF_TYPE_INT, 0, 0 ,0, NULL},
{"h", ST_OFF(exp_h), CONF_TYPE_INT, 0, 0 ,0, NULL},
{"x", ST_OFF(exp_x), CONF_TYPE_INT, M_OPT_MIN, -1, 0, NULL},
@@ -455,7 +455,7 @@ static m_option_t vf_opts_fields[] = {
{ NULL, NULL, 0, 0, 0, 0, NULL }
};
-static m_struct_t vf_opts = {
+static const m_struct_t vf_opts = {
"expand",
sizeof(struct vf_priv_s),
&vf_priv_dflt,