diff options
author | wm4 <wm4@nowhere> | 2014-01-24 21:22:25 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-01-24 21:22:25 +0100 |
commit | 2e66f4b89b525f15a709df95ac86cccbcab6bd49 (patch) | |
tree | 8c08885e202b4fa25f4de1652c8813014290617d /video/out/vo_direct3d.c | |
parent | 7a6227a18476aee655df5dc76d27c281cc3590c2 (diff) | |
download | mpv-2e66f4b89b525f15a709df95ac86cccbcab6bd49.tar.bz2 mpv-2e66f4b89b525f15a709df95ac86cccbcab6bd49.tar.xz |
video/out: do remaining config to reconfig replacements
The main difference between the old and new callbacks is that the old
callbacks required passing the window size, which is and always was very
inconvenient and confusing, since the window size is already in
vo->dwidth and vo->dheight.
Diffstat (limited to 'video/out/vo_direct3d.c')
-rw-r--r-- | video/out/vo_direct3d.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c index eae04eecb8..0dde474f62 100644 --- a/video/out/vo_direct3d.c +++ b/video/out/vo_direct3d.c @@ -1260,19 +1260,7 @@ static int control(struct vo *vo, uint32_t request, void *data) return r; } -/** @brief libvo Callback: Configre the Direct3D adapter. - * @param width Movie source width - * @param height Movie source height - * @param d_width Screen (destination) width - * @param d_height Screen (destination) height - * @param options Options bitmap - * @param format Movie colorspace format (using MPlayer's - * defines, e.g. IMGFMT_YUYV) - * @return 0 on success, VO_ERROR on failure - */ -static int config(struct vo *vo, uint32_t width, uint32_t height, - uint32_t d_width, uint32_t d_height, uint32_t options, - uint32_t format) +static int reconfig(struct vo *vo, struct mp_image_params *params, int flags) { d3d_priv *priv = vo->priv; @@ -1281,20 +1269,20 @@ static int config(struct vo *vo, uint32_t width, uint32_t height, /* w32_common framework call. Creates window on the screen with * the given coordinates. */ - if (!vo_w32_config(vo, d_width, d_height, options)) { + if (!vo_w32_config(vo, vo->dwidth, vo->dheight, flags)) { MP_VERBOSE(priv, "Creating window failed.\n"); return VO_ERROR; } - if ((priv->image_format != format) - || (priv->src_width != width) - || (priv->src_height != height)) + if ((priv->image_format != params->imgfmt) + || (priv->src_width != params->w) + || (priv->src_height != params->h)) { d3d_destroy_video_objects(priv); - priv->src_width = width; - priv->src_height = height; - init_rendering_mode(priv, format, true); + priv->src_width = params->w; + priv->src_height = params->h; + init_rendering_mode(priv, params->imgfmt, true); } if (!resize_d3d(priv)) @@ -1737,7 +1725,7 @@ const struct vo_driver video_out_direct3d = { .name = "direct3d", .preinit = preinit, .query_format = query_format, - .config = config, + .reconfig = reconfig, .control = control, .draw_image = draw_image, .draw_osd = draw_osd, @@ -1753,7 +1741,7 @@ const struct vo_driver video_out_direct3d_shaders = { .name = "direct3d_shaders", .preinit = preinit, .query_format = query_format, - .config = config, + .reconfig = reconfig, .control = control, .draw_image = draw_image, .draw_osd = draw_osd, |