summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_sub.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-16 23:22:55 +0200
committerwm4 <wm4@nowhere>2013-07-16 23:22:55 +0200
commit18b6c01d921c1dea0986bba4bcd867da5605a3d8 (patch)
tree3489728f82c0270a72005f64590781118b02540f /video/filter/vf_sub.c
parenta98aad61f854d9a216675dc54096aa39767c4a35 (diff)
downloadmpv-18b6c01d921c1dea0986bba4bcd867da5605a3d8.tar.bz2
mpv-18b6c01d921c1dea0986bba4bcd867da5605a3d8.tar.xz
video: redo how colorspaces are handled
Instead of handling colorspaces with VFCTRLs/VOCTRLs, make them part of the normal video format negotiation. The colorspace is passed down like other video params with config/reconfig calls. Forcing colorspaces (via the --colormatrix options and properties) is handled differently too: if it's changed, completely reinit the video chain. This is slower and requires a precise seek to the same position to perform an update, but it's simpler and less bug-prone. Considering switching the colorspace at runtime by user-interaction is a rather obscure feature, this is a good change. The colorspace VFCTRLs and VOCTRLs are still kept. The VOs rely on it, and would have to be changed to get rid of them. We'll do that later, and convert them incrementally instead of in one go. Note that controlling the output range now always works on VO level. Basically, this means you can't get vf_scale to output full-range YUV for whatever reason. If that is really wanted, it should be a vf_scale option. the previous behavior didn't make too much sense anyway. This commit fixes a few bugs (such as playing RGB video and converting that to YUV with vf_scale - a recent commit broke this and forced the VO to display YUV as RGB if possible), and might introduce some new ones.
Diffstat (limited to 'video/filter/vf_sub.c')
-rw-r--r--video/filter/vf_sub.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/video/filter/vf_sub.c b/video/filter/vf_sub.c
index e918574c30..e85a58afb7 100644
--- a/video/filter/vf_sub.c
+++ b/video/filter/vf_sub.c
@@ -39,7 +39,6 @@
#include "video/sws_utils.h"
#include "video/memcpy_pic.h"
-#include "video/csputils.h"
#include "core/m_option.h"
#include "core/m_struct.h"
@@ -49,12 +48,10 @@ static const struct vf_priv_s {
int outh, outw;
- struct mp_csp_details csp;
-
struct osd_state *osd;
struct mp_osd_res dim;
} vf_priv_dflt = {
- .csp = MP_CSP_DETAILS_DEFAULTS,
+ 0
};
static int config(struct vf_instance *vf,
@@ -109,8 +106,6 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
mpi = dmpi;
}
- mp_image_set_colorspace_details(mpi, &priv->csp);
-
osd_draw_on_image_p(osd, priv->dim, mpi->pts, OSD_DRAW_SUB_FILTER,
vf->out_pool, mpi);
@@ -132,11 +127,6 @@ static int control(vf_instance_t *vf, int request, void *data)
break;
case VFCTRL_INIT_OSD:
return CONTROL_TRUE;
- case VFCTRL_SET_YUV_COLORSPACE: {
- struct mp_csp_details colorspace = *(struct mp_csp_details *)data;
- vf->priv->csp = colorspace;
- break;
- }
}
return vf_next_control(vf, request, data);
}