diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index c89a679a7e..0115c74648 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay.c @@ -557,6 +557,7 @@ ensure_profiles (GstVaapiDisplay * display) g_array_append_val (priv->decoders, config); break; case GST_VAAPI_ENTRYPOINT_SLICE_ENCODE: + case GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE: g_array_append_val (priv->encoders, config); break; } diff --git a/gst-libs/gst/vaapi/gstvaapiencoder.c b/gst-libs/gst/vaapi/gstvaapiencoder.c index 430da1e50e..7bcdc41f91 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder.c @@ -512,14 +512,22 @@ get_config_attribute (GstVaapiEncoder * encoder, VAConfigAttribType type, { GstVaapiProfile profile; VAProfile va_profile; + VAEntrypoint va_entrypoint; + const GstVaapiEncoderClassData *const cdata = + GST_VAAPI_ENCODER_GET_CLASS (encoder)->class_data; profile = get_profile (encoder); if (!profile) return FALSE; - va_profile = gst_vaapi_profile_get_va_profile (profile); + + if (cdata->codec != GST_VAAPI_CODEC_JPEG) + va_entrypoint = VAEntrypointEncSlice; + else + va_entrypoint = VAEntrypointEncPicture; + return gst_vaapi_get_config_attribute (encoder->display, va_profile, - VAEntrypointEncSlice, type, out_value_ptr); + va_entrypoint, type, out_value_ptr); } /* Determines the set of supported packed headers */ @@ -550,10 +558,16 @@ set_context_info (GstVaapiEncoder * encoder) GstVaapiConfigInfoEncoder *const config = &cip->config.encoder; const GstVideoFormat format = GST_VIDEO_INFO_FORMAT (GST_VAAPI_ENCODER_VIDEO_INFO (encoder)); + const GstVaapiEncoderClassData *const cdata = + GST_VAAPI_ENCODER_GET_CLASS (encoder)->class_data; cip->usage = GST_VAAPI_CONTEXT_USAGE_ENCODE; cip->profile = encoder->profile; cip->entrypoint = GST_VAAPI_ENTRYPOINT_SLICE_ENCODE; + if (cdata->codec != GST_VAAPI_CODEC_JPEG) + cip->entrypoint = GST_VAAPI_ENTRYPOINT_SLICE_ENCODE; + else + cip->entrypoint = GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE; cip->chroma_type = gst_vaapi_video_format_get_chroma_type (format); cip->width = GST_VAAPI_ENCODER_WIDTH (encoder); cip->height = GST_VAAPI_ENCODER_HEIGHT (encoder); diff --git a/gst-libs/gst/vaapi/gstvaapiprofile.c b/gst-libs/gst/vaapi/gstvaapiprofile.c index 6337fe99e2..1c831cdb77 100644 --- a/gst-libs/gst/vaapi/gstvaapiprofile.c +++ b/gst-libs/gst/vaapi/gstvaapiprofile.c @@ -144,11 +144,12 @@ static const GstVaapiProfileMap gst_vaapi_profiles[] = { /* Entry-points */ static const GstVaapiEntrypointMap gst_vaapi_entrypoints[] = { - { GST_VAAPI_ENTRYPOINT_VLD, VAEntrypointVLD }, - { GST_VAAPI_ENTRYPOINT_IDCT, VAEntrypointIDCT }, - { GST_VAAPI_ENTRYPOINT_MOCO, VAEntrypointMoComp }, + { GST_VAAPI_ENTRYPOINT_VLD, VAEntrypointVLD }, + { GST_VAAPI_ENTRYPOINT_IDCT, VAEntrypointIDCT }, + { GST_VAAPI_ENTRYPOINT_MOCO, VAEntrypointMoComp }, #if VA_CHECK_VERSION(0,30,0) - { GST_VAAPI_ENTRYPOINT_SLICE_ENCODE, VAEntrypointEncSlice }, + { GST_VAAPI_ENTRYPOINT_SLICE_ENCODE, VAEntrypointEncSlice }, + { GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE, VAEntrypointEncPicture }, #endif { 0, } }; diff --git a/gst-libs/gst/vaapi/gstvaapiprofile.h b/gst-libs/gst/vaapi/gstvaapiprofile.h index 24dde8988a..5a0e7679a2 100644 --- a/gst-libs/gst/vaapi/gstvaapiprofile.h +++ b/gst-libs/gst/vaapi/gstvaapiprofile.h @@ -161,6 +161,7 @@ typedef enum { * @GST_VAAPI_ENTRYPOINT_IDCT: Inverse Decrete Cosine Transform * @GST_VAAPI_ENTRYPOINT_MOCO: Motion Compensation * @GST_VAAPI_ENTRYPOINT_SLICE_ENCODE: Encode Slice + * @GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE: Encode Picture * * The set of all entrypoints for #GstVaapiEntrypoint */ @@ -168,7 +169,8 @@ typedef enum { GST_VAAPI_ENTRYPOINT_VLD = 1, GST_VAAPI_ENTRYPOINT_IDCT, GST_VAAPI_ENTRYPOINT_MOCO, - GST_VAAPI_ENTRYPOINT_SLICE_ENCODE + GST_VAAPI_ENTRYPOINT_SLICE_ENCODE, + GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE } GstVaapiEntrypoint; const gchar *