@@ -60,6 +60,7 @@ struct videoout *vo_init(const char *devname,
struct v4l2_format fmt;
struct videoout *vo;
int ret;
+ int rotation = 90; /* rotate for testing purposes */
/* Allocate the video output object. */
vo = malloc(sizeof *vo);
@@ -76,6 +77,14 @@ struct videoout *vo_init(const char *devname,
goto error;
}
+ /* setup the rotation here, we have to do it BEFORE
+ * setting the format. */
+ ret = v4l2_set_control(vo->dev, V4L2_CID_ROTATE, &rotation);
+ if (ret < 0){
+ perror("Failed to setup rotation\n");
+ goto error;
+ }
+
pixfmt.pixelformat = format->pixelformat;
pixfmt.width = format->width;
pixfmt.height = format->height;