fix va write raw buffer
This commit is contained in:
parent
d4761aaf9e
commit
e7d59d0e5e
1 changed files with 9 additions and 1 deletions
10
kmsvnc.c
10
kmsvnc.c
|
@ -320,8 +320,16 @@ int main(int argc, char **argv)
|
||||||
int size = kmsvnc->drm->mfb->offsets[i] + kmsvnc->drm->mfb->height * kmsvnc->drm->mfb->pitches[i];
|
int size = kmsvnc->drm->mfb->offsets[i] + kmsvnc->drm->mfb->height * kmsvnc->drm->mfb->pitches[i];
|
||||||
if (size > max_size) max_size = size;
|
if (size > max_size) max_size = size;
|
||||||
}
|
}
|
||||||
|
printf("attempt to write %d bytes\n", max_size);
|
||||||
if (wfd > 0) {
|
if (wfd > 0) {
|
||||||
if (kmsvnc->va) va_hwframe_to_vaapi(kmsvnc->drm->mapped);
|
if (kmsvnc->va) {
|
||||||
|
if (!kmsvnc->drm->mapped) kmsvnc->drm->mapped = malloc(max_size);
|
||||||
|
if (!kmsvnc->drm->mapped) {
|
||||||
|
cleanup();
|
||||||
|
KMSVNC_FATAL("memory allocation error at %s:%d\n", __FILE__, __LINE__);
|
||||||
|
}
|
||||||
|
va_hwframe_to_vaapi(kmsvnc->drm->mapped);
|
||||||
|
}
|
||||||
KMSVNC_WRITE_MAY(wfd, kmsvnc->drm->mapped, (ssize_t)max_size);
|
KMSVNC_WRITE_MAY(wfd, kmsvnc->drm->mapped, (ssize_t)max_size);
|
||||||
fsync(wfd);
|
fsync(wfd);
|
||||||
printf("wrote raw frame buffer to %s\n", kmsvnc->debug_capture_fb);
|
printf("wrote raw frame buffer to %s\n", kmsvnc->debug_capture_fb);
|
||||||
|
|
Loading…
Reference in a new issue