diff options
-rw-r--r-- | drivers/media/v4l2-core/v4l2-mem2mem.c | 29 | ||||
-rw-r--r-- | include/media/v4l2-mem2mem.h | 4 |
2 files changed, 33 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c index 3392833d9541..498044a0cb4e 100644 --- a/drivers/media/v4l2-core/v4l2-mem2mem.c +++ b/drivers/media/v4l2-core/v4l2-mem2mem.c | |||
@@ -1122,6 +1122,35 @@ int v4l2_m2m_ioctl_streamoff(struct file *file, void *priv, | |||
1122 | } | 1122 | } |
1123 | EXPORT_SYMBOL_GPL(v4l2_m2m_ioctl_streamoff); | 1123 | EXPORT_SYMBOL_GPL(v4l2_m2m_ioctl_streamoff); |
1124 | 1124 | ||
1125 | int v4l2_m2m_ioctl_try_encoder_cmd(struct file *file, void *fh, | ||
1126 | struct v4l2_encoder_cmd *ec) | ||
1127 | { | ||
1128 | if (ec->cmd != V4L2_ENC_CMD_STOP && ec->cmd != V4L2_ENC_CMD_START) | ||
1129 | return -EINVAL; | ||
1130 | |||
1131 | ec->flags = 0; | ||
1132 | return 0; | ||
1133 | } | ||
1134 | EXPORT_SYMBOL_GPL(v4l2_m2m_ioctl_try_encoder_cmd); | ||
1135 | |||
1136 | int v4l2_m2m_ioctl_try_decoder_cmd(struct file *file, void *fh, | ||
1137 | struct v4l2_decoder_cmd *dc) | ||
1138 | { | ||
1139 | if (dc->cmd != V4L2_DEC_CMD_STOP && dc->cmd != V4L2_DEC_CMD_START) | ||
1140 | return -EINVAL; | ||
1141 | |||
1142 | dc->flags = 0; | ||
1143 | |||
1144 | if (dc->cmd == V4L2_DEC_CMD_STOP) { | ||
1145 | dc->stop.pts = 0; | ||
1146 | } else if (dc->cmd == V4L2_DEC_CMD_START) { | ||
1147 | dc->start.speed = 0; | ||
1148 | dc->start.format = V4L2_DEC_START_FMT_NONE; | ||
1149 | } | ||
1150 | return 0; | ||
1151 | } | ||
1152 | EXPORT_SYMBOL_GPL(v4l2_m2m_ioctl_try_decoder_cmd); | ||
1153 | |||
1125 | /* | 1154 | /* |
1126 | * v4l2_file_operations helpers. It is assumed here same lock is used | 1155 | * v4l2_file_operations helpers. It is assumed here same lock is used |
1127 | * for the output and the capture buffer queue. | 1156 | * for the output and the capture buffer queue. |
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h index bb3e63d6bd1a..2e0c989266a7 100644 --- a/include/media/v4l2-mem2mem.h +++ b/include/media/v4l2-mem2mem.h | |||
@@ -672,6 +672,10 @@ int v4l2_m2m_ioctl_streamon(struct file *file, void *fh, | |||
672 | enum v4l2_buf_type type); | 672 | enum v4l2_buf_type type); |
673 | int v4l2_m2m_ioctl_streamoff(struct file *file, void *fh, | 673 | int v4l2_m2m_ioctl_streamoff(struct file *file, void *fh, |
674 | enum v4l2_buf_type type); | 674 | enum v4l2_buf_type type); |
675 | int v4l2_m2m_ioctl_try_encoder_cmd(struct file *file, void *fh, | ||
676 | struct v4l2_encoder_cmd *ec); | ||
677 | int v4l2_m2m_ioctl_try_decoder_cmd(struct file *file, void *fh, | ||
678 | struct v4l2_decoder_cmd *dc); | ||
675 | int v4l2_m2m_fop_mmap(struct file *file, struct vm_area_struct *vma); | 679 | int v4l2_m2m_fop_mmap(struct file *file, struct vm_area_struct *vma); |
676 | __poll_t v4l2_m2m_fop_poll(struct file *file, poll_table *wait); | 680 | __poll_t v4l2_m2m_fop_poll(struct file *file, poll_table *wait); |
677 | 681 | ||