Browse Source

subpicture: set regions to full range SDR by default

The caller of subpicture_region_New() can change it afterwards
in the region format and the picture format.
By default the values were undefined and might pick the
colorimetry of the video.

Ref. #27877 and #26180

Similar to 35396660ac adapted to 3.0
cherry-pick-c5513cf9
Steve Lhomme 1 year ago
parent
commit
02013c329d
  1. 16
      src/misc/subpicture.c

16
src/misc/subpicture.c

@ -243,6 +243,22 @@ subpicture_region_t *subpicture_region_New( const video_format_t *p_fmt )
return NULL;
}
if (p_region->fmt.transfer == TRANSFER_FUNC_UNDEF)
p_region->fmt.transfer = TRANSFER_FUNC_SRGB;
if (p_region->fmt.primaries == COLOR_PRIMARIES_UNDEF)
p_region->fmt.primaries = COLOR_PRIMARIES_SRGB;
if (p_region->fmt.space == COLOR_SPACE_UNDEF)
p_region->fmt.space = COLOR_SPACE_SRGB;
p_region->fmt.b_color_range_full = true;
if (p_region->p_picture->format.transfer == TRANSFER_FUNC_UNDEF)
p_region->p_picture->format.transfer = TRANSFER_FUNC_SRGB;
if (p_region->p_picture->format.primaries == COLOR_PRIMARIES_UNDEF)
p_region->p_picture->format.primaries = COLOR_PRIMARIES_SRGB;
if (p_region->p_picture->format.space == COLOR_SPACE_UNDEF)
p_region->p_picture->format.space = COLOR_SPACE_SRGB;
p_region->p_picture->format.b_color_range_full = true;
return p_region;
}

Loading…
Cancel
Save