From 53ee9aa6aedbd809ea98eb66078b13008d6f26ed Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 15 Nov 2012 15:03:40 +0100 Subject: options, vo_x11: remove -zoom option, make it default The -zoom option enabled scaling with vo_x11. Remove the -zoom option, and make its behavior default. Since vo_x11 has to use libswscale for colorspace conversion anyway, which doesn't do actual extra scaling when vo_x11 is run in windowed mode, there should be no speed difference with this change. The code removed from vf_scale attempted to scale the video to d_width/ d_height, which matters for anamorphic video and the --xy option only. vo_x11 can handle these natively. The only case for which the removed vf_scale code could matter is encoding with vo_lavc, but since that didn't set VOFLAG_SWSCALE, nothing actually changes. --- DOCS/man/en/options.rst | 3 --- core/cfg-mplayer.h | 1 - core/options.h | 1 - video/decode/vd.c | 1 - video/filter/vf_scale.c | 28 +--------------------------- video/filter/vf_vo.c | 3 +-- video/out/vo.h | 1 - video/out/vo_corevideo.m | 3 +-- video/out/vo_direct3d.c | 3 +-- video/out/vo_image.c | 3 +-- video/out/vo_opengl.c | 3 +-- video/out/vo_opengl_old.c | 2 +- video/out/vo_vdpau.c | 3 +-- video/out/vo_x11.c | 8 ++++---- video/out/vo_xv.c | 2 +- video/vfcap.h | 4 ---- 16 files changed, 13 insertions(+), 56 deletions(-) diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst index 5796c7f6d7..c3e970a1e5 100644 --- a/DOCS/man/en/options.rst +++ b/DOCS/man/en/options.rst @@ -2174,6 +2174,3 @@ --y= Scale image to height (if software/hardware scaling is available). Disables aspect calculations. - ---zoom - Useful for ``--vo=x11`` only. Enables scaling. diff --git a/core/cfg-mplayer.h b/core/cfg-mplayer.h index 1a666c6666..8346e31c92 100644 --- a/core/cfg-mplayer.h +++ b/core/cfg-mplayer.h @@ -480,7 +480,6 @@ const m_option_t common_opts[] = { // scaling: {"sws", &sws_flags, CONF_TYPE_INT, 0, 0, 2, NULL}, {"ssf", (void *) scaler_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, - OPT_MAKE_FLAGS("zoom", softzoom, 0), OPT_FLOATRANGE("aspect", movie_aspect, 0, 0.1, 10.0), OPT_FLAG_CONSTANTS("no-aspect", movie_aspect, 0, 0, 0), OPT_FLOATRANGE("xy", screen_size_xy, 0, 0.001, 4096), diff --git a/core/options.h b/core/options.h index ade419d74e..31d2726c19 100644 --- a/core/options.h +++ b/core/options.h @@ -95,7 +95,6 @@ typedef struct MPOpts { float playback_speed; float drc_level; struct m_obj_settings *vf_settings; - int softzoom; float movie_aspect; float screen_size_xy; int flip; diff --git a/video/decode/vd.c b/video/decode/vd.c index 31b40e46da..6112c48d33 100644 --- a/video/decode/vd.c +++ b/video/decode/vd.c @@ -216,7 +216,6 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, vocfg_flags = (opts->fullscreen ? VOFLAG_FULLSCREEN : 0) | (opts->vidmode ? VOFLAG_MODESWITCHING : 0) - | (opts->softzoom ? VOFLAG_SWSCALE : 0) | (opts->flip ? VOFLAG_FLIPPING : 0); // Time to config libvo! diff --git a/video/filter/vf_scale.c b/video/filter/vf_scale.c index f5a348559f..2ff9d82e8b 100644 --- a/video/filter/vf_scale.c +++ b/video/filter/vf_scale.c @@ -35,7 +35,6 @@ #include "video/sws_utils.h" #include "video/csputils.h" -// VOFLAG_SWSCALE #include "video/out/vo.h" #include "core/m_option.h" @@ -191,7 +190,6 @@ static int config(struct vf_instance *vf, 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; int round_w=0, round_h=0; int i; @@ -208,33 +206,11 @@ static int config(struct vf_instance *vf, if (outfmt == IMGFMT_RGB8 || outfmt == IMGFMT_BGR8) sfmt = PIX_FMT_PAL8; dfmt = imgfmt2pixfmt(best); - vo_flags=vf->next->query_format(vf->next,best); + vf->next->query_format(vf->next,best); vf->priv->w = vf->priv->cfg_w; vf->priv->h = vf->priv->cfg_h; - // scaling to dwidth*d_height, if all these TRUE: - // - option -zoom - // - no other sw/hw up/down scaling avail. - // - we're after postproc - // - user didn't set w:h - if(!(vo_flags&VFCAP_POSTPROC) && (flags&VOFLAG_SWSCALE) && - vf->priv->w<0 && vf->priv->h<0){ // -zoom - int x=(vo_flags&VFCAP_SWSCALE) ? 0 : 1; - if(d_widthpriv->w=d_width; - vf->priv->h=d_height; - } - } - if (vf->priv->w <= -8) { vf->priv->w += 8; round_w = 1; @@ -615,8 +591,6 @@ static int query_format(struct vf_instance *vf, unsigned int fmt){ flags=vf_next_query_format(vf,best); if(!(flags&(VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW))) return 0; // huh? if(fmt!=best) flags&=~VFCAP_CSP_SUPPORTED_BY_HW; - // do not allow scaling, if we are before the PP fliter! - if(!(flags&VFCAP_POSTPROC)) flags|=VFCAP_SWSCALE; return flags; } return 0; // nomatching in-fmt diff --git a/video/filter/vf_vo.c b/video/filter/vf_vo.c index 5c4d83c01d..13b55f250d 100644 --- a/video/filter/vf_vo.c +++ b/video/filter/vf_vo.c @@ -51,14 +51,13 @@ static int config(struct vf_instance *vf, } const vo_info_t *info = video_out->driver->info; - mp_msg(MSGT_CPLAYER, MSGL_INFO, "VO: [%s] %dx%d => %dx%d %s %s%s%s%s\n", + mp_msg(MSGT_CPLAYER, MSGL_INFO, "VO: [%s] %dx%d => %dx%d %s %s%s%s\n", info->short_name, width, height, d_width, d_height, vo_format_name(outfmt), (flags & VOFLAG_FULLSCREEN) ? " [fs]" : "", (flags & VOFLAG_MODESWITCHING) ? " [vm]" : "", - (flags & VOFLAG_SWSCALE) ? " [zoom]" : "", (flags & VOFLAG_FLIPPING) ? " [flip]" : ""); mp_msg(MSGT_CPLAYER, MSGL_V, "VO: Description: %s\n", info->name); mp_msg(MSGT_CPLAYER, MSGL_V, "VO: Author: %s\n", info->author); diff --git a/video/out/vo.h b/video/out/vo.h index 71ef635050..22e4650bde 100644 --- a/video/out/vo.h +++ b/video/out/vo.h @@ -122,7 +122,6 @@ typedef struct { #define VOFLAG_FULLSCREEN 0x01 #define VOFLAG_MODESWITCHING 0x02 -#define VOFLAG_SWSCALE 0x04 #define VOFLAG_FLIPPING 0x08 #define VOFLAG_HIDDEN 0x10 //< Use to create a hidden window #define VOFLAG_STEREO 0x20 //< Use to create a stereo-capable window diff --git a/video/out/vo_corevideo.m b/video/out/vo_corevideo.m index 04ab7019d1..9dcd27355e 100644 --- a/video/out/vo_corevideo.m +++ b/video/out/vo_corevideo.m @@ -247,8 +247,7 @@ static int query_format(struct vo *vo, uint32_t format) { struct priv *p = vo->priv; const int flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | - VFCAP_OSD | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | - VOCAP_NOSLICES; + VFCAP_OSD | VOCAP_NOSLICES; switch (format) { case IMGFMT_YUY2: p->pixelFormat = kYUVSPixelFormat; diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c index 3a70a081bf..6e4e2dbae2 100644 --- a/video/out/vo_direct3d.c +++ b/video/out/vo_direct3d.c @@ -1218,8 +1218,7 @@ static int query_format(d3d_priv *priv, uint32_t movie_fmt) if (!init_rendering_mode(priv, movie_fmt, false)) return 0; - int osd_caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW - | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN; + int osd_caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW; if (!priv->opt_disable_osd) osd_caps |= VFCAP_OSD; return osd_caps; diff --git a/video/out/vo_image.c b/video/out/vo_image.c index 7b7c367ad4..76adf5a665 100644 --- a/video/out/vo_image.c +++ b/video/out/vo_image.c @@ -130,8 +130,7 @@ static int query_format(struct vo *vo, uint32_t fmt) // always wants RGB (at least for now), but it probably doesn't matter // whether we or screenshot.c do the conversion. if (av_format != PIX_FMT_NONE && sws_isSupportedInput(av_format)) - return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | - VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN; + return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW; return 0; } diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index 0662c7474b..92f8499d5c 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -1673,8 +1673,7 @@ static bool init_format(int fmt, struct gl_priv *init) static int query_format(uint32_t format) { int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIP | - VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_ACCEPT_STRIDE | - VFCAP_OSD; + VFCAP_ACCEPT_STRIDE | VFCAP_OSD; if (!init_format(format, NULL)) return 0; return caps; diff --git a/video/out/vo_opengl_old.c b/video/out/vo_opengl_old.c index e1695de583..a21db3a328 100644 --- a/video/out/vo_opengl_old.c +++ b/video/out/vo_opengl_old.c @@ -832,7 +832,7 @@ static int query_format(struct vo *vo, uint32_t format) int depth; int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIP | - VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_ACCEPT_STRIDE; + VFCAP_ACCEPT_STRIDE; if (p->use_osd) caps |= VFCAP_OSD; if (format == IMGFMT_RGB24 || format == IMGFMT_RGBA) diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index f94531379a..c167021831 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -1429,8 +1429,7 @@ static uint32_t get_image(struct vo *vo, mp_image_t *mpi) static int query_format(uint32_t format) { int default_flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW - | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_OSD - | VFCAP_FLIP; + | VFCAP_OSD | VFCAP_FLIP; switch (format) { case IMGFMT_YV12: case IMGFMT_I420: diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c index f819a71a30..97a44337e8 100644 --- a/video/out/vo_x11.c +++ b/video/out/vo_x11.c @@ -269,7 +269,7 @@ static int config(struct vo *vo, uint32_t width, uint32_t height, int vm = flags & VOFLAG_MODESWITCHING; #endif p->Flip_Flag = flags & VOFLAG_FLIPPING; - p->zoomFlag = flags & VOFLAG_SWSCALE; + p->zoomFlag = 1; p->old_vo_dwidth = -1; p->old_vo_dheight = -1; @@ -507,10 +507,10 @@ static int query_format(struct vo *vo, uint32_t format) return 0; // TODO 8bpp not yet fully implemented if (IMGFMT_BGR_DEPTH(format) == vo->x11->depthonscreen) return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | - VFCAP_OSD | VFCAP_SWSCALE | VFCAP_FLIP | + VFCAP_OSD | VFCAP_FLIP | VFCAP_ACCEPT_STRIDE; else - return VFCAP_CSP_SUPPORTED | VFCAP_OSD | VFCAP_SWSCALE | + return VFCAP_CSP_SUPPORTED | VFCAP_OSD | VFCAP_FLIP | VFCAP_ACCEPT_STRIDE; } @@ -519,7 +519,7 @@ static int query_format(struct vo *vo, uint32_t format) case IMGFMT_I420: case IMGFMT_IYUV: case IMGFMT_YV12: - return VFCAP_CSP_SUPPORTED | VFCAP_OSD | VFCAP_SWSCALE | + return VFCAP_CSP_SUPPORTED | VFCAP_OSD | VFCAP_ACCEPT_STRIDE; } return 0; diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c index 4019583914..d171559f53 100644 --- a/video/out/vo_xv.c +++ b/video/out/vo_xv.c @@ -479,7 +479,7 @@ static uint32_t draw_image(struct vo *vo, mp_image_t *mpi) static int query_format(struct xvctx *ctx, uint32_t format) { uint32_t i; - int flag = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_OSD | VFCAP_ACCEPT_STRIDE; // FIXME! check for DOWN + int flag = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_OSD | VFCAP_ACCEPT_STRIDE; // FIXME! check for DOWN /* check image formats */ for (i = 0; i < ctx->formats; i++) { diff --git a/video/vfcap.h b/video/vfcap.h index acc7ce31c6..9ebc8fe7c0 100644 --- a/video/vfcap.h +++ b/video/vfcap.h @@ -26,10 +26,6 @@ #define VFCAP_CSP_SUPPORTED_BY_HW 0x2 // set if the driver/filter can draw OSD #define VFCAP_OSD 0x4 -// scaling up/down by hardware, or software: -#define VFCAP_HWSCALE_UP 0x10 -#define VFCAP_HWSCALE_DOWN 0x20 -#define VFCAP_SWSCALE 0x40 // driver/filter can do vertical flip (upside-down) #define VFCAP_FLIP 0x80 -- cgit v1.2.3