@@ -413,6 +413,7 @@ static const struct gl_video_opts gl_video_opts_def = {
413413};
414414
415415static OPT_STRING_VALIDATE_FUNC (validate_error_diffusion_opt );
416+ static OPT_STRING_VALIDATE_FUNC (validate_target_gamut );
416417
417418#define OPT_BASE_STRUCT struct gl_video_opts
418419
@@ -452,7 +453,7 @@ const struct m_sub_options gl_video_conf = {
452453 {"no" , 0 }, {"input" , 1 }, {"output" , 2 }, {"both" , 1 |2 }, {"auto" , 1 |2 |4 })},
453454 {"target-contrast" , OPT_CHOICE (target_contrast , {"auto" , 0 }, {"inf" , -1 }),
454455 M_RANGE (10 , 10 / PL_COLOR_HDR_BLACK )},
455- {"target-gamut" , OPT_CHOICE_C (target_gamut , pl_csp_prim_names )},
456+ {"target-gamut" , OPT_STRING_VALIDATE (target_gamut , validate_target_gamut )},
456457 {"tone-mapping" , OPT_CHOICE (tone_map .curve ,
457458 {"auto" , TONE_MAPPING_AUTO },
458459 {"clip" , TONE_MAPPING_CLIP },
@@ -4331,6 +4332,13 @@ static int validate_error_diffusion_opt(struct mp_log *log, const m_option_t *op
43314332 return r ;
43324333}
43334334
4335+ static int validate_target_gamut (struct mp_log * log , const m_option_t * opt ,
4336+ struct bstr name , const char * * value )
4337+ {
4338+ struct pl_raw_primaries tmp ;
4339+ return mp_parse_raw_primaries (log , * value , & tmp );
4340+ }
4341+
43344342void gl_video_set_ambient_lux (struct gl_video * p , double lux )
43354343{
43364344 if (p -> opts .gamma_auto ) {
0 commit comments