avutil/hwcontext_amf: add device cache size
This change improves pipeline stability and reduces dynamic GPU surface allocations when using AMF with copy_frame = 1. This optimization has no negative effect.
This commit is contained in:
parent
0cc46f1f59
commit
cd33219558
1 changed files with 3 additions and 1 deletions
|
|
@ -496,8 +496,10 @@ static int amf_device_create(AVHWDeviceContext *device_ctx,
|
|||
|
||||
|
||||
ret = ctx->factory->pVtbl->CreateContext(ctx->factory, &ctx->context);
|
||||
if (ret == AMF_OK)
|
||||
if (ret == AMF_OK) {
|
||||
AMF_ASSIGN_PROPERTY_INT64(ret, ctx->context, L"DeviceSurfaceCacheSize", 50 );
|
||||
return 0;
|
||||
}
|
||||
av_log(device_ctx, AV_LOG_ERROR, "CreateContext() failed with error %d.\n", ret);
|
||||
}
|
||||
amf_device_uninit(device_ctx);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue