Skip to content

Commit

Permalink
screenshare: destroy bo on pwStreamRemoveBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Nov 20, 2023
1 parent 8d3538e commit 716da5e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/portals/Screencopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,9 @@ static void pwStreamRemoveBuffer(void* data, pw_buffer* buffer) {
if (PSTREAM->currentPWBuffer == PBUFFER)
PSTREAM->currentPWBuffer = nullptr;

if (PBUFFER->isDMABUF)
gbm_bo_destroy(PBUFFER->bo);

wl_buffer_destroy(PBUFFER->wlBuffer);
for (int plane = 0; plane < PBUFFER->planeCount; plane++) {
close(PBUFFER->fd[plane]);
Expand Down Expand Up @@ -1075,7 +1078,7 @@ uint32_t CPipewireConnection::buildFormatsFor(spa_pod_builder* b[2], const spa_p

paramCount = 2;
params[0] = build_format(b[0], pwFromDrmFourcc(stream->pSession->sharingData.frameInfoDMA.fmt), stream->pSession->sharingData.frameInfoDMA.w,
stream->pSession->sharingData.frameInfoDMA.h, stream->pSession->sharingData.framerate, modifiers, modCount);
stream->pSession->sharingData.frameInfoDMA.h, stream->pSession->sharingData.framerate, modifiers, modCount);
assert(params[0] != NULL);
params[1] = build_format(b[1], pwFromDrmFourcc(stream->pSession->sharingData.frameInfoSHM.fmt), stream->pSession->sharingData.frameInfoSHM.w,
stream->pSession->sharingData.frameInfoSHM.h, stream->pSession->sharingData.framerate, NULL, 0);
Expand All @@ -1085,7 +1088,7 @@ uint32_t CPipewireConnection::buildFormatsFor(spa_pod_builder* b[2], const spa_p

paramCount = 1;
params[0] = build_format(b[0], pwFromDrmFourcc(stream->pSession->sharingData.frameInfoSHM.fmt), stream->pSession->sharingData.frameInfoSHM.w,
stream->pSession->sharingData.frameInfoSHM.h, stream->pSession->sharingData.framerate, NULL, 0);
stream->pSession->sharingData.frameInfoSHM.h, stream->pSession->sharingData.framerate, NULL, 0);
}

if (modifiers)
Expand Down

0 comments on commit 716da5e

Please sign in to comment.