x265: Allow building with x265-4.1

In x265-4.1 masteringDisplayColorVolume is changed from a pointer to a
character array embedded in struct x265_param.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7968>
This commit is contained in:
Xi Ruoyao 2024-11-26 21:34:25 +08:00 committed by GStreamer Marge Bot
parent 23a006c64f
commit ee3802cf71

View file

@ -948,8 +948,13 @@ gst_x265_enc_init_encoder_locked (GstX265Enc * encoder)
* HEVC uses gbr order * HEVC uses gbr order
* See spec D.3.28 display_primaries_x and display_primaries_y * See spec D.3.28 display_primaries_x and display_primaries_y
*/ */
encoder->x265param.masteringDisplayColorVolume = #if X265_BUILD < 214
g_strdup_printf ("G(%hu,%hu)B(%hu,%hu)R(%hu,%hu)WP(%hu,%hu)L(%u,%u)", encoder->x265param.masteringDisplayColorVolume = g_strdup_printf (
#else
snprintf (encoder->x265param.masteringDisplayColorVolume,
X265_MAX_STRING_SIZE,
#endif
"G(%hu,%hu)B(%hu,%hu)R(%hu,%hu)WP(%hu,%hu)L(%u,%u)",
minfo.display_primaries[1].x, minfo.display_primaries[1].y, minfo.display_primaries[1].x, minfo.display_primaries[1].y,
minfo.display_primaries[2].x, minfo.display_primaries[2].y, minfo.display_primaries[2].x, minfo.display_primaries[2].y,
minfo.display_primaries[0].x, minfo.display_primaries[0].y, minfo.display_primaries[0].x, minfo.display_primaries[0].y,