Skip to content

Commit

Permalink
[host] pipewire: update capture interface functions
Browse files Browse the repository at this point in the history
  • Loading branch information
VMFortress committed Feb 12, 2024
1 parent b131398 commit acb8824
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions host/platform/Linux/capture/pipewire/src/pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ static const char * pipewire_getName(void)
return "PipeWire";
}

static bool pipewire_create(CaptureGetPointerBuffer getPointerBufferFn, CapturePostPointerBuffer postPointerBufferFn)
static bool pipewire_create(
CaptureGetPointerBuffer getPointerBufferFn,
CapturePostPointerBuffer postPointerBufferFn,
unsigned frameBuffers)
{
DEBUG_ASSERT(!this);
pw_init(NULL, NULL);
Expand Down Expand Up @@ -231,7 +234,7 @@ static const struct pw_stream_events streamEvents = {
.param_changed = streamParamChangedCallback,
};

static bool pipewire_init(void)
static bool pipewire_init(void * ivshmemBase, unsigned * alignSize)
{
DEBUG_ASSERT(this);
this->stop = false;
Expand Down Expand Up @@ -400,7 +403,8 @@ static void pipewire_free(void)
this = NULL;
}

static CaptureResult pipewire_capture(void)
static CaptureResult pipewire_capture(
unsigned frameBufferIndex, FrameBuffer * frameBuffer)
{
int result;

Expand All @@ -424,8 +428,8 @@ static CaptureResult pipewire_capture(void)
return CAPTURE_RESULT_OK;
}

static CaptureResult pipewire_waitFrame(CaptureFrame * frame,
const size_t maxFrameSize)
static CaptureResult pipewire_waitFrame(unsigned frameBufferIndex,
CaptureFrame * frame, const size_t maxFrameSize)
{
if (this->stop)
return CAPTURE_RESULT_REINIT;
Expand Down Expand Up @@ -454,12 +458,13 @@ static CaptureResult pipewire_waitFrame(CaptureFrame * frame,
return CAPTURE_RESULT_OK;
}

static CaptureResult pipewire_getFrame(FrameBuffer * frame, int frameIndex)
static CaptureResult pipewire_getFrame(unsigned frameBufferIndex,
FrameBuffer * frameBuffer, const size_t maxFrameSize)
{
if (this->stop || !this->frameData)
return CAPTURE_RESULT_REINIT;

framebuffer_write(frame, this->frameData,
framebuffer_write(frameBuffer, this->frameData,
this->dataHeight * this->pitch);

pw_thread_loop_accept(this->threadLoop);
Expand Down

0 comments on commit acb8824

Please sign in to comment.