diff options
Diffstat (limited to 'video/filter')
-rw-r--r-- | video/filter/vf.c | 6 | ||||
-rw-r--r-- | video/filter/vf_d3d11vpp.c | 24 | ||||
-rw-r--r-- | video/filter/vf_format.c | 10 | ||||
-rw-r--r-- | video/filter/vf_scale.c | 4 | ||||
-rw-r--r-- | video/filter/vf_vapoursynth.c | 6 | ||||
-rw-r--r-- | video/filter/vf_vavpp.c | 2 |
6 files changed, 27 insertions, 25 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c index 176ac95b70..274ca945a2 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -227,6 +227,8 @@ void vf_print_filter_chain(struct vf_chain *c, int msglevel, for (vf_instance_t *f = c->first; f; f = f->next) { char b[128] = {0}; mp_snprintf_cat(b, sizeof(b), " [%s] ", f->info->name); + if (f->label) + mp_snprintf_cat(b, sizeof(b), "\"%s\" ", f->label); mp_snprintf_cat(b, sizeof(b), "%s", mp_image_params_to_str(&f->fmt_out)); if (f->autoinserted) mp_snprintf_cat(b, sizeof(b), " [a]"); @@ -298,6 +300,7 @@ void vf_remove_filter(struct vf_chain *c, struct vf_instance *vf) assert(prev); // not inserted prev->next = vf->next; vf_uninit_filter(vf); + c->initialized = 0; } struct vf_instance *vf_append_filter(struct vf_chain *c, const char *name, @@ -312,6 +315,7 @@ struct vf_instance *vf_append_filter(struct vf_chain *c, const char *name, pprev = &(*pprev)->next; vf->next = *pprev ? *pprev : NULL; *pprev = vf; + c->initialized = 0; } return vf; } @@ -652,7 +656,7 @@ int vf_reconfig(struct vf_chain *c, const struct mp_image_params *params) mp_msg(c->log, loglevel, "Video filter chain:\n"); vf_print_filter_chain(c, loglevel, failing); if (r < 0) - c->input_params = c->output_params = (struct mp_image_params){0}; + c->output_params = (struct mp_image_params){0}; return r; } diff --git a/video/filter/vf_d3d11vpp.c b/video/filter/vf_d3d11vpp.c index a0aa0edae2..6faf712a67 100644 --- a/video/filter/vf_d3d11vpp.c +++ b/video/filter/vf_d3d11vpp.c @@ -211,21 +211,21 @@ static int recreate_video_proc(struct vf_instance *vf) FALSE, 0); D3D11_VIDEO_PROCESSOR_COLOR_SPACE csp = { - .YCbCr_Matrix = p->params.colorspace != MP_CSP_BT_601, - .Nominal_Range = p->params.colorlevels == MP_CSP_LEVELS_TV ? 1 : 2, + .YCbCr_Matrix = p->params.color.space != MP_CSP_BT_601, + .Nominal_Range = p->params.color.levels == MP_CSP_LEVELS_TV ? 1 : 2, }; ID3D11VideoContext_VideoProcessorSetStreamColorSpace(p->video_ctx, p->video_proc, 0, &csp); if (p->out_rgb) { - if (p->params.colorspace != MP_CSP_BT_601 && - p->params.colorspace != MP_CSP_BT_709) + if (p->params.color.space != MP_CSP_BT_601 && + p->params.color.space != MP_CSP_BT_709) { MP_WARN(vf, "Unsupported video colorspace (%s/%s). Consider " "disabling hardware decoding, or using " "--hwdec=d3d11va-copy to get correct output.\n", - m_opt_choice_str(mp_csp_names, p->params.colorspace), - m_opt_choice_str(mp_csp_levels_names, p->params.colorlevels)); + m_opt_choice_str(mp_csp_names, p->params.color.space), + m_opt_choice_str(mp_csp_levels_names, p->params.color.levels)); } } else { ID3D11VideoContext_VideoProcessorSetOutputColorSpace(p->video_ctx, @@ -331,11 +331,6 @@ static int render(struct vf_instance *vf) goto cleanup; } - // Make sure the texture is updated correctly on the shared context. - // (I'm not sure if this is correct, though it won't harm.) - if (p->out_shared) - ID3D11DeviceContext_Flush(p->device_ctx); - res = 0; cleanup: if (in_view) @@ -360,8 +355,11 @@ static int filter_out(struct vf_instance *vf) // no filtering if (!mp_refqueue_should_deint(p->queue) && !p->require_filtering) { - struct mp_image *in = mp_refqueue_get(p->queue, 0); - vf_add_output_frame(vf, mp_image_new_ref(in)); + struct mp_image *in = mp_image_new_ref(mp_refqueue_get(p->queue, 0)); + if (!in) + return -1; + mp_image_set_params(in, &p->out_params); + vf_add_output_frame(vf, in); mp_refqueue_next(p->queue); return 0; } diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c index 109fda4053..d406d98d9b 100644 --- a/video/filter/vf_format.c +++ b/video/filter/vf_format.c @@ -88,15 +88,15 @@ static int reconfig(struct vf_instance *vf, struct mp_image_params *in, if (p->outfmt) out->imgfmt = p->outfmt; if (p->colormatrix) - out->colorspace = p->colormatrix; + out->color.space = p->colormatrix; if (p->colorlevels) - out->colorlevels = p->colorlevels; + out->color.levels = p->colorlevels; if (p->primaries) - out->primaries = p->primaries; + out->color.primaries = p->primaries; if (p->gamma) - out->gamma = p->gamma; + out->color.gamma = p->gamma; if (p->peak) - out->peak = p->peak; + out->color.sig_peak = p->peak; if (p->chroma_location) out->chroma_location = p->chroma_location; if (p->stereo_in) diff --git a/video/filter/vf_scale.c b/video/filter/vf_scale.c index 518ff41beb..0b233e7098 100644 --- a/video/filter/vf_scale.c +++ b/video/filter/vf_scale.c @@ -166,8 +166,8 @@ static int reconfig(struct vf_instance *vf, struct mp_image_params *in, struct mp_imgfmt_desc d_fmt = mp_imgfmt_get_desc(out->imgfmt); // keep colorspace settings if the data stays in yuv if (!(s_fmt.flags & MP_IMGFLAG_YUV) || !(d_fmt.flags & MP_IMGFLAG_YUV)) { - out->colorspace = MP_CSP_AUTO; - out->colorlevels = MP_CSP_LEVELS_AUTO; + out->color.space = MP_CSP_AUTO; + out->color.levels = MP_CSP_LEVELS_AUTO; } mp_image_params_guess_csp(out); diff --git a/video/filter/vf_vapoursynth.c b/video/filter/vf_vapoursynth.c index 5592e032e4..625d539dc4 100644 --- a/video/filter/vf_vapoursynth.c +++ b/video/filter/vf_vapoursynth.c @@ -143,13 +143,13 @@ static void copy_mp_to_vs_frame_props_map(struct vf_priv_s *p, VSMap *map, struct mp_image_params *params = &img->params; p->vsapi->propSetInt(map, "_SARNum", params->p_w, 0); p->vsapi->propSetInt(map, "_SARDen", params->p_h, 0); - if (params->colorlevels) { + if (params->color.levels) { p->vsapi->propSetInt(map, "_ColorRange", - params->colorlevels == MP_CSP_LEVELS_TV, 0); + params->color.levels == MP_CSP_LEVELS_TV, 0); } // The docs explicitly say it uses libavcodec values. p->vsapi->propSetInt(map, "_ColorSpace", - mp_csp_to_avcol_spc(params->colorspace), 0); + mp_csp_to_avcol_spc(params->color.space), 0); if (params->chroma_location) { p->vsapi->propSetInt(map, "_ChromaLocation", params->chroma_location == MP_CHROMA_CENTER, 0); diff --git a/video/filter/vf_vavpp.c b/video/filter/vf_vavpp.c index 0365b55fb3..b24f886241 100644 --- a/video/filter/vf_vavpp.c +++ b/video/filter/vf_vavpp.c @@ -168,7 +168,7 @@ static struct mp_image *render(struct vf_instance *vf) mp_image_set_size(img, in->w, in->h); mp_image_copy_attributes(img, in); - unsigned int flags = va_get_colorspace_flag(p->params.colorspace); + unsigned int flags = va_get_colorspace_flag(p->params.color.space); if (!mp_refqueue_is_interlaced(p->queue)) { flags |= VA_FRAME_PICTURE; } else if (mp_refqueue_is_top_field(p->queue)) { |