encoder_class->class_data = &g_class_data;
encoder_class->reconfigure = gst_vaapi_encoder_h265_reconfigure;
- encoder_class->get_default_properties =
- gst_vaapi_encoder_h265_get_default_properties;
encoder_class->reordering = gst_vaapi_encoder_h265_reordering;
encoder_class->encode = gst_vaapi_encoder_h265_encode;
encoder_class->flush = gst_vaapi_encoder_h265_flush;
return g_object_new (GST_TYPE_VAAPI_ENCODER_H265, "display", display, NULL);
}
-/**
- * gst_vaapi_encoder_h265_get_default_properties:
- *
- * Determines the set of common and H.265 specific encoder properties.
- * The caller owns an extra reference to the resulting array of
- * #GstVaapiEncoderPropInfo elements, so it shall be released with
- * g_ptr_array_unref() after usage.
- *
- * Return value: the set of encoder properties for #GstVaapiEncoderH265,
- * or %NULL if an error occurred.
- */
-GPtrArray *
-gst_vaapi_encoder_h265_get_default_properties (void)
-{
- const GstVaapiEncoderClassData *class_data = &g_class_data;
- GPtrArray *props;
-
- props = gst_vaapi_encoder_properties_get_default (class_data);
- if (!props)
- return NULL;
-
- /**
- * GstVaapiEncoderH265:max-bframes:
- *
- * The number of B-frames between I and P.
- */
- GST_VAAPI_ENCODER_PROPERTIES_APPEND (props,
- GST_VAAPI_ENCODER_H265_PROP_MAX_BFRAMES,
- g_param_spec_uint ("max-bframes",
- "Max B-Frames", "Number of B-frames between I and P", 0, 10, 0,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
- /**
- * GstVaapiEncoderH265:refs:
- *
- * The number of reference frames.
- * If B frame is encoded, it will add 1 reference frame more.
- */
- GST_VAAPI_ENCODER_PROPERTIES_APPEND (props,
- GST_VAAPI_ENCODER_H265_PROP_NUM_REF_FRAMES,
- g_param_spec_uint ("refs",
- "Number of Reference Frames", "Number of reference frames", 1, 3, 1,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
- /**
- * GstVaapiEncoderH265:init-qp:
- *
- * The initial quantizer value.
- */
- GST_VAAPI_ENCODER_PROPERTIES_APPEND (props,
- GST_VAAPI_ENCODER_H265_PROP_INIT_QP,
- g_param_spec_uint ("init-qp",
- "Initial QP", "Initial quantizer value", 0, 51, 26,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
- /**
- * GstVaapiEncoderH265:min-qp:
- *
- * The minimum quantizer value.
- */
- GST_VAAPI_ENCODER_PROPERTIES_APPEND (props,
- GST_VAAPI_ENCODER_H265_PROP_MIN_QP,
- g_param_spec_uint ("min-qp",
- "Minimum QP", "Minimum quantizer value", 0, 51, 1,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
- /**
- * GstVaapiEncoderH265:max-qp:
- *
- * The maximum quantizer value.
- *
- * Since: 1.18
- */
- GST_VAAPI_ENCODER_PROPERTIES_APPEND (props,
- GST_VAAPI_ENCODER_H265_PROP_MAX_QP,
- g_param_spec_uint ("max-qp",
- "Maximum QP", "Maximum quantizer value", 0, 51, 51,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
- /**
- * GstVaapiEncoderH265:qp-ip:
- *
- * The difference of QP between I and P Frame.
- * This is available only on CQP mode.
- */
- GST_VAAPI_ENCODER_PROPERTIES_APPEND (props,
- GST_VAAPI_ENCODER_H265_PROP_QP_IP,
- g_param_spec_int ("qp-ip",
- "Difference of QP between I and P frame",
- "Difference of QP between I and P frame (available only on CQP)",
- -51, 51, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
- /**
- * GstVaapiEncoderH265:qp-ib:
- *
- * The difference of QP between I and B Frame.
- * This is available only on CQP mode.
- */
- GST_VAAPI_ENCODER_PROPERTIES_APPEND (props,
- GST_VAAPI_ENCODER_H265_PROP_QP_IB,
- g_param_spec_int ("qp-ib",
- "Difference of QP between I and B frame",
- "Difference of QP between I and B frame (available only on CQP)",
- -51, 51, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
- /* FIXME: there seems to be issues with multi-slice encoding */
- /**
- * GstVaapiEncoderH265:num-slices:
- *
- * The number of slices per frame.
- */
- GST_VAAPI_ENCODER_PROPERTIES_APPEND (props,
- GST_VAAPI_ENCODER_H265_PROP_NUM_SLICES,
- g_param_spec_uint ("num-slices",
- "Number of Slices",
- "Number of slices per frame",
- 1, 200, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
- /**
- * GstVaapiEncoderH265:cpb-length:
- *
- * The size of the CPB buffer in milliseconds.
- */
- GST_VAAPI_ENCODER_PROPERTIES_APPEND (props,
- GST_VAAPI_ENCODER_H265_PROP_CPB_LENGTH,
- g_param_spec_uint ("cpb-length",
- "CPB Length", "Length of the CPB buffer in milliseconds",
- 1, 10000, DEFAULT_CPB_LENGTH,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
- /**
- * GstVaapiEncoderH265:mbbrc:
- *
- * Macroblock level bitrate control.
- * This is not compatible with Constant QP rate control.
- */
- GST_VAAPI_ENCODER_PROPERTIES_APPEND (props,
- GST_VAAPI_ENCODER_H265_PROP_MBBRC,
- g_param_spec_enum ("mbbrc",
- "Macroblock level Bitrate Control",
- "Macroblock level Bitrate Control",
- GST_VAAPI_TYPE_ENCODER_MBBRC, GST_VAAPI_ENCODER_MBBRC_AUTO,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
- /**
- * GstVaapiEncoderH265:low_delay_b:
- *
- * Enable low delay b frame, which will change P frame with B frame.
- */
- GST_VAAPI_ENCODER_PROPERTIES_APPEND (props,
- GST_VAAPI_ENCODER_H265_PROP_LOW_DELAY_B,
- g_param_spec_boolean ("low-delay-b",
- "Enable low delay b",
- "Transforms P frames into predictive B frames. Enable it when P frames are not supported.",
- FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
- return props;
-}
-
/**
* gst_vaapi_encoder_h265_set_max_profile:
* @encoder: a #GstVaapiEncoderH265