summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-19 19:25:18 +0200
committerwm4 <wm4@nowhere>2012-10-24 21:56:34 +0200
commit4d11f32162b08e3b48ae382e2ed0a151035f8aea (patch)
treec588341bf672fd935de45a05bef99e0d8f20892f /libmpcodecs
parenta4f9077f6c1a897120616cc70c1ca37c6a247be2 (diff)
downloadmpv-4d11f32162b08e3b48ae382e2ed0a151035f8aea.tar.bz2
mpv-4d11f32162b08e3b48ae382e2ed0a151035f8aea.tar.xz
VO, sub: refactor
Remove VFCTRL_DRAW_OSD, VFCAP_EOSD_FILTER, VFCAP_EOSD_RGBA, VFCAP_EOSD, VOCTRL_DRAW_EOSD, VOCTRL_GET_EOSD_RES, VOCTRL_QUERY_EOSD_FORMAT. Remove draw_osd_with_eosd(), which rendered the OSD by calling VOCTRL_DRAW_EOSD. Change VOs to call osd_draw() directly, which takes a callback as argument. (This basically works like the old OSD API, except multiple OSD bitmap formats are supported and caching is possible.) Remove all mentions of "eosd". It's simply "osd" now. Make OSD size per-OSD-object, as they can be different when using vf_sub. Include display_par/video_par in resolution change detection. Fix the issue with margin borders in vo_corevideo.
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vf.h1
-rw-r--r--libmpcodecs/vf_ass.c16
-rw-r--r--libmpcodecs/vf_vo.c5
-rw-r--r--libmpcodecs/vfcap.h4
4 files changed, 6 insertions, 20 deletions
diff --git a/libmpcodecs/vf.h b/libmpcodecs/vf.h
index 8b18470e62..7db9bd5808 100644
--- a/libmpcodecs/vf.h
+++ b/libmpcodecs/vf.h
@@ -99,7 +99,6 @@ struct vf_ctrl_screenshot {
#define VFCTRL_SET_PP_LEVEL 5 // set postprocessing level
#define VFCTRL_SET_EQUALIZER 6 // set color options (brightness,contrast etc)
#define VFCTRL_GET_EQUALIZER 8 // get color options (brightness,contrast etc)
-#define VFCTRL_DRAW_OSD 7
#define VFCTRL_DUPLICATE_FRAME 11 // For encoding - encode zero-change frame
#define VFCTRL_SKIP_NEXT_FRAME 12 // For encoding - drop the next frame that passes thru
#define VFCTRL_FLUSH_FRAMES 13 // For encoding - flush delayed frames
diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c
index 9695ecfdfc..1da0b03b44 100644
--- a/libmpcodecs/vf_ass.c
+++ b/libmpcodecs/vf_ass.c
@@ -49,12 +49,12 @@ static const struct vf_priv_s {
unsigned int outfmt;
struct mp_csp_details csp;
- // 1 = auto-added filter: insert only if chain does not support EOSD already
+ // 1 = auto-added filter: insert only if chain does not support OSD already
// 0 = insert always
int auto_insert;
struct osd_state *osd;
- struct mp_eosd_res dim;
+ struct mp_osd_res dim;
} vf_priv_dflt = {
.csp = MP_CSP_DETAILS_DEFAULTS,
};
@@ -78,7 +78,7 @@ static int config(struct vf_instance *vf,
double dar = (double)d_width / d_height;
double sar = (double)width / height;
- vf->priv->dim = (struct mp_eosd_res) {
+ vf->priv->dim = (struct mp_osd_res) {
.w = vf->priv->outw,
.h = vf->priv->outh,
.mt = opts->ass_top_margin,
@@ -227,11 +227,7 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
prepare_image(vf, mpi);
if (pts != MP_NOPTS_VALUE) {
- struct sub_render_params subparams = {
- .pts = pts,
- .dim = priv->dim,
- };
- osd_draw_on_image(osd, &subparams, OSD_DRAW_SUB_FILTER, vf->dmpi,
+ osd_draw_on_image(osd, priv->dim, pts, OSD_DRAW_SUB_FILTER, vf->dmpi,
&priv->csp);
}
@@ -287,7 +283,7 @@ static int vf_open(vf_instance_t *vf, char *args)
if (!vf->priv->outfmt) {
uninit(vf);
return 0;
- } else if (vf->priv->auto_insert && flags & VFCAP_EOSD) {
+ } else if (vf->priv->auto_insert && flags & VFCAP_OSD) {
uninit(vf);
return -1;
}
@@ -301,7 +297,7 @@ static int vf_open(vf_instance_t *vf, char *args)
vf->control = control;
vf->get_image = get_image;
vf->put_image = put_image;
- vf->default_caps = VFCAP_EOSD | VFCAP_EOSD_FILTER;
+ vf->default_caps = VFCAP_OSD;
return 1;
}
diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c
index 998b4b6dfa..16d10f0cdc 100644
--- a/libmpcodecs/vf_vo.c
+++ b/libmpcodecs/vf_vo.c
@@ -91,11 +91,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)
diff --git a/libmpcodecs/vfcap.h b/libmpcodecs/vfcap.h
index 0fb73f5a51..acc7ce31c6 100644
--- a/libmpcodecs/vfcap.h
+++ b/libmpcodecs/vfcap.h
@@ -40,11 +40,7 @@
#define VFCAP_ACCEPT_STRIDE 0x400
// filter does postprocessing (so you shouldn't scale/filter image before it)
#define VFCAP_POSTPROC 0x800
-// filter can draw EOSD
-#define VFCAP_EOSD 0x2000
// used by libvo and vf_vo, indicates the VO does not support draw_slice for this format
#define VOCAP_NOSLICES 0x8000
-#define VFCAP_EOSD_FILTER 0x20000 // EOSD is drawn in filter chain
-#define VFCAP_EOSD_RGBA 0x40000
#endif /* MPLAYER_VFCAP_H */