summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo.c14
-rw-r--r--video/out/vo.h2
-rw-r--r--video/out/vo_corevideo.m3
-rw-r--r--video/out/vo_direct3d.c13
-rw-r--r--video/out/vo_image.c2
-rw-r--r--video/out/vo_lavc.c4
-rw-r--r--video/out/vo_null.c5
-rw-r--r--video/out/vo_opengl.c3
-rw-r--r--video/out/vo_opengl_old.c18
-rw-r--r--video/out/vo_sdl.c2
-rw-r--r--video/out/vo_vdpau.c2
-rw-r--r--video/out/vo_x11.c6
-rw-r--r--video/out/vo_xv.c2
13 files changed, 27 insertions, 49 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 76c71518e6..6fff185c6c 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -176,12 +176,20 @@ int vo_redraw_frame(struct vo *vo)
if (!vo->config_ok || !vo->hasframe)
return -1;
if (vo_control(vo, VOCTRL_REDRAW_FRAME, NULL) == true) {
+ vo->want_redraw = false;
vo->redrawing = true;
return 0;
}
return -1;
}
+bool vo_get_want_redraw(struct vo *vo)
+{
+ if (!vo->config_ok || !vo->hasframe)
+ return false;
+ return vo->want_redraw;
+}
+
int vo_get_buffered_frame(struct vo *vo, bool eof)
{
if (!vo->config_ok)
@@ -216,7 +224,7 @@ void vo_new_frame_imminent(struct vo *vo)
void vo_draw_osd(struct vo *vo, struct osd_state *osd)
{
- if (vo->config_ok && (vo->default_caps & VFCAP_OSD))
+ if (vo->config_ok && vo->driver->draw_osd)
vo->driver->draw_osd(vo, osd);
}
@@ -428,14 +436,10 @@ int vo_config(struct vo *vo, uint32_t width, uint32_t height,
d_height = vo->dheight;
}
- vo->default_caps = vo->driver->query_format(vo, format);
-
int ret = vo->driver->config(vo, width, height, d_width, d_height, flags,
format);
vo->config_ok = (ret == 0);
vo->config_count += vo->config_ok;
- if (!vo->config_ok)
- vo->default_caps = 0;
if (vo->registered_fd == -1 && vo->event_fd != -1 && vo->config_ok) {
mp_input_add_key_fd(vo->input_ctx, vo->event_fd, 1, event_fd_callback,
NULL, vo);
diff --git a/video/out/vo.h b/video/out/vo.h
index 81cd61b9cc..ea0189dcee 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -227,7 +227,6 @@ struct vo_driver {
struct vo {
int config_ok; // Last config call was successful?
int config_count; // Total number of successful config calls
- int default_caps; // query_format() result for configured video format
bool untimed; // non-interactive, don't do sleep calls in playloop
@@ -291,6 +290,7 @@ void list_video_out(void);
int vo_control(struct vo *vo, uint32_t request, void *data);
int vo_draw_image(struct vo *vo, struct mp_image *mpi);
int vo_redraw_frame(struct vo *vo);
+bool vo_get_want_redraw(struct vo *vo);
int vo_get_buffered_frame(struct vo *vo, bool eof);
void vo_skip_frame(struct vo *vo);
void vo_new_frame_imminent(struct vo *vo);
diff --git a/video/out/vo_corevideo.m b/video/out/vo_corevideo.m
index ab3bf4ac99..a1b5036dbf 100644
--- a/video/out/vo_corevideo.m
+++ b/video/out/vo_corevideo.m
@@ -245,8 +245,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
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;
+ const int flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
switch (format) {
case IMGFMT_YUYV:
p->pixelFormat = kYUVSPixelFormat;
diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c
index 3886d67df0..8cb649be74 100644
--- a/video/out/vo_direct3d.c
+++ b/video/out/vo_direct3d.c
@@ -119,7 +119,6 @@ typedef struct d3d_priv {
int opt_disable_stretchrect;
int opt_disable_shaders;
int opt_only_8bit;
- int opt_disable_osd;
int opt_disable_texture_align;
// debugging
int opt_force_power_of_2;
@@ -1124,10 +1123,7 @@ static int query_format(struct vo *vo, 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;
- if (!priv->opt_disable_osd)
- osd_caps |= VFCAP_OSD;
- return osd_caps;
+ return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
}
/****************************************************************************
@@ -1160,7 +1156,7 @@ static void update_colorspace(d3d_priv *priv)
}
const char *options_help_text = "-vo direct3d command line help:\n"
-"Example: -vo direct3d:disable-osd:disable-textures\n"
+"Example: -vo direct3d:disable-textures\n"
"Options:\n"
" prefer-stretchrect\n"
" Use IDirect3DDevice9::StretchRect over other methods if possible.\n"
@@ -1175,10 +1171,6 @@ const char *options_help_text = "-vo direct3d command line help:\n"
" only-8bit\n"
" Never render YUV video with more than 8 bits per component.\n"
" (Using this flag will force software conversion to 8 bit.)\n"
-" disable-osd\n"
-" Disable OSD rendering.\n"
-" (Using this flag might force the insertion of the 'ass' video filter,\n"
-" which will render the subtitles in software.)\n"
" disable-texture-align\n"
" Normally texture sizes are always aligned to 16. With this option\n"
" enabled, the video texture will always have exactly the same size as\n"
@@ -1240,7 +1232,6 @@ static int preinit_internal(struct vo *vo, const char *arg, bool allow_shaders)
{"disable-stretchrect", OPT_ARG_BOOL, &priv->opt_disable_stretchrect},
{"disable-shaders", OPT_ARG_BOOL, &priv->opt_disable_shaders},
{"only-8bit", OPT_ARG_BOOL, &priv->opt_only_8bit},
- {"disable-osd", OPT_ARG_BOOL, &priv->opt_disable_osd},
{"force-power-of-2", OPT_ARG_BOOL, &priv->opt_force_power_of_2},
{"disable-texture-align", OPT_ARG_BOOL, &priv->opt_disable_texture_align},
{"texture-memory", OPT_ARG_INT, &priv->opt_texture_memory},
diff --git a/video/out/vo_image.c b/video/out/vo_image.c
index 95caf2611f..d39df5851c 100644
--- a/video/out/vo_image.c
+++ b/video/out/vo_image.c
@@ -145,7 +145,7 @@ static void flip_page(struct vo *vo)
static int query_format(struct vo *vo, uint32_t fmt)
{
if (mp_sws_supported_format(fmt))
- return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_OSD;
+ return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
return 0;
}
diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c
index 2a07a67b0b..f9534b02e7 100644
--- a/video/out/vo_lavc.c
+++ b/video/out/vo_lavc.c
@@ -187,10 +187,8 @@ static int query_format(struct vo *vo, uint32_t format)
return
VFCAP_CSP_SUPPORTED |
// we can do it
- VFCAP_CSP_SUPPORTED_BY_HW |
+ VFCAP_CSP_SUPPORTED_BY_HW;
// we don't convert colorspaces here
- VFCAP_OSD;
- // we have OSD
}
static void write_packet(struct vo *vo, int size, AVPacket *packet)
diff --git a/video/out/vo_null.c b/video/out/vo_null.c
index c1e931f806..993fcb606c 100644
--- a/video/out/vo_null.c
+++ b/video/out/vo_null.c
@@ -34,10 +34,6 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
{
}
-static void draw_osd(struct vo *vo, struct osd_state *osd)
-{
-}
-
static void flip_page(struct vo *vo)
{
}
@@ -90,7 +86,6 @@ const struct vo_driver video_out_null = {
.config = config,
.control = control,
.draw_image = draw_image,
- .draw_osd = draw_osd,
.flip_page = flip_page,
.check_events = check_events,
.uninit = uninit,
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 4a34d0f03a..aa3c3cea0a 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -1617,8 +1617,7 @@ static bool init_format(int fmt, struct gl_priv *init)
static int query_format(struct vo *vo, uint32_t format)
{
- int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIP |
- VFCAP_OSD;
+ int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIP;
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 80175c516b..0f286dc72a 100644
--- a/video/out/vo_opengl_old.c
+++ b/video/out/vo_opengl_old.c
@@ -55,7 +55,6 @@ struct gl_priv {
int allow_sw;
- int use_osd;
int scaled_osd;
struct mpgl_osd *osd;
int osd_color;
@@ -1468,9 +1467,8 @@ static void draw_osd(struct vo *vo, struct osd_state *osd)
{
struct gl_priv *p = vo->priv;
GL *gl = p->gl;
- assert(p->osd);
- if (!p->use_osd)
+ if (!p->osd)
return;
if (!p->scaled_osd) {
@@ -1572,8 +1570,6 @@ static void autodetectGlExtensions(struct vo *vo)
&& strstr(renderer, "Mesa DRI R200") ? 1 : 0;
}
}
- if (p->use_osd == -1)
- p->use_osd = gl->BindTexture != NULL;
if (p->use_yuv == -1)
p->use_yuv = glAutodetectYUVConversion(gl);
@@ -1711,8 +1707,10 @@ static int initGl(struct vo *vo, uint32_t d_width, uint32_t d_height)
update_yuvconv(vo);
}
- p->osd = mpgl_osd_init(gl, true);
- p->osd->scaled = p->scaled_osd;
+ if (gl->BindTexture) {
+ p->osd = mpgl_osd_init(gl, true);
+ p->osd->scaled = p->scaled_osd;
+ }
resize(vo, d_width, d_height);
@@ -2068,8 +2066,6 @@ static int query_format(struct vo *vo, uint32_t format)
int depth = desc.plane_bits;
int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIP;
- if (p->use_osd)
- caps |= VFCAP_OSD;
if (format == IMGFMT_RGB24 || format == IMGFMT_RGBA)
return caps;
if (p->use_yuv && (desc.flags & MP_IMGFLAG_YUV_P) &&
@@ -2115,7 +2111,6 @@ static int preinit(struct vo *vo, const char *arg)
*p = (struct gl_priv) {
.many_fmts = 1,
- .use_osd = -1,
.use_yuv = -1,
.colorspace = MP_CSP_DETAILS_DEFAULTS,
.filter_strength = 0.5,
@@ -2138,7 +2133,6 @@ static int preinit(struct vo *vo, const char *arg)
const opt_t subopts[] = {
{"manyfmts", OPT_ARG_BOOL, &p->many_fmts, NULL},
- {"osd", OPT_ARG_BOOL, &p->use_osd, NULL},
{"scaled-osd", OPT_ARG_BOOL, &p->scaled_osd, NULL},
{"ycbcr", OPT_ARG_BOOL, &p->use_ycbcr, NULL},
{"slice-height", OPT_ARG_INT, &p->slice_height, int_non_neg},
@@ -2178,8 +2172,6 @@ static int preinit(struct vo *vo, const char *arg)
" Disable extended color formats for OpenGL 1.2 and later\n"
" slice-height=<0-...>\n"
" Slice size for texture transfer, 0 for whole image\n"
- " noosd\n"
- " Do not use OpenGL OSD code\n"
" scaled-osd\n"
" Render OSD at movie resolution and scale it\n"
" rectangle=<0,1,2>\n"
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c
index 69ecf273c0..45486afbfd 100644
--- a/video/out/vo_sdl.c
+++ b/video/out/vo_sdl.c
@@ -804,7 +804,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 | VFCAP_OSD;
+ int cap = VFCAP_CSP_SUPPORTED | VFCAP_FLIP;
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 9890db13ea..e46e4639b6 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -1380,7 +1380,7 @@ static struct mp_image *get_decoder_surface(struct vo *vo)
static int query_format(struct vo *vo, uint32_t format)
{
int default_flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW
- | VFCAP_OSD | VFCAP_FLIP;
+ | VFCAP_FLIP;
switch (format) {
case IMGFMT_420P:
case IMGFMT_NV12:
diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c
index 0ab3c9ebcb..34c23523ef 100644
--- a/video/out/vo_x11.c
+++ b/video/out/vo_x11.c
@@ -610,9 +610,9 @@ static int query_format(struct vo *vo, uint32_t format)
if (fmt2Xfmt[n].mpfmt == format) {
if (IMGFMT_RGB_DEPTH(format) == p->ximage_depth) {
return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW |
- VFCAP_OSD | VFCAP_FLIP;
+ VFCAP_FLIP;
} else {
- return VFCAP_CSP_SUPPORTED | VFCAP_OSD | VFCAP_FLIP;
+ return VFCAP_CSP_SUPPORTED | VFCAP_FLIP;
}
}
}
@@ -620,7 +620,7 @@ static int query_format(struct vo *vo, uint32_t format)
switch (format) {
case IMGFMT_420P:
- return VFCAP_CSP_SUPPORTED | VFCAP_OSD;
+ return VFCAP_CSP_SUPPORTED;
}
return 0;
}
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
index cb22e960a1..bc0920c2eb 100644
--- a/video/out/vo_xv.c
+++ b/video/out/vo_xv.c
@@ -767,7 +767,7 @@ static int query_format(struct vo *vo, uint32_t format)
{
struct xvctx *ctx = vo->priv;
uint32_t i;
- int flag = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_OSD;
+ int flag = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
int fourcc = find_xv_format(format);
if (fourcc) {