GstVaapiLevelH265 level;
GstVaapiEntrypoint entrypoint;
guint8 profile_idc;
- guint8 max_profile_idc;
+ GArray *allowed_profiles;
guint8 level_idc;
guint32 idr_period;
guint32 init_qp;
static gboolean
ensure_profile_limits (GstVaapiEncoderH265 * encoder)
{
+ gint i;
- if (!encoder->max_profile_idc
- || encoder->profile_idc <= encoder->max_profile_idc)
+ if (!encoder->allowed_profiles)
return TRUE;
+ for (i = 0; i < encoder->allowed_profiles->len; i++) {
+ if (encoder->profile ==
+ g_array_index (encoder->allowed_profiles, GstVaapiProfile, i))
+ return TRUE;
+ }
+
GST_WARNING
("Needs to lower coding tools to meet target decoder constraints");
GST_WARNING ("Only supporting Main profile, reset profile to Main");
ref_pool->max_ref_frames = 0;
ref_pool->max_reflist0_count = 1;
ref_pool->max_reflist1_count = 1;
+
+ encoder->allowed_profiles = NULL;
}
struct _GstVaapiEncoderH265Class
reset_tile (encoder);
+ if (encoder->allowed_profiles)
+ g_array_unref (encoder->allowed_profiles);
+
G_OBJECT_CLASS (gst_vaapi_encoder_h265_parent_class)->finalize (object);
}
}
/**
- * gst_vaapi_encoder_h265_set_max_profile:
+ * gst_vaapi_encoder_h265_set_allowed_profiles:
* @encoder: a #GstVaapiEncoderH265
- * @profile: an H.265 #GstVaapiProfile
- *
- * Notifies the @encoder to use coding tools from the supplied
- * @profile at most.
+ * @profiles: a #GArray of all allowed #GstVaapiProfile.
*
- * This means that if the minimal profile derived to
- * support the specified coding tools is greater than this @profile,
- * then an error is returned when the @encoder is configured.
+ * Set the all allowed profiles for the encoder.
*
* Return value: %TRUE on success
*/
gboolean
-gst_vaapi_encoder_h265_set_max_profile (GstVaapiEncoderH265 * encoder,
- GstVaapiProfile profile)
+gst_vaapi_encoder_h265_set_allowed_profiles (GstVaapiEncoderH265 * encoder,
+ GArray * profiles)
{
- guint8 profile_idc;
-
g_return_val_if_fail (encoder != NULL, FALSE);
- g_return_val_if_fail (profile != GST_VAAPI_PROFILE_UNKNOWN, FALSE);
-
- if (gst_vaapi_profile_get_codec (profile) != GST_VAAPI_CODEC_H265)
- return FALSE;
-
- profile_idc = gst_vaapi_utils_h265_get_profile_idc (profile);
- if (!profile_idc)
- return FALSE;
+ g_return_val_if_fail (profiles, FALSE);
- encoder->max_profile_idc = profile_idc;
+ encoder->allowed_profiles = g_array_ref (profiles);
return TRUE;
}