data: clean up fd and data management

Do not send the offset and size in the add_mem call, just send the
fd and the flags. The area that we need to map from this to find the
meta, chunk and data are sent in a separate call. This should make
it possible to truncate the memory to a larger size to dynamically
allocate more shared memory for a client.
Remove the Id data type, it's not needed.
Don't automatically map memory in remote.c
Pass the original memory type from server to client.
Handle DmaBuf mem in video-play now that the server passed it on.
This commit is contained in:
Wim Taymans 2017-12-01 09:34:53 +01:00
parent 541553be1c
commit 08814bd808
7 changed files with 100 additions and 119 deletions

View file

@ -111,7 +111,8 @@ on_stream_new_buffer(void *_data, uint32_t id)
buf = pw_stream_peek_buffer(stream, id);
if (buf->datas[0].type == data->type.data.MemFd) {
if (buf->datas[0].type == data->type.data.MemFd ||
buf->datas[0].type == data->type.data.DmaBuf) {
map = mmap(NULL, buf->datas[0].maxsize + buf->datas[0].mapoffset, PROT_READ,
MAP_PRIVATE, buf->datas[0].fd, 0);
sdata = SPA_MEMBER(map, buf->datas[0].mapoffset, uint8_t);