diff options
Diffstat (limited to 'libmpcodecs/vf_scale.c')
-rw-r--r-- | libmpcodecs/vf_scale.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c index ac82088de4..6a661c567e 100644 --- a/libmpcodecs/vf_scale.c +++ b/libmpcodecs/vf_scale.c @@ -24,10 +24,10 @@ #include "config.h" #include "mp_msg.h" #include "cpudetect.h" +#include "options.h" #include "img_format.h" #include "mp_image.h" -#include "vd.h" #include "vf.h" #include "fmt-conversion.h" #include "mpbswap.h" @@ -163,9 +163,10 @@ static unsigned int find_best_out(vf_instance_t *vf, int in_format){ return best; } -static int config(struct vf_instance *vf, +static int config(struct vf_instance* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ + struct MPOpts *opts = vf->opts; unsigned int best=find_best_out(vf, outfmt); int vo_flags; int int_sws_flags=0; @@ -347,7 +348,8 @@ static int config(struct vf_instance *vf, break; } } - if(!opt_screen_size_x && !opt_screen_size_y && !(screen_size_xy >= 0.001)){ + if (!opts->screen_size_x && !opts->screen_size_y + && !(opts->screen_size_xy >= 0.001)) { // Compute new d_width and d_height, preserving aspect // while ensuring that both are >= output size in pixels. if (vf->priv->h * d_width > vf->priv->w * d_height) { @@ -363,7 +365,7 @@ static int config(struct vf_instance *vf, return vf_next_config(vf,vf->priv->w,vf->priv->h,d_width,d_height,flags,best); } -static void start_slice(struct vf_instance *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(!(mpi->flags&MP_IMGFLAG_DRAW_CALLBACK)) return; // shouldn't happen // they want slices!!! allocate the buffer. @@ -403,7 +405,7 @@ static void scale(struct SwsContext *sws1, struct SwsContext *sws2, uint8_t *src } } -static void draw_slice(struct vf_instance *vf, +static void draw_slice(struct vf_instance* vf, unsigned char** src, int* stride, int w,int h, int x, int y){ mp_image_t *dmpi=vf->dmpi; if(!dmpi){ @@ -414,7 +416,7 @@ static void draw_slice(struct vf_instance *vf, scale(vf->priv->ctx, vf->priv->ctx2, src, stride, y, h, dmpi->planes, dmpi->stride, vf->priv->interlaced); } -static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ +static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){ mp_image_t *dmpi=mpi->priv; // printf("vf_scale::put_image(): processing whole frame! dmpi=%p flag=%d\n", @@ -441,7 +443,7 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ return vf_next_put_image(vf,dmpi, pts); } -static int control(struct vf_instance *vf, int request, void* data){ +static int control(struct vf_instance* vf, int request, void* data){ int *table; int *inv_table; int r; @@ -504,7 +506,7 @@ static int control(struct vf_instance *vf, int request, void* data){ // supported Input formats: YV12, I420, IYUV, YUY2, UYVY, BGR32, BGR24, BGR16, BGR15, RGB32, RGB24, Y8, Y800 -static int query_format(struct vf_instance *vf, unsigned int fmt){ +static int query_format(struct vf_instance* vf, unsigned int fmt){ switch(fmt){ case IMGFMT_YV12: case IMGFMT_I420: @@ -670,7 +672,7 @@ static const struct size_preset { }; #define ST_OFF(f) M_ST_OFF(struct size_preset,f) -static m_option_t vf_size_preset_fields[] = { +static const m_option_t vf_size_preset_fields[] = { {"w", ST_OFF(w), CONF_TYPE_INT, M_OPT_MIN,1 ,0, NULL}, {"h", ST_OFF(h), CONF_TYPE_INT, M_OPT_MIN,1 ,0, NULL}, { NULL, NULL, 0, 0, 0, 0, NULL } |