vpxenc: Rename GST_VPX_WARN to GST_VPX_ENC_WARN

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6626>
This commit is contained in:
Philippe Normand 2024-04-13 10:55:55 +01:00
parent 3f90dca733
commit 73ce4fd770
2 changed files with 43 additions and 36 deletions

View file

@ -44,4 +44,11 @@ typedef enum gst_vpx_img_fmt
GST_VPX_IMG_FMT_I44016 = GST_VPX_IMG_FMT_I440 | GST_VPX_IMG_FMT_HIGHBITDEPTH GST_VPX_IMG_FMT_I44016 = GST_VPX_IMG_FMT_I440 | GST_VPX_IMG_FMT_HIGHBITDEPTH
} gst_vpx_img_fmt_t; } gst_vpx_img_fmt_t;
#define GST_VPX_ENC_WARN(element, message, status) \
G_STMT_START { \
GST_WARNING_OBJECT(element, "%s: %s (details: %s)", #message, \
gst_vpx_error_name(status), \
GST_STR_NULL(element->encoder.err_detail)); \
} \
G_STMT_END
G_END_DECLS G_END_DECLS

View file

@ -371,12 +371,6 @@ static gboolean gst_vpx_enc_propose_allocation (GstVideoEncoder * encoder,
static gboolean gst_vpx_enc_transform_meta (GstVideoEncoder * encoder, static gboolean gst_vpx_enc_transform_meta (GstVideoEncoder * encoder,
GstVideoCodecFrame * frame, GstMeta * meta); GstVideoCodecFrame * frame, GstMeta * meta);
#define GST_VPX_WARN(element, message, status) G_STMT_START { \
GST_WARNING_OBJECT (element, \
"%s: %s (details: %s)", \
#message, gst_vpx_error_name (status), GST_STR_NULL (element->encoder.err_detail)); \
} G_STMT_END
#define parent_class gst_vpx_enc_parent_class #define parent_class gst_vpx_enc_parent_class
G_DEFINE_TYPE_WITH_CODE (GstVPXEnc, gst_vpx_enc, GST_TYPE_VIDEO_ENCODER, G_DEFINE_TYPE_WITH_CODE (GstVPXEnc, gst_vpx_enc, GST_TYPE_VIDEO_ENCODER,
G_IMPLEMENT_INTERFACE (GST_TYPE_TAG_SETTER, NULL); G_IMPLEMENT_INTERFACE (GST_TYPE_TAG_SETTER, NULL);
@ -1146,7 +1140,7 @@ gst_vpx_enc_set_property (GObject * object, guint prop_id,
status = status =
vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_SCALEMODE, &sm); vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_SCALEMODE, &sm);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (gst_vpx_enc, "Failed to set VP8E_SET_SCALEMODE", GST_VPX_ENC_WARN (gst_vpx_enc, "Failed to set VP8E_SET_SCALEMODE",
status); status);
} }
} }
@ -1162,7 +1156,7 @@ gst_vpx_enc_set_property (GObject * object, guint prop_id,
status = status =
vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_SCALEMODE, &sm); vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_SCALEMODE, &sm);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (gst_vpx_enc, "Failed to set VP8E_SET_SCALEMODE", GST_VPX_ENC_WARN (gst_vpx_enc, "Failed to set VP8E_SET_SCALEMODE",
status); status);
} }
} }
@ -1174,7 +1168,8 @@ gst_vpx_enc_set_property (GObject * object, guint prop_id,
vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_CPUUSED, vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_CPUUSED,
gst_vpx_enc->cpu_used); gst_vpx_enc->cpu_used);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (gst_vpx_enc, "Failed to set VP8E_SET_CPUUSED", status); GST_VPX_ENC_WARN (gst_vpx_enc, "Failed to set VP8E_SET_CPUUSED",
status);
} }
} }
break; break;
@ -1185,8 +1180,8 @@ gst_vpx_enc_set_property (GObject * object, guint prop_id,
vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_ENABLEAUTOALTREF, vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_ENABLEAUTOALTREF,
(gst_vpx_enc->enable_auto_alt_ref ? 1 : 0)); (gst_vpx_enc->enable_auto_alt_ref ? 1 : 0));
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (gst_vpx_enc, "Failed to set VP8E_SET_ENABLEAUTOALTREF", GST_VPX_ENC_WARN (gst_vpx_enc,
status); "Failed to set VP8E_SET_ENABLEAUTOALTREF", status);
} }
} }
break; break;
@ -1197,8 +1192,8 @@ gst_vpx_enc_set_property (GObject * object, guint prop_id,
vpx_codec_control (&gst_vpx_enc->encoder, vpx_codec_control (&gst_vpx_enc->encoder,
VP8E_SET_NOISE_SENSITIVITY, gst_vpx_enc->noise_sensitivity); VP8E_SET_NOISE_SENSITIVITY, gst_vpx_enc->noise_sensitivity);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (gst_vpx_enc, "Failed to set VP8E_SET_NOISE_SENSITIVITY", GST_VPX_ENC_WARN (gst_vpx_enc,
status); "Failed to set VP8E_SET_NOISE_SENSITIVITY", status);
} }
} }
break; break;
@ -1208,7 +1203,7 @@ gst_vpx_enc_set_property (GObject * object, guint prop_id,
status = vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_SHARPNESS, status = vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_SHARPNESS,
gst_vpx_enc->sharpness); gst_vpx_enc->sharpness);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (gst_vpx_enc, "Failed to set VP8E_SET_SHARPNESS", GST_VPX_ENC_WARN (gst_vpx_enc, "Failed to set VP8E_SET_SHARPNESS",
status); status);
} }
} }
@ -1220,8 +1215,8 @@ gst_vpx_enc_set_property (GObject * object, guint prop_id,
vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_STATIC_THRESHOLD, vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_STATIC_THRESHOLD,
gst_vpx_enc->static_threshold); gst_vpx_enc->static_threshold);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (gst_vpx_enc, "Failed to set VP8E_SET_STATIC_THRESHOLD", GST_VPX_ENC_WARN (gst_vpx_enc,
status); "Failed to set VP8E_SET_STATIC_THRESHOLD", status);
} }
} }
break; break;
@ -1232,8 +1227,8 @@ gst_vpx_enc_set_property (GObject * object, guint prop_id,
vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_TOKEN_PARTITIONS, vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_TOKEN_PARTITIONS,
gst_vpx_enc->token_partitions); gst_vpx_enc->token_partitions);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (gst_vpx_enc, "Failed to set VP8E_SET_TOKEN_PARTIONS", GST_VPX_ENC_WARN (gst_vpx_enc,
status); "Failed to set VP8E_SET_TOKEN_PARTIONS", status);
} }
} }
break; break;
@ -1244,8 +1239,8 @@ gst_vpx_enc_set_property (GObject * object, guint prop_id,
vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_ARNR_MAXFRAMES, vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_ARNR_MAXFRAMES,
gst_vpx_enc->arnr_maxframes); gst_vpx_enc->arnr_maxframes);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (gst_vpx_enc, "Failed to set VP8E_SET_ARNR_MAXFRAMES", GST_VPX_ENC_WARN (gst_vpx_enc,
status); "Failed to set VP8E_SET_ARNR_MAXFRAMES", status);
} }
} }
break; break;
@ -1256,7 +1251,7 @@ gst_vpx_enc_set_property (GObject * object, guint prop_id,
vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_ARNR_STRENGTH, vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_ARNR_STRENGTH,
gst_vpx_enc->arnr_strength); gst_vpx_enc->arnr_strength);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (gst_vpx_enc, "Failed to set VP8E_SET_ARNR_STRENGTH", GST_VPX_ENC_WARN (gst_vpx_enc, "Failed to set VP8E_SET_ARNR_STRENGTH",
status); status);
} }
} }
@ -1272,7 +1267,8 @@ gst_vpx_enc_set_property (GObject * object, guint prop_id,
status = vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_TUNING, status = vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_TUNING,
gst_vpx_enc->tuning); gst_vpx_enc->tuning);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (gst_vpx_enc, "Failed to set VP8E_SET_TUNING", status); GST_VPX_ENC_WARN (gst_vpx_enc, "Failed to set VP8E_SET_TUNING",
status);
} }
} }
break; break;
@ -1282,7 +1278,8 @@ gst_vpx_enc_set_property (GObject * object, guint prop_id,
status = vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_CQ_LEVEL, status = vpx_codec_control (&gst_vpx_enc->encoder, VP8E_SET_CQ_LEVEL,
gst_vpx_enc->cq_level); gst_vpx_enc->cq_level);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (gst_vpx_enc, "Failed to set VP8E_SET_CQ_LEVEL", status); GST_VPX_ENC_WARN (gst_vpx_enc, "Failed to set VP8E_SET_CQ_LEVEL",
status);
} }
} }
break; break;
@ -1293,7 +1290,7 @@ gst_vpx_enc_set_property (GObject * object, guint prop_id,
vpx_codec_control (&gst_vpx_enc->encoder, vpx_codec_control (&gst_vpx_enc->encoder,
VP8E_SET_MAX_INTRA_BITRATE_PCT, gst_vpx_enc->max_intra_bitrate_pct); VP8E_SET_MAX_INTRA_BITRATE_PCT, gst_vpx_enc->max_intra_bitrate_pct);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (gst_vpx_enc, GST_VPX_ENC_WARN (gst_vpx_enc,
"Failed to set VP8E_SET_MAX_INTRA_BITRATE_PCT", status); "Failed to set VP8E_SET_MAX_INTRA_BITRATE_PCT", status);
} }
} }
@ -1840,7 +1837,7 @@ gst_vpx_enc_set_format (GstVideoEncoder * video_encoder,
status = vpx_codec_control (&encoder->encoder, VP8E_SET_SCALEMODE, &sm); status = vpx_codec_control (&encoder->encoder, VP8E_SET_SCALEMODE, &sm);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (encoder, "Failed to set VP8E_SET_SCALEMODE", status); GST_VPX_ENC_WARN (encoder, "Failed to set VP8E_SET_SCALEMODE", status);
} }
} }
@ -1848,59 +1845,62 @@ gst_vpx_enc_set_format (GstVideoEncoder * video_encoder,
vpx_codec_control (&encoder->encoder, VP8E_SET_CPUUSED, vpx_codec_control (&encoder->encoder, VP8E_SET_CPUUSED,
encoder->cpu_used); encoder->cpu_used);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (encoder, "Failed to set VP8E_SET_CPUUSED", status); GST_VPX_ENC_WARN (encoder, "Failed to set VP8E_SET_CPUUSED", status);
} }
status = status =
vpx_codec_control (&encoder->encoder, VP8E_SET_ENABLEAUTOALTREF, vpx_codec_control (&encoder->encoder, VP8E_SET_ENABLEAUTOALTREF,
(encoder->enable_auto_alt_ref ? 1 : 0)); (encoder->enable_auto_alt_ref ? 1 : 0));
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (encoder, "Failed to set VP8E_SET_ENABLEAUTOALTREF", status); GST_VPX_ENC_WARN (encoder, "Failed to set VP8E_SET_ENABLEAUTOALTREF",
status);
} }
status = vpx_codec_control (&encoder->encoder, VP8E_SET_NOISE_SENSITIVITY, status = vpx_codec_control (&encoder->encoder, VP8E_SET_NOISE_SENSITIVITY,
encoder->noise_sensitivity); encoder->noise_sensitivity);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (encoder, "Failed to set VP8E_SET_NOISE_SENSITIVITY", status); GST_VPX_ENC_WARN (encoder, "Failed to set VP8E_SET_NOISE_SENSITIVITY",
status);
} }
status = vpx_codec_control (&encoder->encoder, VP8E_SET_SHARPNESS, status = vpx_codec_control (&encoder->encoder, VP8E_SET_SHARPNESS,
encoder->sharpness); encoder->sharpness);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (encoder, "Failed to set VP8E_SET_SHARPNESS", status); GST_VPX_ENC_WARN (encoder, "Failed to set VP8E_SET_SHARPNESS", status);
} }
status = vpx_codec_control (&encoder->encoder, VP8E_SET_STATIC_THRESHOLD, status = vpx_codec_control (&encoder->encoder, VP8E_SET_STATIC_THRESHOLD,
encoder->static_threshold); encoder->static_threshold);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (encoder, "Failed to set VP8E_SET_STATIC_THRESHOLD", status); GST_VPX_ENC_WARN (encoder, "Failed to set VP8E_SET_STATIC_THRESHOLD",
status);
} }
status = vpx_codec_control (&encoder->encoder, VP8E_SET_TOKEN_PARTITIONS, status = vpx_codec_control (&encoder->encoder, VP8E_SET_TOKEN_PARTITIONS,
encoder->token_partitions); encoder->token_partitions);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (encoder, "Failed to set VP8E_SET_TOKEN_PARTIONS", status); GST_VPX_ENC_WARN (encoder, "Failed to set VP8E_SET_TOKEN_PARTIONS", status);
} }
status = vpx_codec_control (&encoder->encoder, VP8E_SET_ARNR_MAXFRAMES, status = vpx_codec_control (&encoder->encoder, VP8E_SET_ARNR_MAXFRAMES,
encoder->arnr_maxframes); encoder->arnr_maxframes);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (encoder, "Failed to set VP8E_SET_ARNR_MAXFRAMES", status); GST_VPX_ENC_WARN (encoder, "Failed to set VP8E_SET_ARNR_MAXFRAMES", status);
} }
status = vpx_codec_control (&encoder->encoder, VP8E_SET_ARNR_STRENGTH, status = vpx_codec_control (&encoder->encoder, VP8E_SET_ARNR_STRENGTH,
encoder->arnr_strength); encoder->arnr_strength);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (encoder, "Failed to set VP8E_SET_ARNR_STRENGTH", status); GST_VPX_ENC_WARN (encoder, "Failed to set VP8E_SET_ARNR_STRENGTH", status);
} }
status = vpx_codec_control (&encoder->encoder, VP8E_SET_TUNING, status = vpx_codec_control (&encoder->encoder, VP8E_SET_TUNING,
encoder->tuning); encoder->tuning);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (encoder, "Failed to set VP8E_SET_TUNING", status); GST_VPX_ENC_WARN (encoder, "Failed to set VP8E_SET_TUNING", status);
} }
status = vpx_codec_control (&encoder->encoder, VP8E_SET_CQ_LEVEL, status = vpx_codec_control (&encoder->encoder, VP8E_SET_CQ_LEVEL,
encoder->cq_level); encoder->cq_level);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (encoder, "Failed to set VP8E_SET_CQ_LEVEL", status); GST_VPX_ENC_WARN (encoder, "Failed to set VP8E_SET_CQ_LEVEL", status);
} }
status = vpx_codec_control (&encoder->encoder, VP8E_SET_MAX_INTRA_BITRATE_PCT, status = vpx_codec_control (&encoder->encoder, VP8E_SET_MAX_INTRA_BITRATE_PCT,
encoder->max_intra_bitrate_pct); encoder->max_intra_bitrate_pct);
if (status != VPX_CODEC_OK) { if (status != VPX_CODEC_OK) {
GST_VPX_WARN (encoder, "Failed to set VP8E_SET_MAX_INTRA_BITRATE_PCT", GST_VPX_ENC_WARN (encoder, "Failed to set VP8E_SET_MAX_INTRA_BITRATE_PCT",
status); status);
} }