diff options
-rw-r--r-- | drivers/media/video/v4l2-ioctl.c | 67 | ||||
-rw-r--r-- | include/media/v4l2-ioctl.h | 6 |
2 files changed, 73 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 0e648cb3b399..213c4dd6f72c 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c | |||
@@ -1747,6 +1747,73 @@ static int __video_do_ioctl(struct file *file, | |||
1747 | ret = ops->vidioc_s_hw_freq_seek(file, fh, p); | 1747 | ret = ops->vidioc_s_hw_freq_seek(file, fh, p); |
1748 | break; | 1748 | break; |
1749 | } | 1749 | } |
1750 | case VIDIOC_ENUM_FRAMESIZES: | ||
1751 | { | ||
1752 | struct v4l2_frmsizeenum *p = arg; | ||
1753 | |||
1754 | if (!ops->vidioc_enum_framesizes) | ||
1755 | break; | ||
1756 | |||
1757 | memset(p, 0, sizeof(*p)); | ||
1758 | |||
1759 | ret = ops->vidioc_enum_framesizes(file, fh, p); | ||
1760 | dbgarg(cmd, | ||
1761 | "index=%d, pixelformat=%d, type=%d ", | ||
1762 | p->index, p->pixel_format, p->type); | ||
1763 | switch (p->type) { | ||
1764 | case V4L2_FRMSIZE_TYPE_DISCRETE: | ||
1765 | dbgarg2("width = %d, height=%d\n", | ||
1766 | p->discrete.width, p->discrete.height); | ||
1767 | break; | ||
1768 | case V4L2_FRMSIZE_TYPE_STEPWISE: | ||
1769 | dbgarg2("min %dx%d, max %dx%d, step %dx%d\n", | ||
1770 | p->stepwise.min_width, p->stepwise.min_height, | ||
1771 | p->stepwise.step_width, p->stepwise.step_height, | ||
1772 | p->stepwise.max_width, p->stepwise.max_height); | ||
1773 | break; | ||
1774 | case V4L2_FRMSIZE_TYPE_CONTINUOUS: | ||
1775 | dbgarg2("continuous\n"); | ||
1776 | break; | ||
1777 | default: | ||
1778 | dbgarg2("- Unknown type!\n"); | ||
1779 | } | ||
1780 | |||
1781 | break; | ||
1782 | } | ||
1783 | case VIDIOC_ENUM_FRAMEINTERVALS: | ||
1784 | { | ||
1785 | struct v4l2_frmivalenum *p = arg; | ||
1786 | |||
1787 | if (!ops->vidioc_enum_frameintervals) | ||
1788 | break; | ||
1789 | |||
1790 | memset(p, 0, sizeof(*p)); | ||
1791 | |||
1792 | ret = ops->vidioc_enum_frameintervals(file, fh, p); | ||
1793 | dbgarg(cmd, | ||
1794 | "index=%d, pixelformat=%d, width=%d, height=%d, type=%d ", | ||
1795 | p->index, p->pixel_format, | ||
1796 | p->width, p->height, p->type); | ||
1797 | switch (p->type) { | ||
1798 | case V4L2_FRMIVAL_TYPE_DISCRETE: | ||
1799 | dbgarg2("fps=%d/%d\n", | ||
1800 | p->discrete.numerator, | ||
1801 | p->discrete.denominator); | ||
1802 | break; | ||
1803 | case V4L2_FRMIVAL_TYPE_STEPWISE: | ||
1804 | dbgarg2("min=%d, max=%d, step=%d\n", | ||
1805 | p->stepwise.min, p->stepwise.max, | ||
1806 | p->stepwise.step); | ||
1807 | break; | ||
1808 | case V4L2_FRMIVAL_TYPE_CONTINUOUS: | ||
1809 | dbgarg2("continuous\n"); | ||
1810 | break; | ||
1811 | default: | ||
1812 | dbgarg2("- Unknown type!\n"); | ||
1813 | } | ||
1814 | break; | ||
1815 | } | ||
1816 | |||
1750 | default: | 1817 | default: |
1751 | { | 1818 | { |
1752 | if (!ops->vidioc_default) | 1819 | if (!ops->vidioc_default) |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index f5985724c456..c884432f9383 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
@@ -232,6 +232,12 @@ struct v4l2_ioctl_ops { | |||
232 | int (*vidioc_g_chip_ident) (struct file *file, void *fh, | 232 | int (*vidioc_g_chip_ident) (struct file *file, void *fh, |
233 | struct v4l2_chip_ident *chip); | 233 | struct v4l2_chip_ident *chip); |
234 | 234 | ||
235 | int (*vidioc_enum_framesizes) (struct file *file, void *fh, | ||
236 | struct v4l2_frmsizeenum *fsize); | ||
237 | |||
238 | int (*vidioc_enum_frameintervals) (struct file *file, void *fh, | ||
239 | struct v4l2_frmivalenum *fival); | ||
240 | |||
235 | /* For other private ioctls */ | 241 | /* For other private ioctls */ |
236 | int (*vidioc_default) (struct file *file, void *fh, | 242 | int (*vidioc_default) (struct file *file, void *fh, |
237 | int cmd, void *arg); | 243 | int cmd, void *arg); |