summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-02 21:28:59 +0200
committerwm4 <wm4@nowhere>2012-08-02 22:07:38 +0200
commite48b21dd87468245268c470b250c3cdd5a1bbfae (patch)
tree43d11465e021a9573bf581ecf2d00c2819f8cabf
parent6c05d49730b8fe3b0eff6639b067c4978706bf59 (diff)
downloadmpv-e48b21dd87468245268c470b250c3cdd5a1bbfae.tar.bz2
mpv-e48b21dd87468245268c470b250c3cdd5a1bbfae.tar.xz
VO: remove VO direct rendering
This was disabled by default, and could be enabled with -dr. It was disabled by default because it was buggy: there were issues with OSD corruption. It wasn't entirely sane for OpenGL based VOs either. OpenGL can chose to drop mapped pixel buffer objects, requiring the application to map and fill the buffer again. But there was no mechanism in mplayer to fill the lost buffer again. (It seems this rarely happened in practice, though.) On the other side, users liked the --dr flag, because it promised them more speed. I'm not sure if it actually helped with speed, but it's unlikely it had any real advantages on modern systems. In order to evade the --dr cargo culting in mplayer config files, it's best to get rid of it.
-rw-r--r--DOCS/man/en/options.rst5
-rw-r--r--DOCS/man/en/vo.rst4
-rw-r--r--cfg-mplayer.h3
-rw-r--r--libmpcodecs/vf_vo.c2
-rw-r--r--libvo/video_out.c1
-rw-r--r--libvo/video_out.h1
-rw-r--r--libvo/vo_direct3d.c4
-rw-r--r--libvo/vo_directfb2.c71
-rw-r--r--libvo/vo_directx.c43
-rw-r--r--libvo/vo_gl.c2
-rw-r--r--libvo/vo_gl3.c2
-rw-r--r--libvo/vo_x11.c28
12 files changed, 3 insertions, 163 deletions
diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst
index 2f507f98f2..1fd96565a4 100644
--- a/DOCS/man/en/options.rst
+++ b/DOCS/man/en/options.rst
@@ -514,11 +514,6 @@
double-click (default: 300). Set to 0 to let your windowing system decide
what a double-click is (``--vo=directx`` only).
---dr
- Turns on direct rendering (not supported by all codecs and video outputs)
-
- *WARNING*: May cause OSD/SUB corruption!
-
--dumpfile=<filename>
Specify which file MPlayer should dump to. Should be used together with
``--dumpaudio`` / ``--dumpvideo`` / ``--dumpstream`` / ``--capture``.
diff --git a/DOCS/man/en/vo.rst b/DOCS/man/en/vo.rst
index 01224bae65..6fbc5aefb6 100644
--- a/DOCS/man/en/vo.rst
+++ b/DOCS/man/en/vo.rst
@@ -172,7 +172,7 @@ gl
than the maximum texture size of your OpenGL implementation. Intended to
work even with the most basic OpenGL implementations, but also makes use
of newer extensions, which allow support for more colorspaces and direct
- rendering. For optimal speed try adding the options ``--dr=-noslices``
+ rendering.
The code performs very few checks, so if a feature does not work, this
might be because it is not supported by your card/OpenGL implementation
@@ -181,7 +181,7 @@ gl
(no-)ati-hack
ATI drivers may give a corrupted image when PBOs are used (when using
- ``--dr`` or `force-pbo`). This option fixes this, at the expense of
+ `force-pbo`). This option fixes this, at the expense of
using a bit more memory.
(no-)force-pbo
Always uses PBOs to transfer textures even if this involves an extra
diff --git a/cfg-mplayer.h b/cfg-mplayer.h
index 6a341e01c1..fd90d19b3f 100644
--- a/cfg-mplayer.h
+++ b/cfg-mplayer.h
@@ -733,9 +733,6 @@ const m_option_t mplayer_opts[]={
OPT_INTRANGE("gamma", vo_gamma_gamma, 0, -100, 100),
{"keepaspect", &vo_keepaspect, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- // direct rendering (decoding to video out buffer)
- {"dr", &vo_directrendering, CONF_TYPE_FLAG, 0, 0, 1, NULL},
-
//---------------------- mplayer-only options ------------------------
{"use-filedir-conf", &use_filedir_conf, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c
index e23eca4b71..6cf7a7a3ac 100644
--- a/libmpcodecs/vf_vo.c
+++ b/libmpcodecs/vf_vo.c
@@ -199,7 +199,7 @@ static void get_image(struct vf_instance *vf,
if (!video_out->config_ok)
return;
// GET_IMAGE is required for hardware-accelerated formats
- if (vo_directrendering || IMGFMT_IS_HWACCEL(mpi->imgfmt))
+ if (IMGFMT_IS_HWACCEL(mpi->imgfmt))
vo_control(video_out, VOCTRL_GET_IMAGE, mpi);
}
diff --git a/libvo/video_out.c b/libvo/video_out.c
index 1063876640..d2c2f439df 100644
--- a/libvo/video_out.c
+++ b/libvo/video_out.c
@@ -66,7 +66,6 @@ int vo_pts=0; // for hw decoding
float vo_fps=0;
char *vo_subdevice = NULL;
-int vo_directrendering=0;
int vo_colorkey = 0x0000ff00; // default colorkey is green
// (0xff000000 means that colorkey has been disabled)
diff --git a/libvo/video_out.h b/libvo/video_out.h
index 3fcb420d2a..62bbf89975 100644
--- a/libvo/video_out.h
+++ b/libvo/video_out.h
@@ -330,7 +330,6 @@ extern int xinerama_y;
extern int vo_grabpointer;
extern int vo_doublebuffering;
-extern int vo_directrendering;
extern int vo_vsync;
extern int vo_fs;
extern int vo_fsmode;
diff --git a/libvo/vo_direct3d.c b/libvo/vo_direct3d.c
index 9a4f6e1e04..3ae7ea3197 100644
--- a/libvo/vo_direct3d.c
+++ b/libvo/vo_direct3d.c
@@ -1493,10 +1493,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
switch (request) {
case VOCTRL_QUERY_FORMAT:
return query_format(priv, *(uint32_t*) data);
- case VOCTRL_GET_IMAGE:
- mp_msg(MSGT_VO, MSGL_V,
- "<vo_direct3d>Direct Rendering request. Not implemented yet.\n");
- return VO_NOTIMPL;
case VOCTRL_DRAW_IMAGE:
return d3d_upload_and_render_frame(priv, data);
case VOCTRL_FULLSCREEN:
diff --git a/libvo/vo_directfb2.c b/libvo/vo_directfb2.c
index b50adba614..b5db7a3ff7 100644
--- a/libvo/vo_directfb2.c
+++ b/libvo/vo_directfb2.c
@@ -1091,75 +1091,6 @@ if (layer) {
return VO_FALSE;
}
-static uint32_t get_image(mp_image_t *mpi)
-{
-
- int err;
- uint8_t *dst;
- int pitch;
-
-// if ( mp_msg_test(MSGT_VO,MSGL_V) ) printf("DirectFB: get_image() called\n");
- if(mpi->flags&MP_IMGFLAG_READABLE) return VO_FALSE; // slow video ram
- if(mpi->type==MP_IMGTYPE_STATIC) return VO_FALSE; // it is not static
-
-// printf("width=%d vs. pitch=%d, flags=0x%X \n",mpi->width,pitch,mpi->flags);
-
- if(mpi->flags&(MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_ACCEPT_WIDTH)){
- // we're lucky or codec accepts stride => ok, let's go!
-
- if (frame) {
- err = frame->Lock(frame,DSLF_WRITE|DSLF_READ,(void *)&dst,&pitch);
- framelocked=1;
- } else {
- err = primary->Lock(primary,DSLF_WRITE,(void *)&dst,&pitch);
- primarylocked=1;
- }
-
- if (err) {
- mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: DR lock failed!");
- return VO_FALSE;
- };
-
- if(mpi->flags&MP_IMGFLAG_PLANAR){
- //YV12 format
- mpi->planes[0]=dst;
- if(mpi->flags&MP_IMGFLAG_SWAPPED){
- mpi->planes[1]=dst + pitch*height;
- mpi->planes[2]=mpi->planes[1] + pitch*height/4;
- } else {
- mpi->planes[2]=dst + pitch*height;
- mpi->planes[1]=mpi->planes[2] + pitch*height/4;
- }
- mpi->width=width;
- mpi->stride[0]=pitch;
- mpi->stride[1]=mpi->stride[2]=pitch/2;
- } else {
- //YUY2 and RGB formats
- mpi->planes[0]=dst;
- mpi->width=width;
- mpi->stride[0]=pitch;
- }
-
- // center image
-
- if (!frame) {
- if(mpi->flags&MP_IMGFLAG_PLANAR){
- mpi->planes[0]= dst + yoffset * pitch + xoffset;
- mpi->planes[1]+= ((yoffset * pitch) >> 2) + (xoffset >> 1);
- mpi->planes[2]+= ((yoffset * pitch) >> 2) + (xoffset >> 1);
- } else {
- mpi->planes[0]=dst + yoffset * pitch + xoffset * (mpi->bpp >> 3);
- }
- }
-
- mpi->flags|=MP_IMGFLAG_DIRECT;
-// if ( mp_msg_test(MSGT_VO,MSGL_V) ) printf("DirectFB: get_image() SUCCESS -> Direct Rendering ENABLED\n");
- return VO_TRUE;
-
- }
- return VO_FALSE;
-}
-
static int draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y)
{
int i;
@@ -1375,8 +1306,6 @@ static int control(uint32_t request, void *data)
switch (request) {
case VOCTRL_QUERY_FORMAT:
return query_format(*((uint32_t*)data));
- case VOCTRL_GET_IMAGE:
- return get_image(data);
case VOCTRL_DRAW_IMAGE:
return put_image(data);
case VOCTRL_SET_EQUALIZER:
diff --git a/libvo/vo_directx.c b/libvo/vo_directx.c
index 345ee6e8d4..398aa4890b 100644
--- a/libvo/vo_directx.c
+++ b/libvo/vo_directx.c
@@ -862,10 +862,6 @@ static void flip_page(void)
g_lpddsPrimary->lpVtbl->Blt(g_lpddsPrimary, &rd, g_lpddsBack, NULL, DDBLT_WAIT, &ddbltfx);
}
if (g_lpddsBack->lpVtbl->Lock(g_lpddsBack, NULL, &ddsdsf, DDLOCK_NOSYSLOCK | DDLOCK_WAIT, NULL) == DD_OK) {
- if (vo_directrendering && (dstride != ddsdsf.lPitch)) {
- mp_msg(MSGT_VO, MSGL_WARN, "<vo_directx><WARN>stride changed !!!! disabling direct rendering\n");
- vo_directrendering = 0;
- }
free(tmp_image);
tmp_image = NULL;
dstride = ddsdsf.lPitch;
@@ -882,43 +878,6 @@ static int draw_frame(uint8_t *src[])
return 0;
}
-static uint32_t get_image(mp_image_t *mpi)
-{
- if (mpi->flags & MP_IMGFLAG_READABLE) {
- mp_msg(MSGT_VO, MSGL_V, "<vo_directx><ERROR>slow video ram\n");
- return VO_FALSE;
- }
- if (mpi->type == MP_IMGTYPE_STATIC) {
- mp_msg(MSGT_VO, MSGL_V, "<vo_directx><ERROR>not static\n");
- return VO_FALSE;
- }
- if (mpi->width == dstride || (mpi->flags & (MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_ACCEPT_WIDTH))) {
- if (mpi->flags & MP_IMGFLAG_PLANAR) {
- if (image_format == IMGFMT_YV12) {
- mpi->planes[2] = image + dstride * image_height;
- mpi->planes[1] = image + dstride * image_height + dstride * image_height / 4;
- mpi->stride[1] = mpi->stride[2] = dstride / 2;
- } else if (image_format == IMGFMT_IYUV || image_format == IMGFMT_I420) {
- mpi->planes[1] = image + dstride * image_height;
- mpi->planes[2] = image + dstride * image_height + dstride * image_height / 4;
- mpi->stride[1] = mpi->stride[2] = dstride / 2;
- } else if (image_format == IMGFMT_YVU9) {
- mpi->planes[2] = image + dstride * image_height;
- mpi->planes[1] = image + dstride * image_height + dstride * image_height / 16;
- mpi->stride[1] = mpi->stride[2] = dstride / 4;
- }
- }
- mpi->planes[0] = image;
- mpi->stride[0] = dstride;
- mpi->width = image_width;
- mpi->height = image_height;
- mpi->flags |= MP_IMGFLAG_DIRECT;
- mp_msg(MSGT_VO, MSGL_DBG3, "<vo_directx><INFO>Direct Rendering ENABLED\n");
- return VO_TRUE;
- }
- return VO_FALSE;
-}
-
static uint32_t put_image(mp_image_t *mpi)
{
uint8_t *d;
@@ -1130,8 +1089,6 @@ static uint32_t color_ctrl_get(const char *what, int *value)
static int control(uint32_t request, void *data)
{
switch (request) {
- case VOCTRL_GET_IMAGE:
- return get_image(data);
case VOCTRL_QUERY_FORMAT:
return query_format(*(uint32_t *)data);
case VOCTRL_DRAW_IMAGE:
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index d9c0a2dda5..bfafebe15f 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -1383,8 +1383,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
switch (request) {
case VOCTRL_QUERY_FORMAT:
return query_format(vo, *(uint32_t *)data);
- case VOCTRL_GET_IMAGE:
- return get_image(vo, data);
case VOCTRL_DRAW_IMAGE:
return draw_image(vo, data);
case VOCTRL_DRAW_EOSD:
diff --git a/libvo/vo_gl3.c b/libvo/vo_gl3.c
index c3b09db695..496e22bfcb 100644
--- a/libvo/vo_gl3.c
+++ b/libvo/vo_gl3.c
@@ -1834,8 +1834,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
switch (request) {
case VOCTRL_QUERY_FORMAT:
return query_format(*(uint32_t *)data);
- case VOCTRL_GET_IMAGE:
- return get_image(vo, data);
case VOCTRL_DRAW_IMAGE:
return draw_image(p, data);
case VOCTRL_DRAW_EOSD:
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index 946421e004..29975b3a4a 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -549,32 +549,6 @@ static int draw_frame(uint8_t * src[])
return VO_ERROR;
}
-static uint32_t get_image(mp_image_t * mpi)
-{
- if (zoomFlag ||
- !IMGFMT_IS_BGR(mpi->imgfmt) ||
- (IMGFMT_BGR_DEPTH(mpi->imgfmt) != vo_depthonscreen) ||
- ((mpi->type != MP_IMGTYPE_STATIC)
- && (mpi->type != MP_IMGTYPE_TEMP))
- || (mpi->flags & MP_IMGFLAG_PLANAR)
- || (mpi->flags & MP_IMGFLAG_YUV) || (mpi->width != image_width)
- || (mpi->height != image_height))
- return VO_FALSE;
-
- if (Flip_Flag)
- {
- mpi->stride[0] = -image_width * ((bpp + 7) / 8);
- mpi->planes[0] = ImageData - mpi->stride[0] * (image_height - 1);
- } else
- {
- mpi->stride[0] = image_width * ((bpp + 7) / 8);
- mpi->planes[0] = ImageData;
- }
- mpi->flags |= MP_IMGFLAG_DIRECT;
-
- return VO_TRUE;
-}
-
static int query_format(uint32_t format)
{
mp_msg(MSGT_VO, MSGL_DBG2,
@@ -650,8 +624,6 @@ static int control(uint32_t request, void *data)
return int_pause = 0;
case VOCTRL_QUERY_FORMAT:
return query_format(*((uint32_t *) data));
- case VOCTRL_GET_IMAGE:
- return get_image(data);
case VOCTRL_FULLSCREEN:
vo_x11_fullscreen();
vo_x11_clearwindow(mDisplay, vo_window);