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

Use querybuf ioctl to remove the offset hack

parent 263170a2
Branches
Tags
No related merge requests found
...@@ -435,6 +435,9 @@ static int ioctl_dqbuf_locked(struct encoder_context *ctx, int fd, ...@@ -435,6 +435,9 @@ static int ioctl_dqbuf_locked(struct encoder_context *ctx, int fd,
if (ret) if (ret)
return ret; return ret;
ret = SYS_IOCTL(fd, VIDIOC_QUERYBUF, buffer);
if (ret)
return ret;
/* Get the encoder configuration and update the library. /* Get the encoder configuration and update the library.
* Because we dequeue a null frame to indicate flush is finished, do not * Because we dequeue a null frame to indicate flush is finished, do not
* update the config with this frame. */ * update the config with this frame. */
......
...@@ -667,15 +667,14 @@ static int h264e_assemble_bitstream(struct rk_venc *ictx, int fd, ...@@ -667,15 +667,14 @@ static int h264e_assemble_bitstream(struct rk_venc *ictx, int fd,
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 + DST_QUEUE_OFF_BASE); buffer->m.planes[0].m.mem_offset);
if (buf == MAP_FAILED) { if (buf == MAP_FAILED) {
fprintf(stderr, "mmap failure! mem_offset %x\n", fprintf(stderr, "mmap failure! mem_offset %x\n",
buffer->m.planes[0].m.mem_offset + DST_QUEUE_OFF_BASE); buffer->m.planes[0].m.mem_offset);
return -1; return -1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment