mirror of https://github.com/mpv-player/mpv
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:
parent
337ccc50dc
commit
bdd1e1e7ec
|
@ -454,6 +454,8 @@ bool mp_get_regular_imgfmt(struct mp_regular_imgfmt *dst, int imgfmt)
|
||||||
return false; // it's satan himself
|
return false; // it's satan himself
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
res.forced_csp = mp_imgfmt_get_forced_csp(imgfmt);
|
||||||
|
|
||||||
if (!validate_regular_imgfmt(&res))
|
if (!validate_regular_imgfmt(&res))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -125,6 +125,11 @@ struct mp_regular_imgfmt {
|
||||||
// Type of each component.
|
// Type of each component.
|
||||||
enum mp_component_type component_type;
|
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.
|
// Size of each component in bytes.
|
||||||
uint8_t component_size;
|
uint8_t component_size;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue