This change improves pipeline stability and reduces dynamic GPU surface allocations when using AMF with copy_frame = 1. This optimization has no negative effect.
Unified · Split
| @@ -496,8 +496,10 @@ static int amf_device_create(AVHWDeviceContext *device_ctx, · 495 unmodified lines | |||
| 496 | 496 | ||
| 497 | 497 | ||
| 498 | ret = ctx->factory->pVtbl->CreateContext(ctx->factory, &ctx->context); | 498 | ret = ctx->factory->pVtbl->CreateContext(ctx->factory, &ctx->context); |
| 499 | if (ret == AMF_OK) | 499 | if (ret == AMF_OK) { |
| 500 | AMF_ASSIGN_PROPERTY_INT64(ret, ctx->context, L"DeviceSurfaceCacheSize", 50 ); | ||
| 500 | return 0; | 501 | return 0; |
| 502 | } | ||
| 501 | av_log(device_ctx, AV_LOG_ERROR, "CreateContext() failed with error %d.\n", ret); | 503 | av_log(device_ctx, AV_LOG_ERROR, "CreateContext() failed with error %d.\n", ret); |
| 502 | } | 504 | } |
| 503 | amf_device_uninit(device_ctx); | 505 | amf_device_uninit(device_ctx); |