diff options
author | wm4 <wm4@nowhere> | 2019-11-02 01:00:32 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-11-02 01:00:32 +0100 |
commit | bdd1e1e7ec20bc8ff7a5486d589645d9988c7c6c (patch) | |
tree | d123531093d0a63800f66a61ec52733e519e9f7d | |
parent | 337ccc50dc0eae2154ec9cdfcde003a6cb119f92 (diff) | |
download | mpv-bdd1e1e7ec20bc8ff7a5486d589645d9988c7c6c.tar.bz2 mpv-bdd1e1e7ec20bc8ff7a5486d589645d9988c7c6c.tar.xz |
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.
-rw-r--r-- | video/img_format.c | 2 | ||||
-rw-r--r-- | video/img_format.h | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/video/img_format.c b/video/img_format.c index e224a4b7d4..524fc4eea3 100644 --- a/video/img_format.c +++ b/video/img_format.c @@ -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; diff --git a/video/img_format.h b/video/img_format.h index 39d0a4bdad..5f097d43ff 100644 --- a/video/img_format.h +++ b/video/img_format.h @@ -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; |