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)
commit9a66215a0f025697feff7b23b38bd81099ab2264 (patch)
tree6dfc04ba6962b77c5a94eab041117308b14dba2c /console
parent0232cfd283801fe5bc7af5e4d29a70a429dc3421 (diff)
v3.87
Diffstat (limited to 'console')
-rw-r--r--console/fbtv.c5
-rw-r--r--console/record.c24
-rw-r--r--console/showqt.c32
-rw-r--r--console/showriff.c15
-rw-r--r--console/v4l-info.c17
5 files changed, 53 insertions, 40 deletions
diff --git a/console/fbtv.c b/console/fbtv.c
index 9697219..58a89ae 100644
--- a/console/fbtv.c
+++ b/console/fbtv.c
@@ -705,10 +705,7 @@ main(int argc, char *argv[])
parse_config();
channel_menu();
- do_va_cmd(2,"setfreqtab",(-1 != chantab)
- ? chanlist_names[chantab].str : "europe-west");
- cur_capture = 0;
- do_va_cmd(2,"capture","overlay");
+ init_overlay();
if (optind+1 == argc) {
do_va_cmd(2,"setstation",argv[optind]);
} else {
diff --git a/console/record.c b/console/record.c
index 4bc43dd..c42c49b 100644
--- a/console/record.c
+++ b/console/record.c
@@ -8,6 +8,7 @@
#include <errno.h>
#include <curses.h>
#include <signal.h>
+#include <inttypes.h>
#include <sys/time.h>
#include <sys/signal.h>
#include <sys/ioctl.h>
@@ -40,8 +41,9 @@ tty_restore(void)
/* -------------------------------------------------------------------- */
static int sound_fd;
+static int sound_rcount;
static unsigned int sound_blksize;
-static short *sound_buffer;
+static int16_t *sound_buffer;
static int maxl,maxr;
static int secl,secr;
static int *histl,*histr,histn,histi;
@@ -128,7 +130,7 @@ sound_read(void)
{
unsigned int have;
int i,rc;
- short *v;
+ int16_t *v;
/* read */
for (have = 0;have < sound_blksize;) {
@@ -174,6 +176,7 @@ sound_read(void)
if (secr < histr[i])
secr = histr[i];
}
+ sound_rcount++;
return 0;
}
@@ -253,10 +256,10 @@ mixer_set_volume(int val)
/* Copyright (C) by Heiko Eissfeldt */
-typedef unsigned char BYTE;
-typedef unsigned short WORD;
-typedef unsigned long DWORD;
-typedef unsigned long FOURCC; /* a four character code */
+typedef uint8_t BYTE;
+typedef uint16_t WORD;
+typedef uint32_t DWORD;
+typedef uint32_t FOURCC; /* a four character code */
/* flags for 'wFormatTag' field of WAVEFORMAT */
#define WAVE_FORMAT_PCM 1
@@ -390,6 +393,10 @@ static char blank[] =
" "
" ";
+static char alive[] = "-\\|/";
+//static char alive[] = ".oOo";
+#define ALIVE(count) alive[count % (sizeof(alive)/sizeof(alive[0])-1)]
+
static void
print_bar(int line, char *name, int val1, int val2, int max)
{
@@ -697,7 +704,7 @@ main(int argc, char *argv[])
mvprintw(3,0,"%s: %3d:%02d (%s) ",outfile,
sec/60,sec%60,str_mb(wav_size));
} else {
- mvprintw(3,0,"");
+ mvprintw(3,0,"%c",ALIVE(sound_rcount));
}
}
@@ -778,7 +785,8 @@ main(int argc, char *argv[])
}
}
if (!record) {
- printf("waiting for signal [%d/%d]... \r",maxl,maxr);
+ printf("waiting for signal %c [%d/%d]... \r",
+ ALIVE(sound_rcount), maxl,maxr);
fflush(stdout);
continue;
}
diff --git a/console/showqt.c b/console/showqt.c
index 51dfc94..4221e81 100644
--- a/console/showqt.c
+++ b/console/showqt.c
@@ -17,22 +17,22 @@
#endif
#if BYTE_ORDER == LITTLE_ENDIAN
-# define SWAP2(x) (((x>>8) & 0x00ff) |\
- ((x<<8) & 0xff00))
-
-# define SWAP4(x) (((x>>24) & 0x000000ff) |\
- ((x>>8) & 0x0000ff00) |\
- ((x<<8) & 0x00ff0000) |\
- ((x<<24) & 0xff000000))
-
-# define SWAP8(x) (((x>>56) & 0x00000000000000ff) |\
- ((x>>40) & 0x000000000000ff00) |\
- ((x>>24) & 0x0000000000ff0000) |\
- ((x>> 8) & 0x00000000ff000000) |\
- ((x<< 8) & 0x000000ff00000000) |\
- ((x<<24) & 0x0000ff0000000000) |\
- ((x<<40) & 0x00ff000000000000) |\
- ((x<<56) & 0xff00000000000000))
+# define SWAP2(x) ((((uint16_t)x>>8) & (uint16_t)0x00ff) |\
+ (((uint16_t)x<<8) & (uint16_t)0xff00))
+
+# define SWAP4(x) ((((uint32_t)x>>24) & (uint32_t)0x000000ff) |\
+ (((uint32_t)x>>8) & (uint32_t)0x0000ff00) |\
+ (((uint32_t)x<<8) & (uint32_t)0x00ff0000) |\
+ (((uint32_t)x<<24) & (uint32_t)0xff000000))
+
+# define SWAP8(x) ((((uint64_t)x>>56) & (uint64_t)0x00000000000000ff) |\
+ (((uint64_t)x>>40) & (uint64_t)0x000000000000ff00) |\
+ (((uint64_t)x>>24) & (uint64_t)0x0000000000ff0000) |\
+ (((uint64_t)x>> 8) & (uint64_t)0x00000000ff000000) |\
+ (((uint64_t)x<< 8) & (uint64_t)0x000000ff00000000) |\
+ (((uint64_t)x<<24) & (uint64_t)0x0000ff0000000000) |\
+ (((uint64_t)x<<40) & (uint64_t)0x00ff000000000000) |\
+ (((uint64_t)x<<56) & (uint64_t)0xff00000000000000))
#else
# define SWAP2(a) (a)
# define SWAP4(a) (a)
diff --git a/console/showriff.c b/console/showriff.c
index c884e4d..aa9d093 100644
--- a/console/showriff.c
+++ b/console/showriff.c
@@ -20,6 +20,7 @@
#include <unistd.h>
#include <ctype.h>
#include <errno.h>
+#include <inttypes.h>
#include <sys/types.h>
#if BYTE_ORDER == BIG_ENDIAN
@@ -42,10 +43,10 @@
# define fseeko fseek
#endif
-typedef unsigned long DWORD;
-typedef unsigned short WORD;
+typedef uint32_t DWORD;
+typedef uint16_t WORD;
typedef DWORD FOURCC; /* Type of FOUR Character Codes */
-typedef unsigned char boolean;
+typedef uint8_t boolean;
#define TRUE 1
#define FALSE 0
#define BUFSIZE 4096
@@ -203,13 +204,13 @@ static void dump_vals(FILE *f, int count, struct VAL *names)
case INT32:
fread(&val32,4,1,f);
val32 = SWAP4(val32);
- printf("\t%-12s = %ld\n",names[i].name,val32);
+ printf("\t%-12s = %d\n",names[i].name,val32);
break;
case CCODE:
fread(&val32,4,1,f);
val32 = SWAP4(val32);
if (val32) {
- printf("\t%-12s = %c%c%c%c (0x%lx)\n",names[i].name,
+ printf("\t%-12s = %c%c%c%c (0x%x)\n",names[i].name,
(int)( val32 & 0xff),
(int)((val32 >> 8) & 0xff),
(int)((val32 >> 16) & 0xff),
@@ -222,7 +223,7 @@ static void dump_vals(FILE *f, int count, struct VAL *names)
case FLAGS:
fread(&val32,4,1,f);
val32 = SWAP4(val32);
- printf("\t%-12s = 0x%lx\n",names[i].name,val32);
+ printf("\t%-12s = 0x%x\n",names[i].name,val32);
if (names[i].flags) {
for (j = 0; names[i].flags[j].bit != 0; j++)
if (names[i].flags[j].bit & val32)
@@ -406,7 +407,7 @@ static boolean ProcessChunk(FILE* f, size_t filepos, size_t filesize,
datapos=filepos+sizeof(FOURCC)+sizeof(DWORD); /* here is the data */
/* print out header: */
- printf("(0x%s) %*c ID:<%s> Size: 0x%08lx\n",
+ printf("(0x%s) %*c ID:<%s> Size: 0x%08x\n",
off_t_to_char(filepos,16,8),(RekDepth+1)*4,' ',tagstr,*chunksize);
if (datapos + ((*chunksize+1)&~1) > filesize) { /* too long? */
diff --git a/console/v4l-info.c b/console/v4l-info.c
index 38659cf..8e5155d 100644
--- a/console/v4l-info.c
+++ b/console/v4l-info.c
@@ -267,7 +267,7 @@ int main(int argc, char *argv[])
{
char dummy[256];
char *device = "/dev/video0";
- int tab = 1;
+ int tab = 1, ok = 0;
int fd;
if (argc > 1)
@@ -280,13 +280,20 @@ int main(int argc, char *argv[])
};
if (-1 != ioctl(fd,VIDIOC_QUERYCAP,dummy)) {
- printf("### v4l2 device info [%s] ###\n",device);
+ printf("\n### v4l2 device info [%s] ###\n",device);
dump_v4l2(fd,tab);
- } else if (-1 != ioctl(fd,VIDIOCGCAP,dummy)) {
- printf("### video4linux device info [%s] ###\n",device);
+ ok = 1;
+ }
+
+ if (-1 != ioctl(fd,VIDIOCGCAP,dummy)) {
+ printf("\n### video4linux device info [%s] ###\n",device);
dump_v4l(fd,tab);
- } else {
+ ok = 1;
+ }
+
+ if (!ok) {
fprintf(stderr,"%s: not an video4linux device\n",device);
+ exit(1);
}
return 0;
}

Privacy Policy