summaryrefslogtreecommitdiff
path: root/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2017-06-05 20:30:07 +0200
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2017-06-07 11:24:38 +0200
commit846c276e26a071c4f1fccb7b0949d4de30a27fb6 (patch)
treea21536c4211fbccfc08fed2756b86ae55924fc2b /gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c
parentacf106e1a718cc273f5684c3e76c4e9da17324eb (diff)
libs: encoder: vp8,h264,h265,mpeg2: set misc param once
Instead of recalculating the miscellaneous buffer parameters for every buffer, it is only done once, when the encoder is configured. And for every buffer, the same structures are just copied. https://bugzilla.gnome.org/show_bug.cgi?id=783449
Diffstat (limited to 'gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c')
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c b/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c
index e80443a7..2c284ee4 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c
@@ -452,8 +452,7 @@ ensure_picture (GstVaapiEncoderMpeg2 * encoder, GstVaapiEncPicture * picture,
}
static gboolean
-ensure_control_rate_params (GstVaapiEncoderMpeg2 * encoder,
- GstVaapiEncPicture * picture)
+ensure_control_rate_params (GstVaapiEncoderMpeg2 * encoder)
{
GstVaapiEncoder *const base_encoder = GST_VAAPI_ENCODER_CAST (encoder);
@@ -476,7 +475,7 @@ ensure_control_rate_params (GstVaapiEncoderMpeg2 * encoder,
};
/* *INDENT-ON* */
- return gst_vaapi_encoder_ensure_param_control_rate (base_encoder, picture);
+ return TRUE;
}
static gboolean
@@ -485,7 +484,7 @@ set_misc_parameters (GstVaapiEncoderMpeg2 * encoder,
{
GstVaapiEncoder *const base_encoder = GST_VAAPI_ENCODER_CAST (encoder);
- if (!ensure_control_rate_params (encoder, picture))
+ if (!gst_vaapi_encoder_ensure_param_control_rate (base_encoder, picture))
return FALSE;
if (!gst_vaapi_encoder_ensure_param_quality_level (base_encoder, picture))
return FALSE;
@@ -713,6 +712,7 @@ gst_vaapi_encoder_mpeg2_reconfigure (GstVaapiEncoder * base_encoder)
if (!ensure_bitrate (encoder))
goto error;
+ ensure_control_rate_params (encoder);
return set_context_info (base_encoder);
/* ERRORS */