csputils: change mp_hdr_metadata to pl_hdr_metadata

This commit is contained in:
Kacper Michajłow 2023-10-24 00:46:05 +02:00 committed by sfan5
parent 076be24853
commit 468feb863b
4 changed files with 6 additions and 33 deletions

View File

@ -2706,7 +2706,7 @@ static int mp_property_hdr_metadata(void *ctx, struct m_property *prop,
if (valid != M_PROPERTY_VALID)
return valid;
struct mp_hdr_metadata data;
struct pl_hdr_metadata data;
if (vo_control(mpctx->video_out, VOCTRL_HDR_METADATA, &data) != VO_TRUE)
return M_PROPERTY_UNAVAILABLE;

View File

@ -21,6 +21,8 @@
#include <stdbool.h>
#include <stdint.h>
#include <libplacebo/colorspace.h>
#include "options/m_option.h"
/* NOTE: the csp and levels AUTO values are converted to specific ones
@ -139,24 +141,6 @@ extern const struct m_opt_choice_alternatives mp_stereo3d_names[];
#define MP_STEREO3D_NAME_DEF(x, def) \
(MP_STEREO3D_NAME(x) ? MP_STEREO3D_NAME(x) : (def))
struct mp_hdr_metadata {
// HDR10
// Mastering display metadata
float min_luma, max_luma; // min/max luminance (in cd/m²)
// Content light level
float max_cll; // max content light level (in cd/m²)
float max_fall; // max frame average light level (in cd/m²)
// HDR10+
float scene_max[3]; // maxRGB in cd/m² per component (RGB)
float scene_avg; // average of maxRGB in cd/m²
// CIE Y
float max_pq_y; // maximum PQ luminance (in PQ, 0-1)
float avg_pq_y; // averaged PQ luminance (in PQ, 0-1)
};
struct mp_colorspace {
enum mp_csp space;
enum mp_csp_levels levels;

View File

@ -123,7 +123,7 @@ enum mp_voctrl {
/* private to vo_gpu and vo_gpu_next */
VOCTRL_EXTERNAL_RESIZE,
VOCTRL_HDR_METADATA, // struct mp_hdr_metadata*
VOCTRL_HDR_METADATA, // struct pl_hdr_metadata*
};
// Helper to expose what kind of content is currently playing to the VO.

View File

@ -1436,20 +1436,9 @@ static int control(struct vo *vo, uint32_t request, void *data)
return true;
}
case VOCTRL_HDR_METADATA: {
struct mp_hdr_metadata *hdr = data;
hdr->min_luma = p->last_hdr_metadata.min_luma;
hdr->max_luma = p->last_hdr_metadata.max_luma;
hdr->max_cll = p->last_hdr_metadata.max_cll;
hdr->max_fall = p->last_hdr_metadata.max_fall;
hdr->scene_max[0] = p->last_hdr_metadata.scene_max[0];
hdr->scene_max[1] = p->last_hdr_metadata.scene_max[1];
hdr->scene_max[2] = p->last_hdr_metadata.scene_max[2];
hdr->scene_avg = p->last_hdr_metadata.scene_avg;
hdr->max_pq_y = p->last_hdr_metadata.max_pq_y;
hdr->avg_pq_y = p->last_hdr_metadata.avg_pq_y;
case VOCTRL_HDR_METADATA:
*(struct pl_hdr_metadata *) data = p->last_hdr_metadata;
return true;
}
case VOCTRL_SCREENSHOT:
video_screenshot(vo, data);