Populate color properties on the AVFrame

VideoToolbox reads them from the AVFrame instead of the AVCodecContext.
This commit is contained in:
Cameron Gutman 2023-10-03 18:07:49 -05:00
parent e9b529c46d
commit 3246428b7d

View File

@ -1601,6 +1601,11 @@ namespace video {
frame->format = ctx->pix_fmt;
frame->width = ctx->width;
frame->height = ctx->height;
frame->color_range = ctx->color_range;
frame->color_primaries = ctx->color_primaries;
frame->color_trc = ctx->color_trc;
frame->colorspace = ctx->colorspace;
frame->chroma_location = ctx->chroma_sample_location;
// Attach HDR metadata to the AVFrame
if (colorspace_is_hdr(colorspace)) {