summaryrefslogtreecommitdiffstats
path: root/video/out/vo.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-04-22 19:36:16 +0200
committerJan Ekström <jeebjp@gmail.com>2018-04-29 02:21:32 +0300
commit8135e25600ace2894df274e6a825cfef525fee77 (patch)
tree372c2642c06ff8dc4ca90517c97495b102d9e700 /video/out/vo.c
parentbfc33da250e4fdb6bb57bdf051ad666570ae985f (diff)
downloadmpv-8135e25600ace2894df274e6a825cfef525fee77.tar.bz2
mpv-8135e25600ace2894df274e6a825cfef525fee77.tar.xz
vo: add vo_reconfig2()
1. I want to get away from mp_image_params (maybe). 2. For encoding mode, it's convenient to get the nominal_fps, which is a mp_image field, and not in mp_image_params.
Diffstat (limited to 'video/out/vo.c')
-rw-r--r--video/out/vo.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 413d8bc02c..624136bd47 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -571,9 +571,11 @@ static void run_reconfig(void *p)
{
void **pp = p;
struct vo *vo = pp[0];
- struct mp_image_params *params = pp[1];
+ struct mp_image *img = pp[1];
int *ret = pp[2];
+ struct mp_image_params *params = &img->params;
+
struct vo_internal *in = vo->in;
MP_VERBOSE(vo, "reconfig to %s\n", mp_image_params_to_str(params));
@@ -585,7 +587,11 @@ static void run_reconfig(void *p)
talloc_free(vo->params);
vo->params = talloc_dup(vo, params);
- *ret = vo->driver->reconfig(vo, vo->params);
+ if (vo->driver->reconfig2) {
+ *ret = vo->driver->reconfig2(vo, img);
+ } else {
+ *ret = vo->driver->reconfig(vo, vo->params);
+ }
vo->config_ok = *ret >= 0;
if (vo->config_ok) {
check_vo_caps(vo);
@@ -607,7 +613,17 @@ static void run_reconfig(void *p)
int vo_reconfig(struct vo *vo, struct mp_image_params *params)
{
int ret;
- void *p[] = {vo, params, &ret};
+ struct mp_image dummy = {0};
+ mp_image_set_params(&dummy, params);
+ void *p[] = {vo, &dummy, &ret};
+ mp_dispatch_run(vo->in->dispatch, run_reconfig, p);
+ return ret;
+}
+
+int vo_reconfig2(struct vo *vo, struct mp_image *img)
+{
+ int ret;
+ void *p[] = {vo, img, &ret};
mp_dispatch_run(vo->in->dispatch, run_reconfig, p);
return ret;
}