Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Support set/get_framerate



details:   https://anonhg.NetBSD.org/src/rev/dacec2510df5
branches:  trunk
changeset: 933208:dacec2510df5
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri May 22 11:24:31 2020 +0000

description:
Support set/get_framerate

diffstat:

 sys/dev/usb/pseye.c |  25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diffs (60 lines):

diff -r 52dba0f98ee5 -r dacec2510df5 sys/dev/usb/pseye.c
--- a/sys/dev/usb/pseye.c       Fri May 22 11:23:51 2020 +0000
+++ b/sys/dev/usb/pseye.c       Fri May 22 11:24:31 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pseye.c,v 1.27 2020/03/14 02:35:33 christos Exp $ */
+/* $NetBSD: pseye.c,v 1.28 2020/05/22 11:24:31 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2008 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pseye.c,v 1.27 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pseye.c,v 1.28 2020/05/22 11:24:31 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -134,6 +134,8 @@
 static int             pseye_get_format(void *, struct video_format *);
 static int             pseye_set_format(void *, struct video_format *);
 static int             pseye_try_format(void *, struct video_format *);
+static int             pseye_get_framerate(void *, struct video_fract *);
+static int             pseye_set_framerate(void *, struct video_fract *);
 static int             pseye_start_transfer(void *);
 static int             pseye_stop_transfer(void *);
 
@@ -150,6 +152,8 @@
        .get_format = pseye_get_format,
        .set_format = pseye_set_format,
        .try_format = pseye_try_format,
+       .get_framerate = pseye_get_framerate,
+       .set_framerate = pseye_set_framerate,
        .start_transfer = pseye_start_transfer,
        .stop_transfer = pseye_stop_transfer,
        .control_iter_init = NULL,
@@ -803,6 +807,23 @@
 }
 
 static int
+pseye_get_framerate(void *opaque, struct video_fract *fract)
+{
+       /* Driver only supports 60fps */
+       fract->numerator = 1;
+       fract->denominator = 60;
+
+       return 0;
+}
+
+static int
+pseye_set_framerate(void *opaque, struct video_fract *fract)
+{
+       /* Driver only supports one framerate. Return actual rate. */
+       return pseye_get_framerate(opaque, fract);
+}
+
+static int
 pseye_start_transfer(void *opaque)
 {
        struct pseye_softc *sc = opaque;



Home | Main Index | Thread Index | Old Index