mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-22 22:35:59 +01:00
screencast: pipewire move buffer information from pwr_on_event to pwr_handle_stream_add_buffer
This commit is contained in:
parent
03146fa1d7
commit
6a3832277f
1 changed files with 12 additions and 9 deletions
|
@ -85,15 +85,6 @@ static void pwr_on_event(void *data, uint64_t expirations) {
|
||||||
h->dts_offset = 0;
|
h->dts_offset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
d[0].type = SPA_DATA_MemPtr;
|
|
||||||
d[0].maxsize = cast->simple_frame.size;
|
|
||||||
d[0].mapoffset = 0;
|
|
||||||
d[0].chunk->size = cast->simple_frame.size;
|
|
||||||
d[0].chunk->stride = cast->simple_frame.stride;
|
|
||||||
d[0].chunk->offset = 0;
|
|
||||||
d[0].flags = 0;
|
|
||||||
d[0].fd = -1;
|
|
||||||
|
|
||||||
writeFrameData(d[0].data, cast->simple_frame.data, cast->simple_frame.height,
|
writeFrameData(d[0].data, cast->simple_frame.data, cast->simple_frame.height,
|
||||||
cast->simple_frame.stride, cast->simple_frame.y_invert);
|
cast->simple_frame.stride, cast->simple_frame.y_invert);
|
||||||
|
|
||||||
|
@ -178,6 +169,18 @@ static void pwr_handle_stream_add_buffer(void *data, struct pw_buffer *buffer) {
|
||||||
} else {
|
} else {
|
||||||
logprint(ERROR, "pipewire: unsupported buffer type");
|
logprint(ERROR, "pipewire: unsupported buffer type");
|
||||||
cast->err = 1;
|
cast->err = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prepare buffer for choosen type
|
||||||
|
if (d[0].type == SPA_DATA_MemPtr) {
|
||||||
|
d[0].maxsize = cast->simple_frame.size;
|
||||||
|
d[0].mapoffset = 0;
|
||||||
|
d[0].chunk->size = cast->simple_frame.size;
|
||||||
|
d[0].chunk->stride = cast->simple_frame.stride;
|
||||||
|
d[0].chunk->offset = 0;
|
||||||
|
d[0].flags = 0;
|
||||||
|
d[0].fd = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue