Add start decoder
This commit is contained in:
14
hw/device.c
14
hw/device.c
@ -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;
|
||||
|
@ -28,6 +28,7 @@ int device_open_buffer_list_capture(device_t *dev, struct buffer_list_s *output_
|
||||
int device_consume_event(device_t *device);
|
||||
|
||||
int device_set_stream(device_t *dev, bool do_on);
|
||||
int device_set_decoder_start(device_t *dev, bool do_on);
|
||||
int device_video_force_key(device_t *dev);
|
||||
int device_set_pad_format(device_t *device, unsigned width, unsigned height, unsigned format);
|
||||
int device_set_option(device_t *dev, const char *name, uint32_t id, int32_t value);
|
||||
|
Reference in New Issue
Block a user