svtav1enc: Fix compilation with SVT-AV1 1.1 and drop GStreamer 1.16 compatibility

This commit is contained in:
Sebastian Dröge 2023-02-03 21:25:43 +02:00
parent 5bc92375c9
commit aca2bad25c

View file

@ -26,6 +26,12 @@
#include <gst/video/gstvideoencoder.h> #include <gst/video/gstvideoencoder.h>
#include "gstsvtav1enc.h" #include "gstsvtav1enc.h"
#if !SVT_AV1_CHECK_VERSION(1,2,1)
#define SVT_AV1_RC_MODE_CQP_OR_CRF 0
#define SVT_AV1_RC_MODE_VBR 1
#define SVT_AV1_RC_MODE_CBR 2
#endif
GST_DEBUG_CATEGORY_STATIC (gst_svtav1enc_debug_category); GST_DEBUG_CATEGORY_STATIC (gst_svtav1enc_debug_category);
#define GST_CAT_DEFAULT gst_svtav1enc_debug_category #define GST_CAT_DEFAULT gst_svtav1enc_debug_category
@ -581,11 +587,9 @@ gst_svtav1enc_configure_svt (GstSvtAv1Enc * svtav1enc)
case GST_VIDEO_TRANSFER_GAMMA28: case GST_VIDEO_TRANSFER_GAMMA28:
svtav1enc->svt_config->transfer_characteristics = EB_CICP_TC_BT_470_B_G; svtav1enc->svt_config->transfer_characteristics = EB_CICP_TC_BT_470_B_G;
break; break;
#if GST_CHECK_VERSION(1, 18, 0)
case GST_VIDEO_TRANSFER_BT601: case GST_VIDEO_TRANSFER_BT601:
svtav1enc->svt_config->transfer_characteristics = EB_CICP_TC_BT_601; svtav1enc->svt_config->transfer_characteristics = EB_CICP_TC_BT_601;
break; break;
#endif
case GST_VIDEO_TRANSFER_SMPTE240M: case GST_VIDEO_TRANSFER_SMPTE240M:
svtav1enc->svt_config->transfer_characteristics = EB_CICP_TC_SMPTE_240; svtav1enc->svt_config->transfer_characteristics = EB_CICP_TC_SMPTE_240;
break; break;
@ -602,24 +606,20 @@ gst_svtav1enc_configure_svt (GstSvtAv1Enc * svtav1enc)
case GST_VIDEO_TRANSFER_SRGB: case GST_VIDEO_TRANSFER_SRGB:
svtav1enc->svt_config->transfer_characteristics = EB_CICP_TC_SRGB; svtav1enc->svt_config->transfer_characteristics = EB_CICP_TC_SRGB;
break; break;
#if GST_CHECK_VERSION(1, 18, 0)
case GST_VIDEO_TRANSFER_BT2020_10: case GST_VIDEO_TRANSFER_BT2020_10:
svtav1enc->svt_config->transfer_characteristics = svtav1enc->svt_config->transfer_characteristics =
EB_CICP_TC_BT_2020_10_BIT; EB_CICP_TC_BT_2020_10_BIT;
break; break;
#endif
case GST_VIDEO_TRANSFER_BT2020_12: case GST_VIDEO_TRANSFER_BT2020_12:
svtav1enc->svt_config->transfer_characteristics = svtav1enc->svt_config->transfer_characteristics =
EB_CICP_TC_BT_2020_12_BIT; EB_CICP_TC_BT_2020_12_BIT;
break; break;
#if GST_CHECK_VERSION(1, 18, 0)
case GST_VIDEO_TRANSFER_SMPTE2084: case GST_VIDEO_TRANSFER_SMPTE2084:
svtav1enc->svt_config->transfer_characteristics = EB_CICP_TC_SMPTE_2084; svtav1enc->svt_config->transfer_characteristics = EB_CICP_TC_SMPTE_2084;
break; break;
case GST_VIDEO_TRANSFER_ARIB_STD_B67: case GST_VIDEO_TRANSFER_ARIB_STD_B67:
svtav1enc->svt_config->transfer_characteristics = EB_CICP_TC_HLG; svtav1enc->svt_config->transfer_characteristics = EB_CICP_TC_HLG;
break; break;
#endif
default: default:
svtav1enc->svt_config->transfer_characteristics = EB_CICP_TC_UNSPECIFIED; svtav1enc->svt_config->transfer_characteristics = EB_CICP_TC_UNSPECIFIED;
break; break;
@ -667,7 +667,6 @@ gst_svtav1enc_configure_svt (GstSvtAv1Enc * svtav1enc)
svtav1enc->svt_config->chroma_sample_position = EB_CSP_UNKNOWN; svtav1enc->svt_config->chroma_sample_position = EB_CSP_UNKNOWN;
} }
#if GST_CHECK_VERSION(1, 18, 0)
GstVideoMasteringDisplayInfo master_display_info; GstVideoMasteringDisplayInfo master_display_info;
if (gst_video_mastering_display_info_from_caps (&master_display_info, if (gst_video_mastering_display_info_from_caps (&master_display_info,
svtav1enc->state->caps)) { svtav1enc->state->caps)) {
@ -709,7 +708,6 @@ gst_svtav1enc_configure_svt (GstSvtAv1Enc * svtav1enc)
memset (&svtav1enc->svt_config->content_light_level, memset (&svtav1enc->svt_config->content_light_level,
0, sizeof (svtav1enc->svt_config->content_light_level)); 0, sizeof (svtav1enc->svt_config->content_light_level));
} }
#endif
EbErrorType res = EbErrorType res =
svt_av1_enc_set_parameter (svtav1enc->svt_encoder, svtav1enc->svt_config); svt_av1_enc_set_parameter (svtav1enc->svt_encoder, svtav1enc->svt_config);