mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 10:25:33 +00:00
build: fix for older versions of VA-API (< 0.34.0).
Fix build with older versions of VA-API (< 0.34.0), or versions without good enough headers for encoding support for instance.
This commit is contained in:
parent
b545c6fcbc
commit
614aa4ac95
2 changed files with 15 additions and 1 deletions
|
@ -152,7 +152,6 @@ context_create (GstVaapiContext * context)
|
||||||
{
|
{
|
||||||
const GstVaapiContextInfo *const cip = &context->info;
|
const GstVaapiContextInfo *const cip = &context->info;
|
||||||
GstVaapiDisplay *const display = GST_VAAPI_OBJECT_DISPLAY (context);
|
GstVaapiDisplay *const display = GST_VAAPI_OBJECT_DISPLAY (context);
|
||||||
guint va_rate_control;
|
|
||||||
VAConfigAttrib attribs[3], *attrib = attribs;
|
VAConfigAttrib attribs[3], *attrib = attribs;
|
||||||
VAContextID context_id;
|
VAContextID context_id;
|
||||||
VASurfaceID surface_id;
|
VASurfaceID surface_id;
|
||||||
|
@ -196,9 +195,11 @@ context_create (GstVaapiContext * context)
|
||||||
attrib++;
|
attrib++;
|
||||||
|
|
||||||
switch (cip->usage) {
|
switch (cip->usage) {
|
||||||
|
#if USE_ENCODERS
|
||||||
case GST_VAAPI_CONTEXT_USAGE_ENCODE:
|
case GST_VAAPI_CONTEXT_USAGE_ENCODE:
|
||||||
{
|
{
|
||||||
const GstVaapiConfigInfoEncoder *const config = &cip->config.encoder;
|
const GstVaapiConfigInfoEncoder *const config = &cip->config.encoder;
|
||||||
|
guint va_rate_control;
|
||||||
|
|
||||||
/* Rate control */
|
/* Rate control */
|
||||||
attrib->type = VAConfigAttribRateControl;
|
attrib->type = VAConfigAttribRateControl;
|
||||||
|
@ -230,6 +231,7 @@ context_create (GstVaapiContext * context)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,16 +214,20 @@ string_of_VARateControl (guint rate_control)
|
||||||
switch (rate_control) {
|
switch (rate_control) {
|
||||||
case VA_RC_NONE:
|
case VA_RC_NONE:
|
||||||
return "None";
|
return "None";
|
||||||
|
#ifdef VA_RC_CQP
|
||||||
case VA_RC_CQP:
|
case VA_RC_CQP:
|
||||||
return "CQP";
|
return "CQP";
|
||||||
|
#endif
|
||||||
case VA_RC_CBR:
|
case VA_RC_CBR:
|
||||||
return "CBR";
|
return "CBR";
|
||||||
case VA_RC_VCM:
|
case VA_RC_VCM:
|
||||||
return "VCM";
|
return "VCM";
|
||||||
case VA_RC_VBR:
|
case VA_RC_VBR:
|
||||||
return "VBR";
|
return "VBR";
|
||||||
|
#ifdef VA_RC_VBR_CONSTRAINED
|
||||||
case VA_RC_VBR_CONSTRAINED:
|
case VA_RC_VBR_CONSTRAINED:
|
||||||
return "VBR-Constrained";
|
return "VBR-Constrained";
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -492,16 +496,20 @@ from_GstVaapiRateControl (guint value)
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case GST_VAAPI_RATECONTROL_NONE:
|
case GST_VAAPI_RATECONTROL_NONE:
|
||||||
return VA_RC_NONE;
|
return VA_RC_NONE;
|
||||||
|
#ifdef VA_RC_CQP
|
||||||
case GST_VAAPI_RATECONTROL_CQP:
|
case GST_VAAPI_RATECONTROL_CQP:
|
||||||
return VA_RC_CQP;
|
return VA_RC_CQP;
|
||||||
|
#endif
|
||||||
case GST_VAAPI_RATECONTROL_CBR:
|
case GST_VAAPI_RATECONTROL_CBR:
|
||||||
return VA_RC_CBR;
|
return VA_RC_CBR;
|
||||||
case GST_VAAPI_RATECONTROL_VCM:
|
case GST_VAAPI_RATECONTROL_VCM:
|
||||||
return VA_RC_VCM;
|
return VA_RC_VCM;
|
||||||
case GST_VAAPI_RATECONTROL_VBR:
|
case GST_VAAPI_RATECONTROL_VBR:
|
||||||
return VA_RC_VBR;
|
return VA_RC_VBR;
|
||||||
|
#ifdef VA_RC_VBR_CONSTRAINED
|
||||||
case GST_VAAPI_RATECONTROL_VBR_CONSTRAINED:
|
case GST_VAAPI_RATECONTROL_VBR_CONSTRAINED:
|
||||||
return VA_RC_VBR_CONSTRAINED;
|
return VA_RC_VBR_CONSTRAINED;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
GST_ERROR ("unsupported GstVaapiRateControl value %u", value);
|
GST_ERROR ("unsupported GstVaapiRateControl value %u", value);
|
||||||
return VA_RC_NONE;
|
return VA_RC_NONE;
|
||||||
|
@ -513,16 +521,20 @@ to_GstVaapiRateControl (guint value)
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case VA_RC_NONE:
|
case VA_RC_NONE:
|
||||||
return GST_VAAPI_RATECONTROL_NONE;
|
return GST_VAAPI_RATECONTROL_NONE;
|
||||||
|
#ifdef VA_RC_CQP
|
||||||
case VA_RC_CQP:
|
case VA_RC_CQP:
|
||||||
return GST_VAAPI_RATECONTROL_CQP;
|
return GST_VAAPI_RATECONTROL_CQP;
|
||||||
|
#endif
|
||||||
case VA_RC_CBR:
|
case VA_RC_CBR:
|
||||||
return GST_VAAPI_RATECONTROL_CBR;
|
return GST_VAAPI_RATECONTROL_CBR;
|
||||||
case VA_RC_VCM:
|
case VA_RC_VCM:
|
||||||
return GST_VAAPI_RATECONTROL_VCM;
|
return GST_VAAPI_RATECONTROL_VCM;
|
||||||
case VA_RC_VBR:
|
case VA_RC_VBR:
|
||||||
return GST_VAAPI_RATECONTROL_VBR;
|
return GST_VAAPI_RATECONTROL_VBR;
|
||||||
|
#ifdef VA_RC_VBR_CONSTRAINED
|
||||||
case VA_RC_VBR_CONSTRAINED:
|
case VA_RC_VBR_CONSTRAINED:
|
||||||
return GST_VAAPI_RATECONTROL_VBR_CONSTRAINED;
|
return GST_VAAPI_RATECONTROL_VBR_CONSTRAINED;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
GST_ERROR ("unsupported VA-API Rate Control value %u", value);
|
GST_ERROR ("unsupported VA-API Rate Control value %u", value);
|
||||||
return GST_VAAPI_RATECONTROL_NONE;
|
return GST_VAAPI_RATECONTROL_NONE;
|
||||||
|
|
Loading…
Reference in a new issue