summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_vo.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/vf_vo.c')
-rw-r--r--libmpcodecs/vf_vo.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c
index 862cd63492..d11724f881 100644
--- a/libmpcodecs/vf_vo.c
+++ b/libmpcodecs/vf_vo.c
@@ -34,11 +34,9 @@
struct vf_priv_s {
struct vo *vo;
- double scale_ratio;
};
#define video_out (vf->priv->vo)
-static int query_format(struct vf_instance *vf, unsigned int fmt);
static void draw_slice(struct vf_instance *vf, unsigned char **src,
int *stride, int w, int h, int x, int y);
@@ -67,14 +65,12 @@ static int config(struct vf_instance *vf,
if (info->comment && strlen(info->comment) > 0)
mp_msg(MSGT_CPLAYER, MSGL_V, "VO: Comment: %s\n", info->comment);
- // save vo's stride capability for the wanted colorspace:
- vf->default_caps = query_format(vf, outfmt);
- vf->draw_slice = (vf->default_caps & VOCAP_NOSLICES) ? NULL : draw_slice;
-
if (vo_config(video_out, width, height, d_width, d_height, flags, outfmt))
return 0;
- vf->priv->scale_ratio = (double) d_width / d_height * height / width;
+ // save vo's stride capability for the wanted colorspace:
+ vf->default_caps = video_out->default_caps;
+ vf->draw_slice = (vf->default_caps & VOCAP_NOSLICES) ? NULL : draw_slice;
return 1;
}
@@ -94,11 +90,6 @@ static int control(struct vf_instance *vf, int request, void *data)
return vo_control(video_out, VOCTRL_GET_YUV_COLORSPACE, data) == true;
case VFCTRL_SET_YUV_COLORSPACE:
return vo_control(video_out, VOCTRL_SET_YUV_COLORSPACE, data) == true;
- case VFCTRL_DRAW_OSD:
- if (!video_out->config_ok)
- return CONTROL_FALSE; // vo not configured?
- vo_draw_osd(video_out, data);
- return CONTROL_TRUE;
case VFCTRL_SET_EQUALIZER: {
vf_equalizer_t *eq = data;
if (!video_out->config_ok)
@@ -117,20 +108,6 @@ static int control(struct vf_instance *vf, int request, void *data)
};
return vo_control(video_out, VOCTRL_GET_EQUALIZER, &param) == VO_TRUE;
}
- case VFCTRL_DRAW_EOSD: {
- struct osd_state *osd = data;
- osd->support_rgba = vf->default_caps & VFCAP_EOSD_RGBA;
- osd->dim = (struct mp_eosd_res){0};
- if (!video_out->config_ok ||
- vo_control(video_out, VOCTRL_GET_EOSD_RES, &osd->dim) != true)
- return CONTROL_FALSE;
- osd->normal_scale = 1;
- osd->vsfilter_scale = vf->priv->scale_ratio;
- osd->unscaled = vf->default_caps & VFCAP_EOSD_UNSCALED;
- struct sub_bitmaps images;
- sub_get_bitmaps(osd, &images);
- return vo_control(video_out, VOCTRL_DRAW_EOSD, &images) == VO_TRUE;
- }
}
return CONTROL_UNKNOWN;
}