summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-05 22:55:35 +0100
committerwm4 <wm4@nowhere>2013-12-05 22:58:54 +0100
commit66e20ef8ad0c3e3ce420f08fa7849000a4cc060a (patch)
tree0ddad02966c4b878cd02e745dcd30158ad0108d2 /video
parentb2c4653b8841dba16e0dcc38fd49f9ae5b1166ff (diff)
downloadmpv-66e20ef8ad0c3e3ce420f08fa7849000a4cc060a.tar.bz2
mpv-66e20ef8ad0c3e3ce420f08fa7849000a4cc060a.tar.xz
video: remove --flip
The --flip option flipped the image upside-down, by trying to use VO support, or if not available, by inserting a video filter. I'm not sure why it existed. Maybe it was important in ancient times when VfW based decoders output an image this way (but even then, flipping an image is a free operation by negating the stride). One nice thing about this is that it provided a possible path for implementing video orientation, which is a feature we should probably support eventually. The important part is that it would be for free for VOs that support it, and would work even with hardware decoding. But for now get rid of it. It's useless, trivial, stands in the way, and supporting video orientation would require solving other problems first.
Diffstat (limited to 'video')
-rw-r--r--video/decode/dec_video.c18
-rw-r--r--video/filter/vf_flip.c1
-rw-r--r--video/out/vo_opengl.c2
-rw-r--r--video/out/vo_opengl_old.c2
-rw-r--r--video/out/vo_sdl.c2
-rw-r--r--video/out/vo_vdpau.c2
-rw-r--r--video/vfcap.h2
7 files changed, 7 insertions, 22 deletions
diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c
index bfdeb2c3a7..7b7f7f73fc 100644
--- a/video/decode/dec_video.c
+++ b/video/decode/dec_video.c
@@ -384,7 +384,6 @@ int mpcodecs_reconfig_vo(struct dec_video *d_video,
{
struct MPOpts *opts = d_video->opts;
vf_instance_t *vf = d_video->vfilter;
- int vocfg_flags = 0;
struct mp_image_params p = *params;
struct sh_video *sh = d_video->header->video;
@@ -429,15 +428,6 @@ int mpcodecs_reconfig_vo(struct dec_video *d_video,
}
d_video->vfilter = vf;
- // autodetect flipping
- bool flip = opts->flip;
- if (flip && !(flags & VFCAP_FLIP)) {
- // we need to flip, but no flipping filter avail.
- vf_add_before_vo(&vf, "flip", NULL);
- d_video->vfilter = vf;
- flip = false;
- }
-
float decoder_aspect = p.d_w / (float)p.d_h;
if (d_video->initial_decoder_aspect == 0)
d_video->initial_decoder_aspect = decoder_aspect;
@@ -479,13 +469,11 @@ int mpcodecs_reconfig_vo(struct dec_video *d_video,
// Make sure the user-overrides are consistent (no RGB csp for YUV, etc.).
mp_image_params_guess_csp(&p);
- vocfg_flags = (flip ? VOFLAG_FLIPPING : 0);
-
// Time to config libvo!
- mp_msg(MSGT_CPLAYER, MSGL_V, "VO Config (%dx%d->%dx%d,flags=%d,0x%X)\n",
- p.w, p.h, p.d_w, p.d_h, vocfg_flags, p.imgfmt);
+ mp_msg(MSGT_CPLAYER, MSGL_V, "VO Config (%dx%d->%dx%d,0x%X)\n",
+ p.w, p.h, p.d_w, p.d_h, p.imgfmt);
- if (vf_reconfig_wrapper(vf, &p, vocfg_flags) < 0) {
+ if (vf_reconfig_wrapper(vf, &p, 0) < 0) {
mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "FATAL: Cannot initialize video driver.\n");
d_video->vf_initialized = -1;
return -1;
diff --git a/video/filter/vf_flip.c b/video/filter/vf_flip.c
index 121503c976..b8d2159196 100644
--- a/video/filter/vf_flip.c
+++ b/video/filter/vf_flip.c
@@ -34,7 +34,6 @@ static int config(struct vf_instance *vf, int width, int height,
int d_width, int d_height,
unsigned int flags, unsigned int outfmt)
{
- flags &= ~VOFLAG_FLIPPING; // remove the VO flip flag
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
}
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 774d87ed05..714bbf4e6b 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -138,7 +138,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
static int query_format(struct vo *vo, uint32_t format)
{
struct gl_priv *p = vo->priv;
- int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIP;
+ int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
if (!gl_video_check_format(p->renderer, format))
return 0;
return caps;
diff --git a/video/out/vo_opengl_old.c b/video/out/vo_opengl_old.c
index cd4b6915ca..5ae8816900 100644
--- a/video/out/vo_opengl_old.c
+++ b/video/out/vo_opengl_old.c
@@ -2039,7 +2039,7 @@ static int query_format(struct vo *vo, uint32_t format)
struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(format);
int depth = desc.plane_bits;
- int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIP;
+ int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
if (format == IMGFMT_RGB24 || format == IMGFMT_RGBA)
return caps;
if (p->use_yuv && (desc.flags & MP_IMGFLAG_YUV_P) &&
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c
index 86643788b9..384df54b3a 100644
--- a/video/out/vo_sdl.c
+++ b/video/out/vo_sdl.c
@@ -772,7 +772,7 @@ static int query_format(struct vo *vo, uint32_t format)
{
struct priv *vc = vo->priv;
int i, j;
- int cap = VFCAP_CSP_SUPPORTED | VFCAP_FLIP;
+ int cap = VFCAP_CSP_SUPPORTED;
for (i = 0; i < vc->renderer_info.num_texture_formats; ++i)
for (j = 0; j < sizeof(formats) / sizeof(formats[0]); ++j)
if (vc->renderer_info.texture_formats[i] == formats[j].sdl)
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 727fea532f..082ad1a05d 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -1272,7 +1272,7 @@ static int query_format(struct vo *vo, uint32_t format)
{
struct vdpctx *vc = vo->priv;
- int flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIP;
+ int flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
if (mp_vdpau_get_format(format, NULL, NULL))
return flags;
int rgb_format = get_rgb_format(format);
diff --git a/video/vfcap.h b/video/vfcap.h
index 186aca5b4a..281a2f3c9d 100644
--- a/video/vfcap.h
+++ b/video/vfcap.h
@@ -24,7 +24,5 @@
#define VFCAP_CSP_SUPPORTED 0x1
// set, if the given colorspace is supported _without_ conversion
#define VFCAP_CSP_SUPPORTED_BY_HW 0x2
-// driver/filter can do vertical flip (upside-down)
-#define VFCAP_FLIP 0x80
#endif /* MPLAYER_VFCAP_H */