Skip to content
Snippets Groups Projects
Commit 2c17a1c8 authored by Ezequiel Garcia's avatar Ezequiel Garcia
Browse files

h264: Apply offset for proper CAPTURE mmap


There's an offset that applies to CAPTURE queue,
and apparently is obtained via QUERYBUF. Instead
of doing the QUERYBUF dance, just apply the offset.

Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
parent 55a76bd7
Branches
Tags v5.13-rc2
No related merge requests found
...@@ -660,18 +660,24 @@ static int h264e_assemble_bitstream(struct rk_venc *ictx, int fd, ...@@ -660,18 +660,24 @@ static int h264e_assemble_bitstream(struct rk_venc *ictx, int fd,
return -1; return -1;
if (buffer->m.planes[0].bytesused + ctx->stream_header_size > if (buffer->m.planes[0].bytesused + ctx->stream_header_size >
buffer->m.planes[0].length) buffer->m.planes[0].length) {
fprintf(stderr, "Not enough space for H264 header\n");
return -1; return -1;
}
buffer->length = 1; buffer->length = 1;
#define DST_QUEUE_OFF_BASE (1 << 30)
buf = mmap(NULL, buffer->m.planes[0].length, buf = mmap(NULL, buffer->m.planes[0].length,
PROT_READ | PROT_WRITE, PROT_READ | PROT_WRITE,
MAP_SHARED, fd, MAP_SHARED, fd,
buffer->m.planes[0].m.mem_offset); buffer->m.planes[0].m.mem_offset + DST_QUEUE_OFF_BASE);
if (buf == MAP_FAILED) if (buf == MAP_FAILED) {
fprintf(stderr, "mmap failure! mem_offset %x\n",
buffer->m.planes[0].m.mem_offset + DST_QUEUE_OFF_BASE);
return -1; return -1;
}
memmove((uint8_t *)buf + ctx->stream_header_size, buf, memmove((uint8_t *)buf + ctx->stream_header_size, buf,
buffer->m.planes[0].bytesused); buffer->m.planes[0].bytesused);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment