aboutsummaryrefslogtreecommitdiffstats
path: root/console
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-04-01 09:24:40 (GMT)
committerGerd Hoffmann <kraxel@redhat.com>2010-04-01 09:24:40 (GMT)
commit602289d4a5303d666ae9eda87fb12c0ea0225c13 (patch)
tree740f7fc52aabd71795c5cbfbdea3f654288514ac /console
parent884f30aead9ef2272ee8646164590670f8bff365 (diff)
v3.81
Diffstat (limited to 'console')
-rw-r--r--console/fbtools.c26
-rw-r--r--console/fbtv.c3
-rw-r--r--console/radio.c2
-rw-r--r--console/scantv.c1
-rw-r--r--console/ttv.c4
-rw-r--r--console/v4l-conf.c1
-rw-r--r--console/webcam.c8
7 files changed, 37 insertions, 8 deletions
diff --git a/console/fbtools.c b/console/fbtools.c
index bc13a1f..b7473f0 100644
--- a/console/fbtools.c
+++ b/console/fbtools.c
@@ -299,6 +299,27 @@ fb_setvt(int vtno)
}
}
+/* Hmm. radeonfb needs this. matroxfb doesn't. */
+static int fb_activate_current(int tty)
+{
+ struct vt_stat vts;
+
+ if (-1 == ioctl(tty,VT_GETSTATE, &vts)) {
+ perror("ioctl VT_GETSTATE");
+ return -1;
+ } else {
+ if (-1 == ioctl(tty,VT_ACTIVATE, vts.v_active)) {
+ perror("ioctl VT_ACTIVATE");
+ return -1;
+ }
+ if (-1 == ioctl(tty,VT_WAITACTIVE, vts.v_active)) {
+ perror("ioctl VT_WAITACTIVE");
+ return -1;
+ }
+ }
+ return 0;
+}
+
int fb_probe(void)
{
struct fb_con2fbmap c2m;
@@ -453,6 +474,7 @@ fb_init(char *device, char *mode, int vt)
perror("ioctl KDSETMODE");
goto err;
}
+ fb_activate_current(tty);
/* cls */
fb_memset(fb_mem+fb_mem_offset,0,fb_fix.smem_len);
@@ -482,8 +504,10 @@ fb_cleanup(void)
perror("ioctl KDSETMODE");
if (-1 == ioctl(tty,VT_SETMODE, &vt_omode))
perror("ioctl VT_SETMODE");
- if (orig_vt_no && -1 == ioctl(tty,VT_ACTIVATE, orig_vt_no))
+ if (orig_vt_no && -1 == ioctl(tty, VT_ACTIVATE, orig_vt_no))
perror("ioctl VT_ACTIVATE");
+ if (orig_vt_no && -1 == ioctl(tty, VT_WAITACTIVE, orig_vt_no))
+ perror("ioctl VT_WAITACTIVE");
tcsetattr(tty, TCSANOW, &term);
close(tty);
}
diff --git a/console/fbtv.c b/console/fbtv.c
index 49d998b..aa57b46 100644
--- a/console/fbtv.c
+++ b/console/fbtv.c
@@ -704,7 +704,8 @@ main(int argc, char *argv[])
parse_config();
channel_menu();
- do_va_cmd(2,"setfreqtab",chanlist_names[chantab].str);
+ do_va_cmd(2,"setfreqtab",(-1 != chantab)
+ ? chanlist_names[chantab].str : "europe-west");
cur_capture = 0;
do_va_cmd(2,"capture","overlay");
if (optind+1 == argc) {
diff --git a/console/radio.c b/console/radio.c
index 1a66605..010b4a4 100644
--- a/console/radio.c
+++ b/console/radio.c
@@ -27,7 +27,7 @@
#include <sys/time.h>
#include <sys/ioctl.h>
-#include <linux/videodev.h>
+#include "videodev.h"
/* JMMV: WINDOWS for radio */
int ncurses = 0;
diff --git a/console/scantv.c b/console/scantv.c
index 9447eef..d1e0cf1 100644
--- a/console/scantv.c
+++ b/console/scantv.c
@@ -194,6 +194,7 @@ main(int argc, char **argv)
attr_init();
audio_init();
+ freq_init();
/* ask the user some questions ... */
attr = ng_attr_byid(attrs,ATTR_ID_NORM);
diff --git a/console/ttv.c b/console/ttv.c
index e9ae5af..5f0133c 100644
--- a/console/ttv.c
+++ b/console/ttv.c
@@ -232,8 +232,8 @@ main(int argc, char **argv)
/* build channel list */
parse_config();
-
- do_va_cmd(2,"setfreqtab",chanlist_names[chantab].str);
+ do_va_cmd(2,"setfreqtab",(-1 != chantab)
+ ? chanlist_names[chantab].str : "europe-west");
cur_capture = 0;
do_va_cmd(2,"capture","grabdisplay");
if (optind+1 == argc) {
diff --git a/console/v4l-conf.c b/console/v4l-conf.c
index c99abf8..9d0139f 100644
--- a/console/v4l-conf.c
+++ b/console/v4l-conf.c
@@ -17,6 +17,7 @@
#include <errno.h>
#include <fcntl.h>
#include <time.h>
+#include <sys/time.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
diff --git a/console/webcam.c b/console/webcam.c
index d261d12..535709a 100644
--- a/console/webcam.c
+++ b/console/webcam.c
@@ -48,7 +48,7 @@ int grab_bottom = -1;
int grab_right = -1;
int grab_quality= 75;
int grab_trigger= 0;
-int grab_once = 0;
+int grab_times = -1;
int grab_fg_r = 255;
int grab_fg_g = 255;
int grab_fg_b = 255;
@@ -686,7 +686,9 @@ main(int argc, char *argv[])
if (-1 != (i = cfg_get_int("grab","trigger")))
grab_trigger = i;
if (-1 != (i = cfg_get_int("grab","once")))
- grab_once = i;
+ grab_times = 1;
+ if (-1 != (i = cfg_get_int("grab","times")))
+ grab_times = i;
if (NULL != (val = cfg_get_str("grab","archive")))
archive = val;
@@ -882,7 +884,7 @@ main(int argc, char *argv[])
write_file(fh, image, width, height);
}
- if (grab_once)
+ if (-1 != grab_times && --grab_times == 0)
break;
if (grab_delay > 0)
sleep(grab_delay);

Privacy Policy