Commit 2ec43b29 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

hqdn3d: allow live modification of params

parent 339e21d5
...@@ -43,6 +43,9 @@ ...@@ -43,6 +43,9 @@
static int Open (vlc_object_t *); static int Open (vlc_object_t *);
static void Close (vlc_object_t *); static void Close (vlc_object_t *);
static picture_t *Filter (filter_t *, picture_t *); static picture_t *Filter (filter_t *, picture_t *);
static int DenoiseCallback( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval,
void *p_data );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
...@@ -162,6 +165,11 @@ static int Open(vlc_object_t *this) ...@@ -162,6 +165,11 @@ static int Open(vlc_object_t *this)
PrecalcCoefs(cfg->Coefs[2], sys->chroma_spat); PrecalcCoefs(cfg->Coefs[2], sys->chroma_spat);
PrecalcCoefs(cfg->Coefs[3], sys->chroma_temp); PrecalcCoefs(cfg->Coefs[3], sys->chroma_temp);
var_AddCallback( filter, FILTER_PREFIX "luma-spat", DenoiseCallback, cfg );
var_AddCallback( filter, FILTER_PREFIX "chroma-spat", DenoiseCallback, cfg );
var_AddCallback( filter, FILTER_PREFIX "luma-temp", DenoiseCallback, cfg );
var_AddCallback( filter, FILTER_PREFIX "chroma-temp", DenoiseCallback, cfg );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -219,3 +227,24 @@ static picture_t *Filter(filter_t *filter, picture_t *src) ...@@ -219,3 +227,24 @@ static picture_t *Filter(filter_t *filter, picture_t *src)
return CopyInfoAndRelease(dst, src); return CopyInfoAndRelease(dst, src);
} }
static int DenoiseCallback( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval,
void *p_data )
{
VLC_UNUSED(p_this); VLC_UNUSED(oldval);
struct vf_priv_s *cfg = (struct vf_priv_s *)p_data;
if( !strcmp( psz_var, FILTER_PREFIX "luma-spat" ) )
PrecalcCoefs(cfg->Coefs[0], newval.f_float);
else if( !strcmp( psz_var, FILTER_PREFIX "luma-temp" ) )
PrecalcCoefs(cfg->Coefs[1], newval.f_float);
else if( !strcmp( psz_var, FILTER_PREFIX "chroma-spat") )
PrecalcCoefs(cfg->Coefs[2], newval.f_float);
else if( !strcmp( psz_var, FILTER_PREFIX "chroma-temp") )
PrecalcCoefs(cfg->Coefs[3], newval.f_float);
return VLC_SUCCESS;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment