img_format: add mp_regular_imgfmt.forced_csp field

As the code comment says, this is needed to disambiguate FFmpeg formats.
This struct only describes the "physical" layout of a format, while
FFmpeg also attaches part of the colorspace information to the format.
This commit is contained in:
wm4 2019-11-02 01:00:32 +01:00
parent 337ccc50dc
commit bdd1e1e7ec
2 changed files with 7 additions and 0 deletions

View File

@ -454,6 +454,8 @@ bool mp_get_regular_imgfmt(struct mp_regular_imgfmt *dst, int imgfmt)
return false; // it's satan himself
#endif
res.forced_csp = mp_imgfmt_get_forced_csp(imgfmt);
if (!validate_regular_imgfmt(&res))
return false;

View File

@ -125,6 +125,11 @@ struct mp_regular_imgfmt {
// Type of each component.
enum mp_component_type component_type;
// See mp_imgfmt_get_forced_csp(). Normally code should use
// mp_image_params.colors. This field is only needed to map the format
// unambiguously to FFmpeg formats.
enum mp_csp forced_csp;
// Size of each component in bytes.
uint8_t component_size;