Open gang929 opened 1 year ago
When the app gets captured surface could you please check values of the surface->GetPlane(0)->GetOffsetX(), GetOffsety(), GetWidth(), GetHeight()?
get the captured surface: width, height
m_pDisplayCapture->QueryOutput(&data);
amf::AMFSurfacePtr pSurfPtr(data);
LOG("capture surface: %d %d %dx%d",
pSurfPtr->GetPlane(amf::AMF_PLANE_UNKNOWN)->GetOffsetX(),
pSurfPtr->GetPlane(amf::AMF_PLANE_UNKNOWN)->GetOffsetY(),
pSurfPtr->GetPlane(amf::AMF_PLANE_UNKNOWN)->GetWidth(),
pSurfPtr->GetPlane(amf::AMF_PLANE_UNKNOWN)->GetHeight());
log: capture surface: 0 0 1600x900
It seams that it only can be get the RESOLUTION by surface property? Have any way to get the captured RESOLUTION after m_pDisplayCapture->Init() and before m_pDisplayCapture->QueryOutput(&data) to call m_pEncoder->Init() ?
I understand the issue. We will need to fix AMF_DISPLAYCAPTURE_RESOLUTION. It will come with driver update.
so good
Few things to explain:
When using AMFDisplayCapture to capture screen with two monitor, can not only capture the first or second monitor, it always capture all monitor together.
xrandr output
OS: Ubuntu 22.04.1 5.15.0-46 Display Adapter: AMD RX 470 Amd Driver: amdgpu-install_22.20.50200-1_all.deb
init code
How to only capture the first monitor or second monitor, and get the RESOLUTION or DESKTOP_RECT to
DisplayPort-1 1600x900