diff options
author | XuGuangxin <guangxin.xu@intel.com> | 2016-07-28 14:17:53 +0300 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2017-11-08 12:33:50 +0100 |
commit | e49859fde03dc8afdf339f6894f15e3a32f902bc (patch) | |
tree | 19ee495efb4aaabb3040e5bfecb45805e8b6d8c7 /gst-libs/gst | |
parent | 89717a447fcc46e64000e9099706aec83fe02769 (diff) |
libs: encoder: h264: Add property "temporal-levels"
Adds new property "temporal-levels" to select the number of
temporal levels to be included in the encoded stream.
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=788918
Diffstat (limited to 'gst-libs/gst')
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiencoder_h264.c | 22 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiencoder_h264.h | 2 |
2 files changed, 24 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c index cd9adf80..3d0afdd0 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c @@ -48,6 +48,10 @@ /* Define the maximum value for view-id */ #define MAX_VIEW_ID 1023 +/* Define default temporal levels */ +#define MIN_TEMPORAL_LEVELS 1 +#define MAX_TEMPORAL_LEVELS 4 + /* Supported set of VA rate controls, within this implementation */ #define SUPPORTED_RATECONTROLS \ (GST_VAAPI_RATECONTROL_MASK (CQP) | \ @@ -717,6 +721,7 @@ struct _GstVaapiEncoderH264 guint32 mb_height; gboolean use_cabac; gboolean use_dct8x8; + guint temporal_levels; GstClockTime cts_offset; gboolean config_changed; @@ -2989,6 +2994,7 @@ gst_vaapi_encoder_h264_init (GstVaapiEncoder * base_encoder) encoder->is_mvc = FALSE; encoder->num_views = 1; encoder->view_idx = 0; + encoder->temporal_levels = MIN_TEMPORAL_LEVELS; memset (encoder->view_ids, 0, sizeof (encoder->view_ids)); /* re-ordering list initialize */ @@ -3119,6 +3125,9 @@ gst_vaapi_encoder_h264_set_property (GstVaapiEncoder * base_encoder, case GST_VAAPI_ENCODER_H264_PROP_MBBRC: encoder->mbbrc = g_value_get_enum (value); break; + case GST_VAAPI_ENCODER_H264_PROP_TEMPORAL_LEVELS: + encoder->temporal_levels = g_value_get_uint (value); + break; default: return GST_VAAPI_ENCODER_STATUS_ERROR_INVALID_PARAMETER; @@ -3301,6 +3310,19 @@ gst_vaapi_encoder_h264_get_default_properties (void) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** + * GstVaapiEncoderH264:temporal-levels: + * + * Number of temporal levels in the encoded stream. + */ + GST_VAAPI_ENCODER_PROPERTIES_APPEND (props, + GST_VAAPI_ENCODER_H264_PROP_TEMPORAL_LEVELS, + g_param_spec_uint ("temporal-levels", + "temporal levels", + "Number of temporal levels in the encoded stream ", + MIN_TEMPORAL_LEVELS, MAX_TEMPORAL_LEVELS, MIN_TEMPORAL_LEVELS, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** * GstVaapiEncoderH264:cpb-length: * * The size of the CPB buffer in milliseconds. diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h264.h b/gst-libs/gst/vaapi/gstvaapiencoder_h264.h index 42cb08f1..7b38e763 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_h264.h +++ b/gst-libs/gst/vaapi/gstvaapiencoder_h264.h @@ -54,6 +54,7 @@ typedef struct _GstVaapiEncoderH264 GstVaapiEncoderH264; * @GST_VAAPI_ENCODER_H264_PROP_MBBRC: Macroblock level Bitrate Control. * @GST_VAAPI_ENCODER_H264_PROP_QP_IP: Difference of QP between I and P frame. * @GST_VAAPI_ENCODER_H264_PROP_QP_IB: Difference of QP between I and B frame. + * @GST_VAAPI_ENCODER_H264_PROP_TEMPORAL_LEVELS: Number of temporal levels * * The set of H.264 encoder specific configurable properties. */ @@ -73,6 +74,7 @@ typedef enum { GST_VAAPI_ENCODER_H264_PROP_MBBRC = -13, GST_VAAPI_ENCODER_H264_PROP_QP_IP = -14, GST_VAAPI_ENCODER_H264_PROP_QP_IB = -15, + GST_VAAPI_ENCODER_H264_PROP_TEMPORAL_LEVELS = -16, } GstVaapiEncoderH264Prop; GstVaapiEncoder * |