Add start decoder

This commit is contained in:
Kamil Trzcinski
2022-04-06 16:02:47 +02:00
parent 899204916f
commit 6d3f992034
3 changed files with 20 additions and 2 deletions

View File

@ -166,6 +166,20 @@ int device_set_stream(device_t *dev, bool do_on)
return 0;
}
int device_set_decoder_start(device_t *dev, bool do_on)
{
struct v4l2_decoder_cmd cmd = {0};
cmd.cmd = do_on ? V4L2_DEC_CMD_START : V4L2_DEC_CMD_STOP;
E_LOG_DEBUG(dev, "Setting decoder state %s...", do_on ? "Start" : "Stop");
E_XIOCTL(dev, dev->fd, VIDIOC_DECODER_CMD, &cmd, "Cannot set decoder state");
return 0;
error:
return -1;
}
int device_consume_event(device_t *dev)
{
struct v4l2_event event;