aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-04-01 09:24:39 (GMT)
committerGerd Hoffmann <kraxel@redhat.com>2010-04-01 09:24:39 (GMT)
commit505fcccd2590694505959f179af73721cd112571 (patch)
tree90bfc3ad05423722283e17eff27fbb5c1f213f2f
parent4717c404e22922a13f54e431fbf683309870513f (diff)
v3.79
-rw-r--r--Changes13
-rw-r--r--Makefile.in9
-rw-r--r--common/channel.c15
-rw-r--r--common/channel.h1
-rw-r--r--common/commands.c6
-rw-r--r--common/frequencies.c1421
-rw-r--r--common/frequencies.h27
-rw-r--r--common/parseconfig.c8
-rw-r--r--common/vbi-data.c11
-rw-r--r--common/vbi-data.h8
-rwxr-xr-xconfigure27
-rw-r--r--configure.ac22
-rw-r--r--console/Subdir.mk9
-rw-r--r--console/fbtv.c1
-rw-r--r--console/showqt.c4
-rw-r--r--console/ttv.c1
-rw-r--r--console/v4l-info.c296
-rw-r--r--debian/changelog6
-rw-r--r--debian/xawtv-plugins.files1
-rw-r--r--debug/Subdir.mk9
-rw-r--r--debug/hwscan.c145
-rw-r--r--frequencies/Index.map51
-rw-r--r--frequencies/Subdir.mk9
-rw-r--r--frequencies/argentina.list279
-rw-r--r--frequencies/ccir-h.list63
-rw-r--r--frequencies/ccir-i-iii.list42
-rw-r--r--frequencies/ccir-sl-sh.list60
-rw-r--r--frequencies/europe-east.list6
-rw-r--r--frequencies/europe-west.list4
-rw-r--r--frequencies/init.pl64
-rw-r--r--frequencies/ntsc-bcast-jp.list186
-rw-r--r--frequencies/ntsc-bcast.list246
-rw-r--r--frequencies/ntsc-cable-ca.list372
-rw-r--r--frequencies/ntsc-cable-jp.list153
-rw-r--r--frequencies/ntsc-cable.list399
-rw-r--r--frequencies/ntsc-hrc.list399
-rw-r--r--frequencies/oirt-i-iii.list36
-rw-r--r--frequencies/oirt-sl-sh.list51
-rw-r--r--frequencies/pal-australia-optus.list144
-rw-r--r--frequencies/pal-australia.list159
-rw-r--r--frequencies/pal-bcast-cn.list282
-rw-r--r--frequencies/pal-bcast-za.list40
-rw-r--r--frequencies/pal-ireland.list112
-rw-r--r--frequencies/pal-italy.list31
-rw-r--r--frequencies/pal-newzealand.list34
-rw-r--r--frequencies/secam-france.list136
-rw-r--r--frequencies/uhf.list147
-rw-r--r--libng/contrib-plugins/Subdir.mk23
-rw-r--r--libng/contrib-plugins/bilinear.c89
-rw-r--r--libng/contrib-plugins/cubic.c126
-rw-r--r--libng/contrib-plugins/linear-blend.c166
-rw-r--r--libng/contrib-plugins/linedoubler.c84
-rw-r--r--libng/grab-ng.c3
-rw-r--r--libng/grab-ng.h2
-rw-r--r--libng/plugins/Subdir.mk27
-rw-r--r--libng/plugins/drv0-v4l2.c287
-rw-r--r--libng/plugins/drv1-v4l.c114
-rw-r--r--libng/plugins/read-avi.c2
-rw-r--r--libng/plugins/read-dv.c8
-rw-r--r--libng/plugins/read-qt.c2
-rw-r--r--libng/plugins/snd-oss.c4
-rw-r--r--libng/videodev2.h2
-rw-r--r--man/xawtvrc.54
-rw-r--r--structs/Makefile2
-rw-r--r--structs/README12
-rw-r--r--structs/ioctl2desc16
-rw-r--r--structs/struct-dump.c247
-rw-r--r--structs/struct-dump.h55
-rw-r--r--structs/struct-v4l.c441
-rw-r--r--structs/struct-v4l.h20
-rw-r--r--structs/struct-v4l2.c1031
-rw-r--r--structs/struct-v4l2.h50
-rw-r--r--structs/struct2desc87
-rw-r--r--structs/x188
-rw-r--r--x11/MoTV-de1
-rw-r--r--x11/MoTV-default1
-rw-r--r--x11/MoTV-fixed1
-rw-r--r--x11/MoTV-fr1
-rw-r--r--x11/MoTV-it1
-rw-r--r--x11/motv.c81
-rw-r--r--x11/rootv.c3
-rw-r--r--x11/v4lctl.c1
-rw-r--r--x11/videodev2-new.h862
-rw-r--r--x11/xawtv.c6
-rw-r--r--xawtv.spec2
85 files changed, 6826 insertions, 2771 deletions
diff --git a/Changes b/Changes
index 5ff8520..9c5fbff 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,17 @@
+3.78 => 3.79
+============
+
+ * More v4l2 fixes.
+ * Some infrastructure for dumping structs. Used that for
+ completely rewritten debug output of the video4linux plugins.
+ There is also a new utility called "v4l-info" which uses this.
+ * moved frequency tables into config files instead of having them
+ compiled-in
+ * added "group = " tag to channels. motv builds submenus per group
+ using this.
+
+
3.77 => 3.78
============
diff --git a/Makefile.in b/Makefile.in
index 608ee0f..e096ccf 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -11,6 +11,7 @@ exec_prefix := @exec_prefix@
bindir := $(DESTDIR)@bindir@
mandir := $(DESTDIR)@mandir@
libdir := $(DESTDIR)@libdir@/xawtv
+datadir := $(DESTDIR)@datadir@/xawtv
resdir := $(DESTDIR)@resdir@
config := @x11conf@/xawtvrc
@@ -31,7 +32,8 @@ LFS_FLAGS := -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
X11_FLAGS := @X_CFLAGS@ -I/usr/X11R6/include/X11/fonts
LIB_FLAGS := -I. -I./vbistuff -I./x11 \
-I$(srcdir)/jwz -I$(srcdir)/common -I$(srcdir)/console \
- -I$(srcdir)/x11 -I$(srcdir)/libng -Llibng
+ -I$(srcdir)/x11 -I$(srcdir)/structs \
+ -I$(srcdir)/libng -Llibng
# various libraries
ATHENA_LIBS := @X_LIBS@ @LIBS@ @ATHENA@
@@ -60,6 +62,7 @@ FOUND_MOTIF := @FOUND_MOTIF@
FOUND_OS := @FOUND_OS@
FOUND_X11 := @FOUND_X11@
FOUND_ZVBI := @FOUND_ZVBI@
+USE_MMX := @USE_MMX@
# build final cflags
CFLAGS := @CFLAGS@
@@ -69,6 +72,7 @@ CFLAGS += $(X11_FLAGS)
CFLAGS += $(LIB_FLAGS)
CFLAGS += -DCONFIGFILE='"$(config)"'
CFLAGS += -DLIBDIR='"$(libdir)"'
+CFLAGS += -DDATADIR='"$(datadir)"'
CFLAGS += -DVERSION='"$(VERSION)"'
CXXFLAGS = $(CFLAGS)
@@ -123,7 +127,7 @@ compile_cc = $(CXX) $(CXXFLAGS) -Wp,-MD,$(tmpdep) -c -o $@ $<
fixup_deps = sed -e "s|.*\.o:|$@::|" < $(tmpdep) > $(depfile) && rm -f $(tmpdep)
link_app = $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
-link_so = $(CC) $(LDFLAGS) -shared -Wl,-soname,$@ -o $@ $< $(LDLIBS)
+link_so = $(CC) $(LDFLAGS) -shared -Wl,-soname,$(@F) -o $@ $^ $(LDLIBS)
ar_lib = rm -f $@ && ar -r $@ $^ && ranlib $@
# non-verbose output
@@ -183,6 +187,7 @@ include $(srcdir)/common/Subdir.mk
# subdirs
include $(srcdir)/console/Subdir.mk
include $(srcdir)/debug/Subdir.mk
+include $(srcdir)/frequencies/Subdir.mk
include $(srcdir)/libng/Subdir.mk
include $(srcdir)/libng/plugins/Subdir.mk
include $(srcdir)/libng/contrib-plugins/Subdir.mk
diff --git a/common/channel.c b/common/channel.c
index 1b89c17..3472937 100644
--- a/common/channel.c
+++ b/common/channel.c
@@ -53,6 +53,7 @@
struct CHANNEL defaults = {
name: "defaults",
+ group: "main",
capture: CAPTURE_ON,
channel: -1,
audio: -1,
@@ -362,6 +363,8 @@ init_channel(char *name, struct CHANNEL *c)
if (NULL != (val = cfg_get_str(name,"key")))
c->key = strdup(val);
+ if (NULL != (val = cfg_get_str(name,"group")))
+ c->group = strdup(val);
if (NULL != (val = cfg_get_str(name,"midi")))
c->midi = atoi(val);
@@ -390,7 +393,8 @@ read_config(char *conffile, int *argc, char **argv)
if (0 == cfg_parse_file(conffile))
have_config = 1;
} else {
- sprintf(filename,"%s/%s",getenv("HOME"),".xawtv");
+ sprintf(filename,"%.*s/%s",(int)sizeof(filename)-8,
+ getenv("HOME"),".xawtv");
if (0 == cfg_parse_file(CONFIGFILE))
have_config = 1;
if (0 == cfg_parse_file(filename))
@@ -417,9 +421,7 @@ read_config(char *conffile, int *argc, char **argv)
if (0 == strcasecmp(val,chanlists[i].name))
break;
if (chanlists[i].name != NULL) {
- chantab = i;
- chanlist = chanlists[chantab].list;
- chancount = chanlists[chantab].count;
+ freq_newtab(i);
} else
fprintf(stderr,"invalid value for freqtab: %s\n",val);
}
@@ -624,6 +626,8 @@ save_config()
/* write defaults */
fprintf(fp,"[defaults]\n");
+ fprintf(fp,"group = %s\n",defaults.group);
+
fprintf(fp,"norm = %s\n",
ng_attr_getstr(ng_attr_byid(attrs,ATTR_ID_NORM),
cur_attrs[ATTR_ID_NORM]));
@@ -669,8 +673,11 @@ save_config()
fprintf(fp,"input = %s\n",
ng_attr_getstr(ng_attr_byid(attrs,ATTR_ID_INPUT),
channels[i]->input));
+
if (channels[i]->key != NULL)
fprintf(fp,"key = %s\n",channels[i]->key);
+ if (0 != strcmp(channels[i]->group,defaults.group))
+ fprintf(fp,"group = %s\n",defaults.group);
if (channels[i]->midi != 0)
fprintf(fp,"midi = %d\n",channels[i]->midi);
if (channels[i]->capture != cur_capture)
diff --git a/common/channel.h b/common/channel.h
index 4dfabe7..4d92893 100644
--- a/common/channel.h
+++ b/common/channel.h
@@ -11,6 +11,7 @@
struct CHANNEL {
char *name;
char *key;
+ char *group;
int midi;
char *cname; /* name of the channel */
diff --git a/common/commands.c b/common/commands.c
index 66a3a95..ab4df5e 100644
--- a/common/commands.c
+++ b/common/commands.c
@@ -335,10 +335,8 @@ set_volume(void)
static void
set_freqtab(int j)
{
- chantab = j;
- chanlist = chanlists[chantab].list;
- chancount = chanlists[chantab].count;
-
+ freq_newtab(j);
+
/* cur_channel might be invalid (>chancount) right now */
cur_channel = -1;
/* this is valid for (struct CHANNEL*)->channel too */
diff --git a/common/frequencies.c b/common/frequencies.c
index 553275b..25f1a72 100644
--- a/common/frequencies.c
+++ b/common/frequencies.c
@@ -1,1308 +1,141 @@
+#include <stdio.h>
#include <stdlib.h>
-#include <sys/time.h>
+#include <unistd.h>
+#include <string.h>
#include <pthread.h>
+#include <errno.h>
+#include <sys/time.h>
-#include "frequencies.h"
#include "grab-ng.h"
+#include "commands.h"
+#include "frequencies.h"
/* --------------------------------------------------------------------- */
-/* US broadcast */
-static struct CHANLIST ntsc_bcast[] = {
- { "2", 55250 },
- { "3", 61250 },
- { "4", 67250 },
- { "5", 77250 },
- { "6", 83250 },
- { "7", 175250 },
- { "8", 181250 },
- { "9", 187250 },
- { "10", 193250 },
- { "11", 199250 },
- { "12", 205250 },
- { "13", 211250 },
- { "14", 471250 },
- { "15", 477250 },
- { "16", 483250 },
- { "17", 489250 },
- { "18", 495250 },
- { "19", 501250 },
- { "20", 507250 },
- { "21", 513250 },
- { "22", 519250 },
- { "23", 525250 },
- { "24", 531250 },
- { "25", 537250 },
- { "26", 543250 },
- { "27", 549250 },
- { "28", 555250 },
- { "29", 561250 },
- { "30", 567250 },
- { "31", 573250 },
- { "32", 579250 },
- { "33", 585250 },
- { "34", 591250 },
- { "35", 597250 },
- { "36", 603250 },
- { "37", 609250 },
- { "38", 615250 },
- { "39", 621250 },
- { "40", 627250 },
- { "41", 633250 },
- { "42", 639250 },
- { "43", 645250 },
- { "44", 651250 },
- { "45", 657250 },
- { "46", 663250 },
- { "47", 669250 },
- { "48", 675250 },
- { "49", 681250 },
- { "50", 687250 },
- { "51", 693250 },
- { "52", 699250 },
- { "53", 705250 },
- { "54", 711250 },
- { "55", 717250 },
- { "56", 723250 },
- { "57", 729250 },
- { "58", 735250 },
- { "59", 741250 },
- { "60", 747250 },
- { "61", 753250 },
- { "62", 759250 },
- { "63", 765250 },
- { "64", 771250 },
- { "65", 777250 },
- { "66", 783250 },
- { "67", 789250 },
- { "68", 795250 },
- { "69", 801250 },
-
- { "70", 807250 },
- { "71", 813250 },
- { "72", 819250 },
- { "73", 825250 },
- { "74", 831250 },
- { "75", 837250 },
- { "76", 843250 },
- { "77", 849250 },
- { "78", 855250 },
- { "79", 861250 },
- { "80", 867250 },
- { "81", 873250 },
- { "82", 879250 },
- { "83", 885250 },
-};
-
-/* US cable */
-static struct CHANLIST ntsc_cable[] = {
- { "1", 73250 },
- { "2", 55250 },
- { "3", 61250 },
- { "4", 67250 },
- { "5", 77250 },
- { "6", 83250 },
- { "7", 175250 },
- { "8", 181250 },
- { "9", 187250 },
- { "10", 193250 },
- { "11", 199250 },
- { "12", 205250 },
-
- { "13", 211250 },
- { "14", 121250 },
- { "15", 127250 },
- { "16", 133250 },
- { "17", 139250 },
- { "18", 145250 },
- { "19", 151250 },
- { "20", 157250 },
-
- { "21", 163250 },
- { "22", 169250 },
- { "23", 217250 },
- { "24", 223250 },
- { "25", 229250 },
- { "26", 235250 },
- { "27", 241250 },
- { "28", 247250 },
- { "29", 253250 },
- { "30", 259250 },
- { "31", 265250 },
- { "32", 271250 },
- { "33", 277250 },
- { "34", 283250 },
- { "35", 289250 },
- { "36", 295250 },
- { "37", 301250 },
- { "38", 307250 },
- { "39", 313250 },
- { "40", 319250 },
- { "41", 325250 },
- { "42", 331250 },
- { "43", 337250 },
- { "44", 343250 },
- { "45", 349250 },
- { "46", 355250 },
- { "47", 361250 },
- { "48", 367250 },
- { "49", 373250 },
- { "50", 379250 },
- { "51", 385250 },
- { "52", 391250 },
- { "53", 397250 },
- { "54", 403250 },
- { "55", 409250 },
- { "56", 415250 },
- { "57", 421250 },
- { "58", 427250 },
- { "59", 433250 },
- { "60", 439250 },
- { "61", 445250 },
- { "62", 451250 },
- { "63", 457250 },
- { "64", 463250 },
- { "65", 469250 },
- { "66", 475250 },
- { "67", 481250 },
- { "68", 487250 },
- { "69", 493250 },
-
- { "70", 499250 },
- { "71", 505250 },
- { "72", 511250 },
- { "73", 517250 },
- { "74", 523250 },
- { "75", 529250 },
- { "76", 535250 },
- { "77", 541250 },
- { "78", 547250 },
- { "79", 553250 },
- { "80", 559250 },
- { "81", 565250 },
- { "82", 571250 },
- { "83", 577250 },
- { "84", 583250 },
- { "85", 589250 },
- { "86", 595250 },
- { "87", 601250 },
- { "88", 607250 },
- { "89", 613250 },
- { "90", 619250 },
- { "91", 625250 },
- { "92", 631250 },
- { "93", 637250 },
- { "94", 643250 },
- { "95", 91250 },
- { "96", 97250 },
- { "97", 103250 },
- { "98", 109250 },
- { "99", 115250 },
- { "100", 649250 },
- { "101", 655250 },
- { "102", 661250 },
- { "103", 667250 },
- { "104", 673250 },
- { "105", 679250 },
- { "106", 685250 },
- { "107", 691250 },
- { "108", 697250 },
- { "109", 703250 },
- { "110", 709250 },
- { "111", 715250 },
- { "112", 721250 },
- { "113", 727250 },
- { "114", 733250 },
- { "115", 739250 },
- { "116", 745250 },
- { "117", 751250 },
- { "118", 757250 },
- { "119", 763250 },
- { "120", 769250 },
- { "121", 775250 },
- { "122", 781250 },
- { "123", 787250 },
- { "124", 793250 },
- { "125", 799250 },
-
- { "T7", 8250 },
- { "T8", 14250 },
- { "T9", 20250 },
- { "T10", 26250 },
- { "T11", 32250 },
- { "T12", 38250 },
- { "T13", 44250 },
- { "T14", 50250 }
-};
-
-/* US HRC */
-static struct CHANLIST ntsc_hrc[] = {
- { "1", 72000 },
- { "2", 54000 },
- { "3", 60000 },
- { "4", 66000 },
- { "5", 78000 },
- { "6", 84000 },
- { "7", 174000 },
- { "8", 180000 },
- { "9", 186000 },
- { "10", 192000 },
- { "11", 198000 },
- { "12", 204000 },
-
- { "13", 210000 },
- { "14", 120000 },
- { "15", 126000 },
- { "16", 132000 },
- { "17", 138000 },
- { "18", 144000 },
- { "19", 150000 },
- { "20", 156000 },
-
- { "21", 162000 },
- { "22", 168000 },
- { "23", 216000 },
- { "24", 222000 },
- { "25", 228000 },
- { "26", 234000 },
- { "27", 240000 },
- { "28", 246000 },
- { "29", 252000 },
- { "30", 258000 },
- { "31", 264000 },
- { "32", 270000 },
- { "33", 276000 },
- { "34", 282000 },
- { "35", 288000 },
- { "36", 294000 },
- { "37", 300000 },
- { "38", 306000 },
- { "39", 312000 },
- { "40", 318000 },
- { "41", 324000 },
- { "42", 330000 },
- { "43", 336000 },
- { "44", 342000 },
- { "45", 348000 },
- { "46", 354000 },
- { "47", 360000 },
- { "48", 366000 },
- { "49", 372000 },
- { "50", 378000 },
- { "51", 384000 },
- { "52", 390000 },
- { "53", 396000 },
- { "54", 402000 },
- { "55", 408000 },
- { "56", 414000 },
- { "57", 420000 },
- { "58", 426000 },
- { "59", 432000 },
- { "60", 438000 },
- { "61", 444000 },
- { "62", 450000 },
- { "63", 456000 },
- { "64", 462000 },
- { "65", 468000 },
- { "66", 474000 },
- { "67", 480000 },
- { "68", 486000 },
- { "69", 492000 },
-
- { "70", 498000 },
- { "71", 504000 },
- { "72", 510000 },
- { "73", 516000 },
- { "74", 522000 },
- { "75", 528000 },
- { "76", 534000 },
- { "77", 540000 },
- { "78", 546000 },
- { "79", 552000 },
- { "80", 558000 },
- { "81", 564000 },
- { "82", 570000 },
- { "83", 576000 },
- { "84", 582000 },
- { "85", 588000 },
- { "86", 594000 },
- { "87", 600000 },
- { "88", 606000 },
- { "89", 612000 },
- { "90", 618000 },
- { "91", 624000 },
- { "92", 630000 },
- { "93", 636000 },
- { "94", 642000 },
- { "95", 900000 },
- { "96", 960000 },
- { "97", 102000 },
- { "98", 108000 },
- { "99", 114000 },
- { "100", 648000 },
- { "101", 654000 },
- { "102", 660000 },
- { "103", 666000 },
- { "104", 672000 },
- { "105", 678000 },
- { "106", 684000 },
- { "107", 690000 },
- { "108", 696000 },
- { "109", 702000 },
- { "110", 708000 },
- { "111", 714000 },
- { "112", 720000 },
- { "113", 726000 },
- { "114", 732000 },
- { "115", 738000 },
- { "116", 744000 },
- { "117", 750000 },
- { "118", 756000 },
- { "119", 762000 },
- { "120", 768000 },
- { "121", 774000 },
- { "122", 780000 },
- { "123", 786000 },
- { "124", 792000 },
- { "125", 798000 },
-
- { "T7", 7000 },
- { "T8", 13000 },
- { "T9", 19000 },
- { "T10", 25000 },
- { "T11", 31000 },
- { "T12", 37000 },
- { "T13", 43000 },
- { "T14", 49000 },
-};
-
-/* --------------------------------------------------------------------- */
-
-/* Canada cable */
-static struct CHANLIST ntsc_cable_ca[] = {
- { "2", 61750 },
- { "3", 67750 },
- { "4", 73750 },
- { "5", 83750 },
- { "6", 89750 },
- { "7", 181750 },
- { "8", 187750 },
- { "9", 193750 },
- { "10", 199750 },
- { "11", 205750 },
- { "12", 211750 },
-
- { "13", 217750 },
- { "14", 127750 },
- { "15", 133750 },
- { "16", 139750 },
- { "17", 145750 },
- { "18", 151750 },
- { "19", 157750 },
- { "20", 163750 },
-
- { "21", 169750 },
- { "22", 175750 },
- { "23", 223750 },
- { "24", 229750 },
- { "25", 235750 },
- { "26", 241750 },
- { "27", 247750 },
- { "28", 253750 },
- { "29", 259750 },
- { "30", 265750 },
- { "31", 271750 },
- { "32", 277750 },
- { "33", 283750 },
- { "34", 289750 },
- { "35", 295750 },
- { "36", 301750 },
- { "37", 307750 },
- { "38", 313750 },
- { "39", 319750 },
- { "40", 325750 },
- { "41", 331750 },
- { "42", 337750 },
- { "43", 343750 },
- { "44", 349750 },
- { "45", 355750 },
- { "46", 361750 },
- { "47", 367750 },
- { "48", 373750 },
- { "49", 379750 },
- { "50", 385750 },
- { "51", 391750 },
- { "52", 397750 },
- { "53", 403750 },
- { "54", 409750 },
- { "55", 415750 },
- { "56", 421750 },
- { "57", 427750 },
- { "58", 433750 },
- { "59", 439750 },
- { "60", 445750 },
- { "61", 451750 },
- { "62", 457750 },
- { "63", 463750 },
- { "64", 469750 },
- { "65", 475750 },
- { "66", 481750 },
- { "67", 487750 },
- { "68", 493750 },
- { "69", 499750 },
-
- { "70", 505750 },
- { "71", 511750 },
- { "72", 517750 },
- { "73", 523750 },
- { "74", 529750 },
- { "75", 535750 },
- { "76", 541750 },
- { "77", 547750 },
- { "78", 553750 },
- { "79", 559750 },
- { "80", 565750 },
- { "81", 571750 },
- { "82", 577750 },
- { "83", 583750 },
- { "84", 589750 },
- { "85", 595750 },
- { "86", 601750 },
- { "87", 607750 },
- { "88", 613750 },
- { "89", 619750 },
- { "90", 625750 },
- { "91", 631750 },
- { "92", 637750 },
- { "93", 643750 },
- { "94", 649750 },
- { "95", 97750 },
- { "96", 103750 },
- { "97", 109750 },
- { "98", 115750 },
- { "99", 121750 },
- { "100", 655750 },
- { "101", 661750 },
- { "102", 667750 },
- { "103", 673750 },
- { "104", 679750 },
- { "105", 685750 },
- { "106", 691750 },
- { "107", 697750 },
- { "108", 703750 },
- { "109", 709750 },
- { "110", 715750 },
- { "111", 721750 },
- { "112", 727750 },
- { "113", 733750 },
- { "114", 739750 },
- { "115", 745750 },
- { "116", 751750 },
- { "117", 757750 },
- { "118", 763750 },
- { "119", 769750 },
- { "120", 775750 },
- { "121", 781750 },
- { "122", 787750 },
- { "123", 793750 },
- { "124", 799750 },
- { "125", 805750 }
-};
-
-/* --------------------------------------------------------------------- */
-
-/* JP broadcast */
-static struct CHANLIST ntsc_bcast_jp[] = {
- { "1", 91250 },
- { "2", 97250 },
- { "3", 103250 },
- { "4", 171250 },
- { "5", 177250 },
- { "6", 183250 },
- { "7", 189250 },
- { "8", 193250 },
- { "9", 199250 },
- { "10", 205250 },
- { "11", 211250 },
- { "12", 217250 },
-
- { "13", 471250 },
- { "14", 477250 },
- { "15", 483250 },
- { "16", 489250 },
- { "17", 495250 },
- { "18", 501250 },
- { "19", 507250 },
- { "20", 513250 },
- { "21", 519250 },
- { "22", 525250 },
- { "23", 531250 },
- { "24", 537250 },
- { "25", 543250 },
- { "26", 549250 },
- { "27", 555250 },
- { "28", 561250 },
- { "29", 567250 },
- { "30", 573250 },
- { "31", 579250 },
- { "32", 585250 },
- { "33", 591250 },
- { "34", 597250 },
- { "35", 603250 },
- { "36", 609250 },
- { "37", 615250 },
- { "38", 621250 },
- { "39", 627250 },
- { "40", 633250 },
- { "41", 639250 },
- { "42", 645250 },
- { "43", 651250 },
- { "44", 657250 },
-
- { "45", 663250 },
- { "46", 669250 },
- { "47", 675250 },
- { "48", 681250 },
- { "49", 687250 },
- { "50", 693250 },
- { "51", 699250 },
- { "52", 705250 },
- { "53", 711250 },
- { "54", 717250 },
- { "55", 723250 },
- { "56", 729250 },
- { "57", 735250 },
- { "58", 741250 },
- { "59", 747250 },
- { "60", 753250 },
- { "61", 759250 },
- { "62", 765250 },
-};
-
-/* JP cable */
-static struct CHANLIST ntsc_cable_jp[] = {
- { "13", 109250 },
- { "14", 115250 },
- { "15", 121250 },
- { "16", 127250 },
- { "17", 133250 },
- { "18", 139250 },
- { "19", 145250 },
- { "20", 151250 },
-
- { "21", 157250 },
- { "22", 165250 },
- { "23", 223250 },
- { "24", 231250 },
- { "25", 237250 },
- { "26", 243250 },
- { "27", 249250 },
- { "28", 253250 },
- { "29", 259250 },
- { "30", 265250 },
- { "31", 271250 },
- { "32", 277250 },
- { "33", 283250 },
- { "34", 289250 },
- { "35", 295250 },
- { "36", 301250 },
- { "37", 307250 },
- { "38", 313250 },
- { "39", 319250 },
- { "40", 325250 },
- { "41", 331250 },
- { "42", 337250 },
- { "43", 343250 },
- { "44", 349250 },
- { "45", 355250 },
- { "46", 361250 },
- { "47", 367250 },
- { "48", 373250 },
- { "49", 379250 },
- { "50", 385250 },
- { "51", 391250 },
- { "52", 397250 },
- { "53", 403250 },
- { "54", 409250 },
- { "55", 415250 },
- { "56", 421250 },
- { "57", 427250 },
- { "58", 433250 },
- { "59", 439250 },
- { "60", 445250 },
- { "61", 451250 },
- { "62", 457250 },
- { "63", 463250 },
-};
-
-/* --------------------------------------------------------------------- */
-
-/* australia */
-static struct CHANLIST pal_australia[] = {
- { "0", 46250 },
- { "1", 57250 },
- { "2", 64250 },
- { "3", 86250 },
- { "4", 95250 },
- { "5", 102250 },
- { "5A", 138250 },
- { "6", 175250 },
- { "7", 182250 },
- { "8", 189250 },
- { "9", 196250 },
- { "10", 209250 },
- { "11", 216250 },
- { "28", 527250 },
- { "29", 534250 },
- { "30", 541250 },
- { "31", 548250 },
- { "32", 555250 },
- { "33", 562250 },
- { "34", 569250 },
- { "35", 576250 },
- { "36", 591250 },
- { "39", 604250 },
- { "40", 611250 },
- { "41", 618250 },
- { "42", 625250 },
- { "43", 632250 },
- { "44", 639250 },
- { "45", 646250 },
- { "46", 653250 },
- { "47", 660250 },
- { "48", 667250 },
- { "49", 674250 },
- { "50", 681250 },
- { "51", 688250 },
- { "52", 695250 },
- { "53", 702250 },
- { "54", 709250 },
- { "55", 716250 },
- { "56", 723250 },
- { "57", 730250 },
- { "58", 737250 },
- { "59", 744250 },
- { "60", 751250 },
- { "61", 758250 },
- { "62", 765250 },
- { "63", 772250 },
- { "64", 779250 },
- { "65", 786250 },
- { "66", 793250 },
- { "67", 800250 },
- { "68", 807250 },
- { "69", 814250 },
-};
-
-static struct CHANLIST pal_australia_optus[] = {
- { "1", 138250 },
- { "2", 147250 },
- { "3", 154250 },
- { "4", 161250 },
- { "5", 168250 },
- { "6", 175250 },
- { "7", 182250 },
- { "8", 189250 },
- { "9", 196250 },
- { "10", 209250 },
- { "11", 216250 },
- { "12", 224250 },
- { "13", 231250 },
- { "14", 238250 },
- { "15", 245250 },
- { "16", 252250 },
- { "17", 259250 },
- { "18", 266250 },
- { "19", 273250 },
- { "20", 280250 },
- { "21", 287250 },
- { "22", 294250 },
- { "23", 303250 },
- { "24", 310250 },
- { "25", 317250 },
- { "26", 324250 },
- { "27", 338250 },
- { "28", 345250 },
- { "29", 352250 },
- { "30", 359250 },
- { "31", 366250 },
- { "32", 373250 },
- { "33", 380250 },
- { "34", 387250 },
- { "35", 394250 },
- { "36", 401250 },
- { "37", 408250 },
- { "38", 415250 },
- { "39", 422250 },
- { "40", 429250 },
- { "41", 436250 },
- { "42", 443250 },
- { "43", 450250 },
- { "44", 457250 },
- { "45", 464250 },
- { "46", 471250 },
- { "47", 478250 },
- { "48", 485250 },
- };
-
-/* --------------------------------------------------------------------- */
-/* europe */
-
-/* CCIR frequencies */
-
-#define FREQ_CCIR_I_III \
- { "E2", 48250 }, \
- { "E3", 55250 }, \
- { "E4", 62250 }, \
- \
- { "S01", 69250 }, \
- { "S02", 76250 }, \
- { "S03", 83250 }, \
- \
- { "E5", 175250 }, \
- { "E6", 182250 }, \
- { "E7", 189250 }, \
- { "E8", 196250 }, \
- { "E9", 203250 }, \
- { "E10", 210250 }, \
- { "E11", 217250 }, \
- { "E12", 224250 }
-
-#define FREQ_CCIR_SL_SH \
- { "SE1", 105250 }, \
- { "SE2", 112250 }, \
- { "SE3", 119250 }, \
- { "SE4", 126250 }, \
- { "SE5", 133250 }, \
- { "SE6", 140250 }, \
- { "SE7", 147250 }, \
- { "SE8", 154250 }, \
- { "SE9", 161250 }, \
- { "SE10", 168250 }, \
- \
- { "SE11", 231250 }, \
- { "SE12", 238250 }, \
- { "SE13", 245250 }, \
- { "SE14", 252250 }, \
- { "SE15", 259250 }, \
- { "SE16", 266250 }, \
- { "SE17", 273250 }, \
- { "SE18", 280250 }, \
- { "SE19", 287250 }, \
- { "SE20", 294250 }
-
-#define FREQ_CCIR_H \
- { "S21", 303250 }, \
- { "S22", 311250 }, \
- { "S23", 319250 }, \
- { "S24", 327250 }, \
- { "S25", 335250 }, \
- { "S26", 343250 }, \
- { "S27", 351250 }, \
- { "S28", 359250 }, \
- { "S29", 367250 }, \
- { "S30", 375250 }, \
- { "S31", 383250 }, \
- { "S32", 391250 }, \
- { "S33", 399250 }, \
- { "S34", 407250 }, \
- { "S35", 415250 }, \
- { "S36", 423250 }, \
- { "S37", 431250 }, \
- { "S38", 439250 }, \
- { "S39", 447250 }, \
- { "S40", 455250 }, \
- { "S41", 463250 }
-
-/* OIRT frequencies */
-
-#define FREQ_OIRT_I_III \
- { "R1", 49750 }, \
- { "R2", 59250 }, \
- \
- { "R3", 77250 }, \
- { "R4", 85250 }, \
- { "R5", 93250 }, \
- \
- { "R6", 175250 }, \
- { "R7", 183250 }, \
- { "R8", 191250 }, \
- { "R9", 199250 }, \
- { "R10", 207250 }, \
- { "R11", 215250 }, \
- { "R12", 223250 }
-
-#define FREQ_OIRT_SL_SH \
- { "SR1", 111250 }, \
- { "SR2", 119250 }, \
- { "SR3", 127250 }, \
- { "SR4", 135250 }, \
- { "SR5", 143250 }, \
- { "SR6", 151250 }, \
- { "SR7", 159250 }, \
- { "SR8", 167250 }, \
- \
- { "SR11", 231250 }, \
- { "SR12", 239250 }, \
- { "SR13", 247250 }, \
- { "SR14", 255250 }, \
- { "SR15", 263250 }, \
- { "SR16", 271250 }, \
- { "SR17", 279250 }, \
- { "SR18", 287250 }, \
- { "SR19", 295250 }
-
-#define FREQ_UHF \
- { "21", 471250 }, \
- { "22", 479250 }, \
- { "23", 487250 }, \
- { "24", 495250 }, \
- { "25", 503250 }, \
- { "26", 511250 }, \
- { "27", 519250 }, \
- { "28", 527250 }, \
- { "29", 535250 }, \
- { "30", 543250 }, \
- { "31", 551250 }, \
- { "32", 559250 }, \
- { "33", 567250 }, \
- { "34", 575250 }, \
- { "35", 583250 }, \
- { "36", 591250 }, \
- { "37", 599250 }, \
- { "38", 607250 }, \
- { "39", 615250 }, \
- { "40", 623250 }, \
- { "41", 631250 }, \
- { "42", 639250 }, \
- { "43", 647250 }, \
- { "44", 655250 }, \
- { "45", 663250 }, \
- { "46", 671250 }, \
- { "47", 679250 }, \
- { "48", 687250 }, \
- { "49", 695250 }, \
- { "50", 703250 }, \
- { "51", 711250 }, \
- { "52", 719250 }, \
- { "53", 727250 }, \
- { "54", 735250 }, \
- { "55", 743250 }, \
- { "56", 751250 }, \
- { "57", 759250 }, \
- { "58", 767250 }, \
- { "59", 775250 }, \
- { "60", 783250 }, \
- { "61", 791250 }, \
- { "62", 799250 }, \
- { "63", 807250 }, \
- { "64", 815250 }, \
- { "65", 823250 }, \
- { "66", 831250 }, \
- { "67", 839250 }, \
- { "68", 847250 }, \
- { "69", 855250 }
-
-static struct CHANLIST europe_west[] = {
- FREQ_CCIR_I_III,
- FREQ_CCIR_SL_SH,
- FREQ_CCIR_H,
- FREQ_UHF
-};
-
-static struct CHANLIST europe_east[] = {
- FREQ_OIRT_I_III,
- FREQ_OIRT_SL_SH,
- FREQ_CCIR_I_III,
- FREQ_CCIR_SL_SH,
- FREQ_CCIR_H,
- FREQ_UHF
-};
-
-static struct CHANLIST pal_italy[] = {
- { "A", 53750 },
- { "B", 62250 },
- { "C", 82250 },
- { "D", 175250 },
- { "E", 183750 },
- { "F", 192250 },
- { "G", 201250 },
- { "H", 210250 },
- { "H1", 217250 },
- { "H2", 224250 },
- FREQ_UHF
-};
-
-static struct CHANLIST pal_ireland[] = {
- { "A0", 45750 },
- { "A1", 48000 },
- { "A2", 53750 },
- { "A3", 56000 },
- { "A4", 61750 },
- { "A5", 64000 },
- { "A6", 175250 },
- { "A7", 176000 },
- { "A8", 183250 },
- { "A9", 184000 },
- { "A10", 191250 },
- { "A11", 192000 },
- { "A12", 199250 },
- { "A13", 200000 },
- { "A14", 207250 },
- { "A15", 208000 },
- { "A16", 215250 },
- { "A17", 216000 },
- { "A18", 224000 },
- { "A19", 232000 },
- { "A20", 248000 },
- { "A21", 256000 },
- { "A22", 264000 },
- { "A23", 272000 },
- { "A24", 280000 },
- { "A25", 288000 },
- { "A26", 296000 },
- { "A27", 304000 },
- { "A28", 312000 },
- { "A29", 320000 },
- { "A30", 344000 },
- { "A31", 352000 },
- { "A32", 408000 },
- { "A33", 416000 },
- { "A34", 448000 },
- { "A35", 480000 },
- { "A36", 520000 },
- FREQ_UHF,
-};
-
-static struct CHANLIST secam_france[] = {
- { "K01", 47750 },
- { "K02", 55750 },
- { "K03", 60500 },
- { "K04", 63750 },
- { "K05", 176000 },
- { "K06", 184000 },
- { "K07", 192000 },
- { "K08", 200000 },
- { "K09", 208000 },
- { "K10", 216000 },
- { "KB", 116750 },
- { "KC", 128750 },
- { "KD", 140750 },
- { "KE", 159750 },
- { "KF", 164750 },
- { "KG", 176750 },
- { "KH", 188750 },
- { "KI", 200750 },
- { "KJ", 212750 },
- { "KK", 224750 },
- { "KL", 236750 },
- { "KM", 248750 },
- { "KN", 260750 },
- { "KO", 272750 },
- { "KP", 284750 },
- { "KQ", 296750 },
- { "H01", 303250 },
- { "H02", 311250 },
- { "H03", 319250 },
- { "H04", 327250 },
- { "H05", 335250 },
- { "H06", 343250 },
- { "H07", 351250 },
- { "H08", 359250 },
- { "H09", 367250 },
- { "H10", 375250 },
- { "H11", 383250 },
- { "H12", 391250 },
- { "H13", 399250 },
- { "H14", 407250 },
- { "H15", 415250 },
- { "H16", 423250 },
- { "H17", 431250 },
- { "H18", 439250 },
- { "H19", 447250 },
- FREQ_UHF,
-};
-
-/* --------------------------------------------------------------------- */
-
-static struct CHANLIST pal_newzealand[] = {
- { "1", 45250 },
- { "2", 55250 },
- { "3", 62250 },
- { "4", 175250 },
- { "5", 182250 },
- { "6", 189250 },
- { "7", 196250 },
- { "8", 203250 },
- { "9", 210250 },
- { "10", 217250 },
- { "11", 224250 },
- FREQ_UHF,
-};
-
-/* --------------------------------------------------------------------- */
-
-/* China broadcast */
-static struct CHANLIST pal_bcast_cn[] = {
- { "1", 49750 },
- { "2", 57750 },
- { "3", 65750 },
- { "4", 77250 },
- { "5", 85250 },
- { "6", 112250 },
- { "7", 120250 },
- { "8", 128250 },
- { "9", 136250 },
- { "10", 144250 },
- { "11", 152250 },
- { "12", 160250 },
- { "13", 168250 },
- { "14", 176250 },
- { "15", 184250 },
- { "16", 192250 },
- { "17", 200250 },
- { "18", 208250 },
- { "19", 216250 },
- { "20", 224250 },
- { "21", 232250 },
- { "22", 240250 },
- { "23", 248250 },
- { "24", 256250 },
- { "25", 264250 },
- { "26", 272250 },
- { "27", 280250 },
- { "28", 288250 },
- { "29", 296250 },
- { "30", 304250 },
- { "31", 312250 },
- { "32", 320250 },
- { "33", 328250 },
- { "34", 336250 },
- { "35", 344250 },
- { "36", 352250 },
- { "37", 360250 },
- { "38", 368250 },
- { "39", 376250 },
- { "40", 384250 },
- { "41", 392250 },
- { "42", 400250 },
- { "43", 408250 },
- { "44", 416250 },
- { "45", 424250 },
- { "46", 432250 },
- { "47", 440250 },
- { "48", 448250 },
- { "49", 456250 },
- { "50", 463250 },
- { "51", 471250 },
- { "52", 479250 },
- { "53", 487250 },
- { "54", 495250 },
- { "55", 503250 },
- { "56", 511250 },
- { "57", 519250 },
- { "58", 527250 },
- { "59", 535250 },
- { "60", 543250 },
- { "61", 551250 },
- { "62", 559250 },
- { "63", 607250 },
- { "64", 615250 },
- { "65", 623250 },
- { "66", 631250 },
- { "67", 639250 },
- { "68", 647250 },
- { "69", 655250 },
- { "70", 663250 },
- { "71", 671250 },
- { "72", 679250 },
- { "73", 687250 },
- { "74", 695250 },
- { "75", 703250 },
- { "76", 711250 },
- { "77", 719250 },
- { "78", 727250 },
- { "79", 735250 },
- { "80", 743250 },
- { "81", 751250 },
- { "82", 759250 },
- { "83", 767250 },
- { "84", 775250 },
- { "85", 783250 },
- { "86", 791250 },
- { "87", 799250 },
- { "88", 807250 },
- { "89", 815250 },
- { "90", 823250 },
- { "91", 831250 },
- { "92", 839250 },
- { "93", 847250 },
- { "94", 855250 },
-};
-
-/* --------------------------------------------------------------------- */
-/* South Africa Broadcast */
+int chantab = -1;
+struct CHANLISTS *chanlists;
+struct STRTAB *chanlist_names;
-static struct CHANLIST pal_bcast_za[] ={
- { "1", 175250 },
- { "2", 183250 },
- { "3", 191250 },
- { "4", 199250 },
- { "5", 207250 },
- { "6", 215250 },
- { "7", 223250 },
- { "8", 231250 },
- { "9", 239250 },
- { "10", 247250 },
- { "11", 255250 },
- { "12", 263250 },
- { "13", 271250 },
- FREQ_UHF
-};
/* --------------------------------------------------------------------- */
-static struct CHANLIST argentina[] = {
- { "001", 56250 },
- { "002", 62250 },
- { "003", 68250 },
- { "004", 78250 },
- { "005", 84250 },
- { "006", 176250 },
- { "007", 182250 },
- { "008", 188250 },
- { "009", 194250 },
- { "010", 200250 },
- { "011", 206250 },
- { "012", 212250 },
- { "013", 122250 },
- { "014", 128250 },
- { "015", 134250 },
- { "016", 140250 },
- { "017", 146250 },
- { "018", 152250 },
- { "019", 158250 },
- { "020", 164250 },
- { "021", 170250 },
- { "022", 218250 },
- { "023", 224250 },
- { "024", 230250 },
- { "025", 236250 },
- { "026", 242250 },
- { "027", 248250 },
- { "028", 254250 },
- { "029", 260250 },
- { "030", 266250 },
- { "031", 272250 },
- { "032", 278250 },
- { "033", 284250 },
- { "034", 290250 },
- { "035", 296250 },
- { "036", 302250 },
- { "037", 308250 },
- { "038", 314250 },
- { "039", 320250 },
- { "040", 326250 },
- { "041", 332250 },
- { "042", 338250 },
- { "043", 344250 },
- { "044", 350250 },
- { "045", 356250 },
- { "046", 362250 },
- { "047", 368250 },
- { "048", 374250 },
- { "049", 380250 },
- { "050", 386250 },
- { "051", 392250 },
- { "052", 398250 },
- { "053", 404250 },
- { "054", 410250 },
- { "055", 416250 },
- { "056", 422250 },
- { "057", 428250 },
- { "058", 434250 },
- { "059", 440250 },
- { "060", 446250 },
- { "061", 452250 },
- { "062", 458250 },
- { "063", 464250 },
- { "064", 470250 },
- { "065", 476250 },
- { "066", 482250 },
- { "067", 488250 },
- { "068", 494250 },
- { "069", 500250 },
- { "070", 506250 },
- { "071", 512250 },
- { "072", 518250 },
- { "073", 524250 },
- { "074", 530250 },
- { "075", 536250 },
- { "076", 542250 },
- { "077", 548250 },
- { "078", 554250 },
- { "079", 560250 },
- { "080", 566250 },
- { "081", 572250 },
- { "082", 578250 },
- { "083", 584250 },
- { "084", 590250 },
- { "085", 596250 },
- { "086", 602250 },
- { "087", 608250 },
- { "088", 614250 },
- { "089", 620250 },
- { "090", 626250 },
- { "091", 632250 },
- { "092", 638250 },
- { "093", 644250 },
-};
+void freq_init(void)
+{
+ char line[256],value[256];
+ FILE *fp;
+ int nr,i,j;
+
+ if (NULL == (fp = fopen(DATADIR "/Index.map","r"))) {
+ perror("open " DATADIR "/Index.map");
+ exit(1);
+ }
+ if (debug)
+ fprintf(stderr,"freq: reading " DATADIR "/Index.map\n");
+
+ nr = 0;
+ i = 0;
+ while (NULL != fgets(line,255,fp)) {
+ nr++;
+ if (line[0] == '\n' || line[0] == '#' || line[0] == '%')
+ continue;
+ if (1 == sscanf(line,"[%255[^]]]",value)) {
+ /* [section] */
+ chanlists = realloc(chanlists, (i+2) * sizeof(struct CHANLISTS));
+ memset(chanlists+i, 0, 2*sizeof(struct CHANLISTS));
+ chanlists[i].name = strdup(value);
+ i++;
+ continue;
+ }
+ if (NULL == chanlists) {
+ fprintf(stderr,"%s:%d: error: no section\n",
+ DATADIR "/Index.map",nr);
+ continue;
+ }
+
+ if (1 == sscanf(line," file = %255[^\n]",value)) {
+ /* file = <filename> */
+ chanlists[i-1].filename = strdup(value);
+ continue;
+ }
+
+ /* Huh ? */
+ fprintf(stderr,"%s:%d: syntax error\n",
+ DATADIR "/Index.map",nr);
+ }
+
+ chanlist_names = malloc((i+1) * sizeof(struct STRTAB));
+ for (j = 0; j < i; j++) {
+ chanlist_names[j].nr = j;
+ chanlist_names[j].str = chanlists[j].name;
+ }
+ chanlist_names[j].nr = -1;
+ chanlist_names[j].str = NULL;
+}
/* --------------------------------------------------------------------- */
-struct CHANLISTS chanlists[] = {
- { "us-bcast", ntsc_bcast, CHAN_COUNT(ntsc_bcast) },
- { "us-cable", ntsc_cable, CHAN_COUNT(ntsc_cable) },
- { "us-cable-hrc", ntsc_hrc, CHAN_COUNT(ntsc_hrc) },
- { "japan-bcast", ntsc_bcast_jp, CHAN_COUNT(ntsc_bcast_jp) },
- { "japan-cable", ntsc_cable_jp, CHAN_COUNT(ntsc_cable_jp) },
- { "europe-west", europe_west, CHAN_COUNT(europe_west) },
- { "europe-east", europe_east, CHAN_COUNT(europe_east) },
- { "italy", pal_italy, CHAN_COUNT(pal_italy) },
- { "newzealand", pal_newzealand, CHAN_COUNT(pal_newzealand) },
- { "australia", pal_australia, CHAN_COUNT(pal_australia) },
- { "ireland", pal_ireland, CHAN_COUNT(pal_ireland) },
- { "france", secam_france, CHAN_COUNT(secam_france) },
- { "china-bcast", pal_bcast_cn, CHAN_COUNT(pal_bcast_cn) },
- { "southafrica", pal_bcast_za, CHAN_COUNT(pal_bcast_za) },
- { "argentina", argentina, CHAN_COUNT(argentina) },
- { "canada-cable", ntsc_cable_ca, CHAN_COUNT(ntsc_cable_ca) },
- { "australia-optus", pal_australia_optus, CHAN_COUNT(pal_australia_optus) },
- { NULL, NULL, 0 } /* EOF */
-};
-
-struct STRTAB chanlist_names[] = {
- { 0, "us-bcast" },
- { 1, "us-cable" },
- { 2, "us-cable-hrc" },
- { 3, "japan-bcast" },
- { 4, "japan-cable" },
- { 5, "europe-west" },
- { 6, "europe-east" },
- { 7, "italy" },
- { 8, "newzealand" },
- { 9, "australia" },
- { 10, "ireland" },
- { 11, "france" },
- { 12, "china-bcast" },
- { 13, "southafrica" },
- { 14, "argentina" },
- { 15, "canada-cable" },
- { 16, "australia-optus" },
- { -1, NULL }
-};
-
-int chantab = 5;
-struct CHANLIST *chanlist = europe_west;
-int chancount = CHAN_COUNT(europe_west);
-
+static int freq_readlist(struct CHANLIST **list, int n, char *name)
+{
+ char line[256],value[256];
+ char filename[256];
+ FILE *fp;
+ int nr;
+
+ sprintf(filename,"%s/%s",DATADIR,name);
+ if (NULL == (fp = fopen(filename,"r"))) {
+ fprintf(stderr,"open %s: %s\n",filename,strerror(errno));
+ exit(1);
+ }
+ if (debug)
+ fprintf(stderr,"freq: reading %s\n",filename);
+
+ nr = 0;
+ while (NULL != fgets(line,255,fp)) {
+ nr++;
+ if (1 == sscanf(line,"# include \"%[^\"]\"",value)) {
+ /* includes */
+ n = freq_readlist(list,n,value);
+ continue;
+ }
+ if (line[0] == '\n' || line[0] == '#' || line[0] == '%') {
+ /* ignore */
+ continue;
+ }
+ if (1 == sscanf(line,"[%255[^]]]",value)) {
+ /* [section] */
+ if (0 == (n % 16)) {
+ *list = realloc(*list, (n+16) * sizeof(struct CHANLIST));
+ memset((*list)+n, 0, 16*sizeof(struct CHANLIST));
+ }
+ (*list)[n].name = strdup(value);
+ n++;
+ continue;
+ }
+ if (0 == n) {
+ fprintf(stderr,"%s:%d: error: no section\n",filename,nr);
+ continue;
+ }
+
+ if (1 == sscanf(line," freq = %255[^\n]",value)) {
+ /* freq = */
+ (*list)[n-1].freq = atoi(value);
+ continue;
+ }
+
+ /* Huh ? */
+ fprintf(stderr,"%s:%d: syntax error\n",
+ DATADIR "/Index.map",nr);
+ }
+ return n;
+}
+
+void freq_newtab(int n)
+{
+ if (debug)
+ fprintf(stderr,"freq: newtab %d\n",n);
+
+ if (NULL == chanlists[n].list)
+ chanlists[n].count =
+ freq_readlist(&chanlists[n].list,0,chanlists[n].filename);
+ chantab = n;
+}
diff --git a/common/frequencies.h b/common/frequencies.h
index 8f62e75..47cd7b7 100644
--- a/common/frequencies.h
+++ b/common/frequencies.h
@@ -5,13 +5,6 @@
*
* Frequencies are given in kHz
*/
-#define NTSC_AUDIO_CARRIER 4500
-#define PAL_AUDIO_CARRIER_I 6000
-#define PAL_AUDIO_CARRIER_BGHN 5500
-#define PAL_AUDIO_CARRIER_MN 4500
-#define PAL_AUDIO_CARRIER_D 6500
-#define SEACAM_AUDIO_DKK1L 6500
-#define SEACAM_AUDIO_BG 5500
/* NICAM 728 32-kHz, 14-bit digital stereo audio is transmitted in 1ms frames
containing 8 bits frame sync, 5 bits control, 11 bits additional data, and
704 bits audio data. The bit rate is reduced by transmitting only 10 bits
@@ -21,8 +14,6 @@
companeded audio data is interleaved to reduce the influence of dropouts
and the whole frame except for sync bits is scrambled for spectrum shaping.
Data is modulated using QPSK, at below following subcarrier freqs */
-#define NICAM728_PAL_BGH 5850
-#define NICAM728_PAL_I 6552
/* COMPREHENSIVE LIST OF FORMAT BY COUNTRY
(M) NTSC used in:
@@ -95,17 +86,21 @@ struct CHANLIST {
struct CHANLISTS {
char *name;
+ char *filename;
struct CHANLIST *list;
int count;
};
-#define CHAN_COUNT(x) (sizeof(x)/sizeof(struct CHANLIST))
-
/* --------------------------------------------------------------------- */
-extern struct CHANLISTS chanlists[];
-extern struct STRTAB chanlist_names[];
-
extern int chantab;
-extern struct CHANLIST *chanlist;
-extern int chancount;
+extern struct CHANLISTS *chanlists;
+extern struct STRTAB *chanlist_names;
+
+#define chanlist ((-1 != chantab) ? chanlists[chantab].list : NULL)
+#define chancount ((-1 != chantab) ? chanlists[chantab].count : 0)
+
+/* --------------------------------------------------------------------- */
+
+void freq_init(void);
+void freq_newtab(int n);
diff --git a/common/parseconfig.c b/common/parseconfig.c
index 9c6eeaa..d4588d7 100644
--- a/common/parseconfig.c
+++ b/common/parseconfig.c
@@ -52,7 +52,7 @@ cfg_init_entries(void)
e->ent_names[0] = NULL;
e->ent_values = malloc(ALLOC_SIZE*sizeof(char*));
e->ent_values[0] = NULL;
- e->ent_seen = malloc(ALLOC_SIZE*sizeof(int));
+ e->ent_seen = malloc(ALLOC_SIZE*sizeof(int*));
e->ent_seen[0] = 0;
return e;
}
@@ -94,7 +94,7 @@ cfg_set_entry(struct CFG_ENTRIES *e, char *name, char *value)
if ((e->ent_count % ALLOC_SIZE) == (ALLOC_SIZE-2)) {
e->ent_names = realloc(e->ent_names,(e->ent_count+2+ALLOC_SIZE)*sizeof(char*));
e->ent_values = realloc(e->ent_values,(e->ent_count+2+ALLOC_SIZE)*sizeof(char*));
- e->ent_seen = realloc(e->ent_seen,(e->ent_count+2+ALLOC_SIZE)*sizeof(int));
+ e->ent_seen = realloc(e->ent_seen,(e->ent_count+2+ALLOC_SIZE)*sizeof(int*));
}
e->ent_count++;
e->ent_names[e->ent_count] = NULL;
@@ -186,7 +186,9 @@ char**
cfg_list_entries(char *name)
{
int i;
-
+
+ if (NULL == c)
+ return NULL;
for (i = 0; i < c->sec_count; i++)
if (0 == strcasecmp(c->sec_names[i],name))
return c->sec_entries[i]->ent_names;
diff --git a/common/vbi-data.c b/common/vbi-data.c
index ddeb307..9b4a0a8 100644
--- a/common/vbi-data.c
+++ b/common/vbi-data.c
@@ -81,7 +81,7 @@ vbi_open(char *dev, int debug, int sim)
vbi->raw = malloc(vbi->lines * vbi->par->bytes_per_line);
if (NULL == vbi->raw)
goto oops;
- vbi->sliced = malloc(vbi->lines * sizeof(struct vbi_sliced));
+ vbi->sliced = malloc(vbi->lines * sizeof(vbi_sliced));
if (NULL == vbi->sliced)
goto oops;
vbi->tv.tv_sec = 1;
@@ -229,7 +229,7 @@ int vbi_calc_page(int pagenr, int offset)
return result;
}
-int vbi_calc_subpage(struct vbi_decoder *dec, int pgno, int subno, int offset)
+int vbi_calc_subpage(vbi_decoder *dec, int pgno, int subno, int offset)
{
vbi_page pg;
int newno;
@@ -257,10 +257,11 @@ int vbi_calc_subpage(struct vbi_decoder *dec, int pgno, int subno, int offset)
}
int vbi_export_txt(char *dest, char *charset, int size,
- struct vbi_page *pg, struct vbi_rect *rect,
+ vbi_page *pg, struct vbi_rect *rect,
enum vbi_txt_colors color)
{
- int x,y,rc,olen,ilen;
+ int x,y,rc;
+ size_t olen,ilen;
int fg,bg,len=0;
char *ibuf, *obuf;
vbi_char *ch;
@@ -332,7 +333,7 @@ int vbi_export_txt(char *dest, char *charset, int size,
return obuf - dest;
}
-void vbi_find_subtitle(struct vbi_page *pg, struct vbi_rect *rect)
+void vbi_find_subtitle(vbi_page *pg, struct vbi_rect *rect)
{
int x,y,showline;
vbi_char *ch;
diff --git a/common/vbi-data.h b/common/vbi-data.h
index 4d6adc0..af47e84 100644
--- a/common/vbi-data.h
+++ b/common/vbi-data.h
@@ -7,10 +7,10 @@
#define VBI_MAX_SUBPAGES 64
struct vbi_state {
- struct vbi_decoder *dec;
- struct vbi_capture *cap;
- struct vbi_raw_decoder *par;
- struct vbi_sliced *sliced;
+ vbi_decoder *dec;
+ vbi_capture *cap;
+ vbi_raw_decoder *par;
+ vbi_sliced *sliced;
uint8_t *raw;
char *err;
int lines,fd,sim,debug;
diff --git a/configure b/configure
index df179a6..19395c5 100755
--- a/configure
+++ b/configure
@@ -843,6 +843,7 @@ Optional Features:
--enable-alsa enable alsa support
--enable-zvbi enable vbi support (via libzvbi)
--enable-gl enable opengl support
+ --enable-mmx enable mmx support
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1258,6 +1259,11 @@ if test "${enable_zvbi+set}" = set; then
enableval="$enable_zvbi"
fi;
+# Check whether --enable-mmx or --disable-mmx was given.
+if test "${enable_mmx+set}" = set; then
+ enableval="$enable_mmx"
+
+fi;
@@ -5772,6 +5778,24 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
+echo "$as_me:$LINENO: checking if mmx should be used" >&5
+echo $ECHO_N "checking if mmx should be used... $ECHO_C" >&6
+
+if test "$enable_mmx" = "no" -o "$enable_mmx" = "yes"; then
+ USE_MMX="$enable_mmx"
+else
+ case "`uname -m`" in
+ i586 | i686)
+ USE_MMX="yes"
+ ;;
+ *)
+ USE_MMX="no"
+ ;;
+ esac
+fi
+echo "$as_me:$LINENO: result: $USE_MMX" >&5
+echo "${ECHO_T}$USE_MMX" >&6
+
ac_config_files="$ac_config_files Makefile xawtv.spec"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -6377,6 +6401,7 @@ s,@LIBGL@,$LIBGL,;t t
s,@VERSION@,$VERSION,;t t
s,@x11conf@,$x11conf,;t t
s,@resdir@,$resdir,;t t
+s,@USE_MMX@,$USE_MMX,;t t
CEOF
_ACEOF
@@ -6822,7 +6847,7 @@ if test "$no_create" != yes; then
fi
for dir in \
- common console debug fonts jwz libvbi vbistuff x11 \
+ common console debug fonts jwz libvbi vbistuff x11 structs \
libng libng/plugins libng/contrib-plugins
do
test -d $dir && continue
diff --git a/configure.ac b/configure.ac
index 5c5d73f..5033cfb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,6 +26,8 @@ AC_ARG_ENABLE(zvbi,
[ --enable-zvbi enable vbi support (via libzvbi)])
AC_ARG_ENABLE(zvbi,
[ --enable-gl enable opengl support])
+AC_ARG_ENABLE(mmx,
+ [ --enable-mmx enable mmx support])
dnl ---------------------------------------------------------------------
@@ -279,9 +281,27 @@ dnl for screenlock
AC_DEFINE(HAVE_XMU,1,"have xmu")
dnl ---------------------------------------------------------------------
+dnl deinterlace plugins
+AC_MSG_CHECKING(if mmx should be used)
+AC_SUBST(USE_MMX)
+if test "$enable_mmx" = "no" -o "$enable_mmx" = "yes"; then
+ USE_MMX="$enable_mmx"
+else
+ case "`uname -m`" in
+ i586 | i686)
+ USE_MMX="yes"
+ ;;
+ *)
+ USE_MMX="no"
+ ;;
+ esac
+fi
+AC_MSG_RESULT($USE_MMX)
+
+dnl ---------------------------------------------------------------------
AC_OUTPUT(Makefile xawtv.spec)
for dir in \
- common console debug fonts jwz libvbi vbistuff x11 \
+ common console debug fonts jwz libvbi vbistuff x11 structs \
libng libng/plugins libng/contrib-plugins
do
test -d $dir && continue
diff --git a/console/Subdir.mk b/console/Subdir.mk
index fb145d3..848a77b 100644
--- a/console/Subdir.mk
+++ b/console/Subdir.mk
@@ -20,7 +20,8 @@ endif
ifeq ($(FOUND_OS),linux)
TARGETS-console += \
console/radio \
- console/fbtv
+ console/fbtv \
+ console/v4l-info
TARGETS-v4l-conf += \
console/v4l-conf
endif
@@ -57,6 +58,12 @@ console/webcam: \
common/parseconfig.o \
libng/libng.a
+console/v4l-info: \
+ console/v4l-info.o \
+ structs/struct-dump.o \
+ structs/struct-v4l.o \
+ structs/struct-v4l2.o
+
console/dump-mixers: console/dump-mixers.o
console/showriff: console/showriff.o
console/showqt: console/showqt.o
diff --git a/console/fbtv.c b/console/fbtv.c
index 0572328..49d998b 100644
--- a/console/fbtv.c
+++ b/console/fbtv.c
@@ -674,6 +674,7 @@ main(int argc, char *argv[])
strcat(ng_v4l_conf," -y ");
grabber_init();
+ freq_init();
read_config(NULL,NULL,NULL);
if (0 != strlen(mixerdev)) {
struct ng_attribute *attr;
diff --git a/console/showqt.c b/console/showqt.c
index 07e0538..e721bf5 100644
--- a/console/showqt.c
+++ b/console/showqt.c
@@ -439,7 +439,7 @@ static void dump_fields(int fh, off_t pos, struct field_list *list)
break;
case INT64:
read(fh,&int64,sizeof(int64));
- printf(FIELD_NAME "%lld\n",si,list[i].name,SWAP8(int64));
+ printf(FIELD_NAME "%" PRId64 "\n",si,list[i].name,SWAP8(int64));
break;
case FIX16:
read(fh,&int16,sizeof(int16));
@@ -567,7 +567,7 @@ static int handle_classic_atom(int fh, off_t pos, off_t size, int depth)
asize = a.size;
off = 8;
}
- printf("0x%08llx 0x%08llx %*s%s\n",
+ printf("0x%08" PRIx64 " 0x%08" PRIx64 " %*s%s\n",
pos,asize,depth,"",strfcc(a.type));
switch (a.type) {
case a_dinf:
diff --git a/console/ttv.c b/console/ttv.c
index f4d5c8d..e9ae5af 100644
--- a/console/ttv.c
+++ b/console/ttv.c
@@ -208,6 +208,7 @@ main(int argc, char **argv)
/* init v4l */
grabber_init();
+ freq_init();
read_config(NULL,NULL,NULL);
ng_ratio_x = 0;
ng_ratio_y = 0;
diff --git a/console/v4l-info.c b/console/v4l-info.c
new file mode 100644
index 0000000..299e63f
--- /dev/null
+++ b/console/v4l-info.c
@@ -0,0 +1,296 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <ctype.h>
+
+#include <sys/ioctl.h>
+
+#include "videodev.h"
+#include "videodev2.h"
+
+#include "struct-dump.h"
+#include "struct-v4l.h"
+#include "struct-v4l2.h"
+
+/* --------------------------------------------------------------------- */
+/* v4l(1) */
+
+static int dump_v4l(int fd, int tab)
+{
+ struct video_capability capability;
+ struct video_channel channel;
+ struct video_tuner tuner;
+ struct video_audio audio;
+ struct video_picture picture;
+ struct video_buffer buffer;
+ struct video_window window;
+ int i;
+
+ printf("general info\n");
+ memset(&capability,0,sizeof(capability));
+ if (-1 == ioctl(fd,VIDIOCGCAP,&capability))
+ return -1;
+ printf(" VIDIOCGCAP\n");
+ print_struct(stderr,desc_video_capability,&capability,"",tab);
+ printf("\n");
+
+ printf("channels\n");
+ for (i = 0; i < capability.channels; i++) {
+ memset(&channel,0,sizeof(channel));
+ channel.channel = i;
+ if (-1 == ioctl(fd,VIDIOCGCHAN,&channel)) {
+ perror("ioctl VIDIOCGCHAN");
+ continue;
+ }
+ printf(" VIDIOCGCHAN(%d)\n",i);
+ print_struct(stderr,desc_video_channel,&channel,"",tab);
+ }
+ printf("\n");
+
+ printf("tuner\n");
+ memset(&tuner,0,sizeof(tuner));
+ if (-1 == ioctl(fd,VIDIOCGTUNER,&tuner)) {
+ perror("ioctl VIDIOCGTUNER");
+ } else {
+ printf(" VIDIOCGTUNER\n");
+ print_struct(stderr,desc_video_tuner,&tuner,"",tab);
+ }
+ printf("\n");
+
+ printf("audio\n");
+ memset(&audio,0,sizeof(audio));
+ if (-1 == ioctl(fd,VIDIOCGAUDIO,&audio)) {
+ perror("ioctl VIDIOCGAUDIO");
+ } else {
+ printf(" VIDIOCGAUDIO\n");
+ print_struct(stderr,desc_video_audio,&audio,"",tab);
+ }
+ printf("\n");
+
+ printf("picture\n");
+ memset(&picture,0,sizeof(picture));
+ if (-1 == ioctl(fd,VIDIOCGPICT,&picture)) {
+ perror("ioctl VIDIOCGPICT");
+ } else {
+ printf(" VIDIOCGPICT\n");
+ print_struct(stderr,desc_video_picture,&picture,"",tab);
+ }
+ printf("\n");
+
+ printf("buffer\n");
+ memset(&buffer,0,sizeof(buffer));
+ if (-1 == ioctl(fd,VIDIOCGFBUF,&buffer)) {
+ perror("ioctl VIDIOCGFBUF");
+ } else {
+ printf(" VIDIOCGFBUF\n");
+ print_struct(stderr,desc_video_buffer,&buffer,"",tab);
+ }
+ printf("\n");
+
+ printf("window\n");
+ memset(&window,0,sizeof(window));
+ if (-1 == ioctl(fd,VIDIOCGWIN,&window)) {
+ perror("ioctl VIDIOCGWIN");
+ } else {
+ printf(" VIDIOCGWIN\n");
+ print_struct(stderr,desc_video_window,&window,"",tab);
+ }
+ printf("\n");
+
+ return 0;
+}
+
+/* --------------------------------------------------------------------- */
+/* v4l2 */
+
+static int dump_v4l2(int fd, int tab)
+{
+ struct v4l2_capability capability;
+ struct v4l2_standard standard;
+ struct v4l2_input input;
+ struct v4l2_tuner tuner;
+ struct v4l2_fmtdesc fmtdesc;
+ struct v4l2_format format;
+ struct v4l2_framebuffer fbuf;
+ struct v4l2_queryctrl qctrl;
+ int i;
+
+ printf("general info\n");
+ memset(&capability,0,sizeof(capability));
+ if (-1 == ioctl(fd,VIDIOC_QUERYCAP,&capability))
+ return -1;
+ printf(" VIDIOC_QUERYCAP\n");
+ print_struct(stderr,desc_v4l2_capability,&capability,"",tab);
+ printf("\n");
+
+ printf("standards\n");
+ for (i = 0;; i++) {
+ memset(&standard,0,sizeof(standard));
+ standard.index = i;
+ if (-1 == ioctl(fd,VIDIOC_ENUMSTD,&standard))
+ break;
+ printf(" VIDIOC_ENUMSTD(%d)\n",i);
+ print_struct(stderr,desc_v4l2_standard,&standard,"",tab);
+ }
+ printf("\n");
+
+ printf("inputs\n");
+ for (i = 0;; i++) {
+ memset(&input,0,sizeof(input));
+ input.index = i;
+ if (-1 == ioctl(fd,VIDIOC_ENUMINPUT,&input))
+ break;
+ printf(" VIDIOC_ENUMINPUT(%d)\n",i);
+ print_struct(stderr,desc_v4l2_input,&input,"",tab);
+ }
+ printf("\n");
+
+ if (capability.capabilities & V4L2_CAP_TUNER) {
+ printf("tuners\n");
+ for (i = 0;; i++) {
+ memset(&tuner,0,sizeof(tuner));
+ tuner.index = i;
+ if (-1 == ioctl(fd,VIDIOC_G_TUNER,&tuner))
+ break;
+ printf(" VIDIOC_G_TUNER(%d)\n",i);
+ print_struct(stderr,desc_v4l2_tuner,&tuner,"",tab);
+ }
+ printf("\n");
+ }
+
+ if (capability.capabilities & V4L2_CAP_VIDEO_CAPTURE) {
+ printf("video capture\n");
+ for (i = 0;; i++) {
+ memset(&fmtdesc,0,sizeof(fmtdesc));
+ fmtdesc.index = i;
+ fmtdesc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ if (-1 == ioctl(fd,VIDIOC_ENUM_FMT,&fmtdesc))
+ break;
+ printf(" VIDIOC_ENUM_FMT(%d,VIDEO_CAPTURE)\n",i);
+ print_struct(stderr,desc_v4l2_fmtdesc,&fmtdesc,"",tab);
+ }
+ memset(&format,0,sizeof(format));
+ format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ if (-1 == ioctl(fd,VIDIOC_G_FMT,&format)) {
+ perror("VIDIOC_G_FMT(VIDEO_CAPTURE)");
+ } else {
+ printf(" VIDIOC_G_FMT(VIDEO_CAPTURE)\n");
+ print_struct(stderr,desc_v4l2_format,&format,"",tab);
+ }
+ printf("\n");
+ }
+
+ if (capability.capabilities & V4L2_CAP_VIDEO_OVERLAY) {
+ printf("video overlay\n");
+ for (i = 0;; i++) {
+ memset(&fmtdesc,0,sizeof(fmtdesc));
+ fmtdesc.index = i;
+ fmtdesc.type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
+ if (-1 == ioctl(fd,VIDIOC_ENUM_FMT,&fmtdesc))
+ break;
+ printf(" VIDIOC_ENUM_FMT(%d,VIDEO_OVERLAY)\n",i);
+ print_struct(stderr,desc_v4l2_fmtdesc,&fmtdesc,"",tab);
+ }
+ memset(&format,0,sizeof(format));
+ format.type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
+ if (-1 == ioctl(fd,VIDIOC_G_FMT,&format)) {
+ perror("VIDIOC_G_FMT(VIDEO_OVERLAY)");
+ } else {
+ printf(" VIDIOC_G_FMT(VIDEO_OVERLAY)\n");
+ print_struct(stderr,desc_v4l2_format,&format,"",tab);
+ }
+ memset(&fbuf,0,sizeof(fbuf));
+ if (-1 == ioctl(fd,VIDIOC_G_FBUF,&fbuf)) {
+ perror("VIDIOC_G_FBUF");
+ } else {
+ printf(" VIDIOC_G_FBUF\n");
+ print_struct(stderr,desc_v4l2_framebuffer,&fbuf,"",tab);
+ }
+ printf("\n");
+ }
+
+ if (capability.capabilities & V4L2_CAP_VBI_CAPTURE) {
+ printf("vbi capture\n");
+ for (i = 0;; i++) {
+ memset(&fmtdesc,0,sizeof(fmtdesc));
+ fmtdesc.index = i;
+ fmtdesc.type = V4L2_BUF_TYPE_VBI_CAPTURE;
+ if (-1 == ioctl(fd,VIDIOC_ENUM_FMT,&fmtdesc))
+ break;
+ printf(" VIDIOC_ENUM_FMT(%d,VBI_CAPTURE)\n",i);
+ print_struct(stderr,desc_v4l2_fmtdesc,&fmtdesc,"",tab);
+ }
+ memset(&format,0,sizeof(format));
+ format.type = V4L2_BUF_TYPE_VBI_CAPTURE;
+ if (-1 == ioctl(fd,VIDIOC_G_FMT,&format)) {
+ perror("VIDIOC_G_FMT(VBI_CAPTURE)");
+ } else {
+ printf(" VIDIOC_G_FMT(VBI_CAPTURE)\n");
+ print_struct(stderr,desc_v4l2_format,&format,"",tab);
+ }
+ printf("\n");
+ }
+
+ printf("controls\n");
+ for (i = 0;; i++) {
+ memset(&qctrl,0,sizeof(qctrl));
+ qctrl.id = V4L2_CID_BASE+i;
+ if (-1 == ioctl(fd,VIDIOC_QUERYCTRL,&qctrl))
+ break;
+ if (qctrl.flags & V4L2_CTRL_FLAG_DISABLED)
+ continue;
+ printf(" VIDIOC_QUERYCTRL(BASE+%d)\n",i);
+ print_struct(stderr,desc_v4l2_queryctrl,&qctrl,"",tab);
+ }
+ for (i = 0;; i++) {
+ memset(&qctrl,0,sizeof(qctrl));
+ qctrl.id = V4L2_CID_PRIVATE_BASE+i;
+ if (-1 == ioctl(fd,VIDIOC_QUERYCTRL,&qctrl))
+ break;
+ if (qctrl.flags & V4L2_CTRL_FLAG_DISABLED)
+ continue;
+ printf(" VIDIOC_QUERYCTRL(PRIVATE_BASE+%d)\n",i);
+ print_struct(stderr,desc_v4l2_queryctrl,&qctrl,"",tab);
+ }
+ return 0;
+}
+
+/* --------------------------------------------------------------------- */
+/* main */
+
+int main(int argc, char *argv[])
+{
+ char dummy[256];
+ char *device = "/dev/video0";
+ int tab = 1;
+ int fd;
+
+ if (argc > 1)
+ device = argv[1];
+
+ fd = open(device,O_RDONLY);
+ if (-1 == fd) {
+ fprintf(stderr,"open %s: %s\n",device,strerror(errno));
+ exit(1);
+ };
+
+ if (-1 != ioctl(fd,VIDIOC_QUERYCAP,dummy)) {
+ printf("### v4l2 device info [%s] ###\n",device);
+ dump_v4l2(fd,tab);
+ } else if (-1 != ioctl(fd,VIDIOCGCAP,dummy)) {
+ printf("### video4linux device info [%s] ###\n",device);
+ dump_v4l(fd,tab);
+ } else {
+ fprintf(stderr,"%s: not an video4linux device\n",device);
+ }
+ return 0;
+}
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/debian/changelog b/debian/changelog
index c5d7455..ca7709b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xawtv (3.79) unstable; urgency=low
+
+ * new release (closes: #168896, #168694)
+
+ -- Gerd Knorr <kraxel@debian.org> Fri, 15 Nov 2002 11:02:59 +0100
+
xawtv (3.78) unstable; urgency=low
* new release (closes: #132366,#135393,#138792,#144699,#159689).
diff --git a/debian/xawtv-plugins.files b/debian/xawtv-plugins.files
index c9fbe65..386a136 100644
--- a/debian/xawtv-plugins.files
+++ b/debian/xawtv-plugins.files
@@ -1 +1,2 @@
/usr/lib/xawtv/*
+/usr/share/xawtv/*
diff --git a/debug/Subdir.mk b/debug/Subdir.mk
index 25b675f..305d021 100644
--- a/debug/Subdir.mk
+++ b/debug/Subdir.mk
@@ -1,22 +1,13 @@
# variables
TARGETS-debug :=
-ifeq ($(FOUND_ALSA),yes)
-TARGETS-debug += \
- debug/hwscan
-endif
ifeq ($(FOUND_X11),yes)
TARGETS-debug += \
debug/xvideo
endif
-debug/hwscan: \
- debug/hwscan.o \
- libng/libng.a
-
debug/xvideo: debug/xvideo.o
-debug/hwscan : LDLIBS += $(ALSA_LIBS) -ljpeg
debug/xvideo : LDLIBS += $(ATHENA_LIBS)
# global targets
diff --git a/debug/hwscan.c b/debug/hwscan.c
deleted file mode 100644
index 6a5daa3..0000000
--- a/debug/hwscan.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * just some test / debug code for now ...
- *
- * (c) 2002 Gerd Knorr
- *
- */
-
-#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#ifdef HAVE_ALSA_ASOUNDLIB_H
-# include <alsa/asoundlib.h>
-#else
-# include <sys/asoundlib.h>
-#endif
-
-#include "grab-ng.h"
-
-#define ALSAERR(func,args...) \
- if ((err = func(## args)) < 0) { \
- fprintf(stderr,"fixme: %s\n",snd_strerror(err)); \
- goto oops; }
-
-static int alsa_mixer(char *id)
-{
- int err;
- long min,max;
- snd_mixer_t *handle = NULL;
- snd_mixer_elem_t *elem;
- snd_mixer_selem_id_t *sid;
- snd_mixer_selem_id_alloca(&sid);
-
- ALSAERR(snd_mixer_open, &handle, 0);
- ALSAERR(snd_mixer_attach, handle, id);
- ALSAERR(snd_mixer_selem_register, handle, NULL, NULL);
- ALSAERR(snd_mixer_load, handle);
-
- for (elem = snd_mixer_first_elem(handle);
- elem;
- elem = snd_mixer_elem_next(elem)) {
- snd_mixer_selem_get_id(elem, sid);
- if (!snd_mixer_selem_has_playback_volume(elem))
- continue;
- snd_mixer_selem_get_playback_volume_range(elem, &min, &max);
- printf(" mixer ctl playback vol [%ld-%ld] \"%s\", #%i\n",
- min,max,
- snd_mixer_selem_id_get_name(sid),
- snd_mixer_selem_id_get_index(sid));
- }
-
- snd_mixer_close(handle);
- return 0;
-
- oops:
- if (handle)
- snd_mixer_close(handle);
- return err;
-}
-
-static int alsa_card(char *id)
-{
- int err;
- int device = -1;
- snd_ctl_t *handle = NULL;
- snd_ctl_card_info_t *card;
- snd_ctl_elem_list_t *elems;
- snd_ctl_card_info_alloca(&card);
- snd_ctl_elem_list_alloca(&elems);
-
- ALSAERR(snd_ctl_open, &handle, id, 0);
- ALSAERR(snd_ctl_card_info, handle, card);
- printf("alsa card %s id=\"%s\" name=\"%s\"\n", id,
- snd_ctl_card_info_get_id(card),
- snd_ctl_card_info_get_name(card));
-
- ALSAERR(snd_ctl_elem_list, handle, elems);
- printf(" %d controls\n",snd_ctl_elem_list_get_count(elems));
-
- for (;;) {
- ALSAERR(snd_ctl_pcm_next_device,handle,&device);
- if (-1 == device)
- break;
- printf(" pcm%d\n",device);
- }
-
- snd_ctl_close(handle);
- handle = NULL;
-
- oops:
- if (handle)
- snd_ctl_close(handle);
- return err;
-}
-
-static int scan_alsa(void)
-{
- char name[8];
- int card = -1;
-
- for (;;) {
- if (snd_card_next(&card) < 0) {
- fprintf(stderr,"snd_card_next failed\n");
- break;
- }
- if (-1 == card)
- break;
- sprintf(name,"hw:%d",card);
- alsa_card(name);
- alsa_mixer(name);
- printf("\n");
- }
- return 0;
-}
-
-int main(int argc, char *argv[])
-{
- struct ng_devinfo *info,*i2;
- int i,j,k;
-
- ng_init();
- for (i = 0; ng_mix_drivers && ng_mix_drivers[i]; i++) {
- info = ng_mix_drivers[i]->probe();
- if (NULL == info)
- continue;
- fprintf(stderr,"%s mixers\n",ng_mix_drivers[i]->name);
- for (j = 0; strlen(info[j].device) > 0; j++) {
- fprintf(stderr," %s: %s\n",info[j].device,info[j].name);
- i2 = ng_mix_drivers[i]->channels(info[j].device);
- if (NULL == i2)
- continue;
- fprintf(stderr," ");
- for (k = 0; strlen(i2[k].device) > 0; k++) {
- fprintf(stderr," %s",i2[k].device);
- }
- fprintf(stderr,"\n");
- }
- free(info);
- }
-
- scan_alsa();
- return 0;
-}
diff --git a/frequencies/Index.map b/frequencies/Index.map
new file mode 100644
index 0000000..283c217
--- /dev/null
+++ b/frequencies/Index.map
@@ -0,0 +1,51 @@
+[us-bcast]
+file = ntsc-bcast.list
+
+[us-cable]
+file = ntsc-cable.list
+
+[us-cable-hrc]
+file = ntsc-hrc.list
+
+[japan-bcast]
+file = ntsc-bcast-jp.list
+
+[japan-cable]
+file = ntsc-cable-jp.list
+
+[europe-west]
+file = europe-west.list
+
+[europe-east]
+file = europe-east.list
+
+[italy]
+file = pal-italy.list
+
+[newzealand]
+file = pal-newzealand.list
+
+[australia]
+file = pal-australia.list
+
+[ireland]
+file = pal-ireland.list
+
+[france]
+file = secam-france.list
+
+[china-bcast]
+file = pal-bcast-cn.list
+
+[southafrica]
+file = pal-bcast-za.list
+
+[argentina]
+file = argentina.list
+
+[canada-cable]
+file = ntsc-cable-ca.list
+
+[australia-optus]
+file = pal-australia-optus.list
+
diff --git a/frequencies/Subdir.mk b/frequencies/Subdir.mk
new file mode 100644
index 0000000..7d771b6
--- /dev/null
+++ b/frequencies/Subdir.mk
@@ -0,0 +1,9 @@
+
+FILES-frequencies := \
+ $(srcdir)/frequencies/Index.map \
+ $(wildcard $(srcdir)/frequencies/*.list)
+
+install:: $(FILES-frequencies)
+ $(INSTALL_DIR) $(datadir)
+ $(INSTALL_DATA) $(FILES-frequencies) $(datadir)
+
diff --git a/frequencies/argentina.list b/frequencies/argentina.list
new file mode 100644
index 0000000..40c221c
--- /dev/null
+++ b/frequencies/argentina.list
@@ -0,0 +1,279 @@
+[001]
+freq = 56250
+
+[002]
+freq = 62250
+
+[003]
+freq = 68250
+
+[004]
+freq = 78250
+
+[005]
+freq = 84250
+
+[006]
+freq = 176250
+
+[007]
+freq = 182250
+
+[008]
+freq = 188250
+
+[009]
+freq = 194250
+
+[010]
+freq = 200250
+
+[011]
+freq = 206250
+
+[012]
+freq = 212250
+
+[013]
+freq = 122250
+
+[014]
+freq = 128250
+
+[015]
+freq = 134250
+
+[016]
+freq = 140250
+
+[017]
+freq = 146250
+
+[018]
+freq = 152250
+
+[019]
+freq = 158250
+
+[020]
+freq = 164250
+
+[021]
+freq = 170250
+
+[022]
+freq = 218250
+
+[023]
+freq = 224250
+
+[024]
+freq = 230250
+
+[025]
+freq = 236250
+
+[026]
+freq = 242250
+
+[027]
+freq = 248250
+
+[028]
+freq = 254250
+
+[029]
+freq = 260250
+
+[030]
+freq = 266250
+
+[031]
+freq = 272250
+
+[032]
+freq = 278250
+
+[033]
+freq = 284250
+
+[034]
+freq = 290250
+
+[035]
+freq = 296250
+
+[036]
+freq = 302250
+
+[037]
+freq = 308250
+
+[038]
+freq = 314250
+
+[039]
+freq = 320250
+
+[040]
+freq = 326250
+
+[041]
+freq = 332250
+
+[042]
+freq = 338250
+
+[043]
+freq = 344250
+
+[044]
+freq = 350250
+
+[045]
+freq = 356250
+
+[046]
+freq = 362250
+
+[047]
+freq = 368250
+
+[048]
+freq = 374250
+
+[049]
+freq = 380250
+
+[050]
+freq = 386250
+
+[051]
+freq = 392250
+
+[052]
+freq = 398250
+
+[053]
+freq = 404250
+
+[054]
+freq = 410250
+
+[055]
+freq = 416250
+
+[056]
+freq = 422250
+
+[057]
+freq = 428250
+
+[058]
+freq = 434250
+
+[059]
+freq = 440250
+
+[060]
+freq = 446250
+
+[061]
+freq = 452250
+
+[062]
+freq = 458250
+
+[063]
+freq = 464250
+
+[064]
+freq = 470250
+
+[065]
+freq = 476250
+
+[066]
+freq = 482250
+
+[067]
+freq = 488250
+
+[068]
+freq = 494250
+
+[069]
+freq = 500250
+
+[070]
+freq = 506250
+
+[071]
+freq = 512250
+
+[072]
+freq = 518250
+
+[073]
+freq = 524250
+
+[074]
+freq = 530250
+
+[075]
+freq = 536250
+
+[076]
+freq = 542250
+
+[077]
+freq = 548250
+
+[078]
+freq = 554250
+
+[079]
+freq = 560250
+
+[080]
+freq = 566250
+
+[081]
+freq = 572250
+
+[082]
+freq = 578250
+
+[083]
+freq = 584250
+
+[084]
+freq = 590250
+
+[085]
+freq = 596250
+
+[086]
+freq = 602250
+
+[087]
+freq = 608250
+
+[088]
+freq = 614250
+
+[089]
+freq = 620250
+
+[090]
+freq = 626250
+
+[091]
+freq = 632250
+
+[092]
+freq = 638250
+
+[093]
+freq = 644250
+
diff --git a/frequencies/ccir-h.list b/frequencies/ccir-h.list
new file mode 100644
index 0000000..b92561b
--- /dev/null
+++ b/frequencies/ccir-h.list
@@ -0,0 +1,63 @@
+[S21]
+freq = 303250
+
+[S22]
+freq = 311250
+
+[S23]
+freq = 319250
+
+[S24]
+freq = 327250
+
+[S25]
+freq = 335250
+
+[S26]
+freq = 343250
+
+[S27]
+freq = 351250
+
+[S28]
+freq = 359250
+
+[S29]
+freq = 367250
+
+[S30]
+freq = 375250
+
+[S31]
+freq = 383250
+
+[S32]
+freq = 391250
+
+[S33]
+freq = 399250
+
+[S34]
+freq = 407250
+
+[S35]
+freq = 415250
+
+[S36]
+freq = 423250
+
+[S37]
+freq = 431250
+
+[S38]
+freq = 439250
+
+[S39]
+freq = 447250
+
+[S40]
+freq = 455250
+
+[S41]
+freq = 463250
+
diff --git a/frequencies/ccir-i-iii.list b/frequencies/ccir-i-iii.list
new file mode 100644
index 0000000..9dead34
--- /dev/null
+++ b/frequencies/ccir-i-iii.list
@@ -0,0 +1,42 @@
+[E2]
+freq = 48250
+
+[E3]
+freq = 55250
+
+[E4]
+freq = 62250
+
+[S01]
+freq = 69250
+
+[S02]
+freq = 76250
+
+[S03]
+freq = 83250
+
+[E5]
+freq = 175250
+
+[E6]
+freq = 182250
+
+[E7]
+freq = 189250
+
+[E8]
+freq = 196250
+
+[E9]
+freq = 203250
+
+[E10]
+freq = 210250
+
+[E11]
+freq = 217250
+
+[E12]
+freq = 224250
+
diff --git a/frequencies/ccir-sl-sh.list b/frequencies/ccir-sl-sh.list
new file mode 100644
index 0000000..620ffae
--- /dev/null
+++ b/frequencies/ccir-sl-sh.list
@@ -0,0 +1,60 @@
+[SE1]
+freq = 105250
+
+[SE2]
+freq = 112250
+
+[SE3]
+freq = 119250
+
+[SE4]
+freq = 126250
+
+[SE5]
+freq = 133250
+
+[SE6]
+freq = 140250
+
+[SE7]
+freq = 147250
+
+[SE8]
+freq = 154250
+
+[SE9]
+freq = 161250
+
+[SE10]
+freq = 168250
+
+[SE11]
+freq = 231250
+
+[SE12]
+freq = 238250
+
+[SE13]
+freq = 245250
+
+[SE14]
+freq = 252250
+
+[SE15]
+freq = 259250
+
+[SE16]
+freq = 266250
+
+[SE17]
+freq = 273250
+
+[SE18]
+freq = 280250
+
+[SE19]
+freq = 287250
+
+[SE20]
+freq = 294250
+
diff --git a/frequencies/europe-east.list b/frequencies/europe-east.list
new file mode 100644
index 0000000..cbbdb46
--- /dev/null
+++ b/frequencies/europe-east.list
@@ -0,0 +1,6 @@
+#include "oirt-i-iii.list"
+#include "oirt-sl-sh.list"
+#include "ccir-i-iii.list"
+#include "ccir-sl-sh.list"
+#include "ccir-h.list"
+#include "uhf.list"
diff --git a/frequencies/europe-west.list b/frequencies/europe-west.list
new file mode 100644
index 0000000..7eb053c
--- /dev/null
+++ b/frequencies/europe-west.list
@@ -0,0 +1,4 @@
+#include "ccir-i-iii.list"
+#include "ccir-sl-sh.list"
+#include "ccir-h.list"
+#include "uhf.list"
diff --git a/frequencies/init.pl b/frequencies/init.pl
new file mode 100644
index 0000000..6902b82
--- /dev/null
+++ b/frequencies/init.pl
@@ -0,0 +1,64 @@
+#!/usr/bin/perl
+use strict;
+
+sub fix_filename ($) {
+ my $name = shift @_;
+
+ $name =~ tr/_A-Z/-a-z/;
+ $name =~ s/^freq-//;
+ $name .= ".list";
+ return $name;
+}
+
+my ($name,$filename);
+
+while (<>) {
+
+ # channel lists
+ if (m/\{\s*\"(\w+)\",\s*(\w+)\s*\}/) {
+ print FILE "[$1]\n";
+ print FILE "freq = $2\n";
+ print FILE "\n";
+ next;
+ }
+ if (m/static struct CHANLIST (\w+)/) {
+ $filename = fix_filename($1);
+ close FILE;
+ open FILE, "> $filename" or die "open $filename: $!";
+ next;
+ }
+ if (m/\#define (FREQ_\w+)/) {
+ $filename = fix_filename($1);
+ close FILE;
+ open FILE, "> $filename" or die "open $filename: $!";
+ next;
+ }
+ if (m/^\s+(FREQ_\w+)/) {
+ $filename = fix_filename($1);
+ print FILE "#include \"$filename\"\n";
+ next;
+ }
+
+ # index file
+ if (m/struct CHANLISTS chanlists/) {
+ close FILE;
+ open FILE, "> Index.map" or die "open Index.map: $!";
+ }
+ if (m/\{\s*\"([-a-zA-Z]+)\",\s+(\w+)/) {
+ $name = $1;
+ $filename = fix_filename($2);
+ print FILE "[$name]\n";
+ print FILE "file = $filename\n";
+ print FILE "\n";
+ next;
+ }
+
+ next if m/\#include/;
+ next if m/^\/\*/;
+ next if m/^\s*};/;
+ next if m/^\s*$/;
+ next if m/^\s*\\\s*$/;
+
+ print "Oops: $_";
+}
+close FILE;
diff --git a/frequencies/ntsc-bcast-jp.list b/frequencies/ntsc-bcast-jp.list
new file mode 100644
index 0000000..ae8b14d
--- /dev/null
+++ b/frequencies/ntsc-bcast-jp.list
@@ -0,0 +1,186 @@
+[1]
+freq = 91250
+
+[2]
+freq = 97250
+
+[3]
+freq = 103250
+
+[4]
+freq = 171250
+
+[5]
+freq = 177250
+
+[6]
+freq = 183250
+
+[7]
+freq = 189250
+
+[8]
+freq = 193250
+
+[9]
+freq = 199250
+
+[10]
+freq = 205250
+
+[11]
+freq = 211250
+
+[12]
+freq = 217250
+
+[13]
+freq = 471250
+
+[14]
+freq = 477250
+
+[15]
+freq = 483250
+
+[16]
+freq = 489250
+
+[17]
+freq = 495250
+
+[18]
+freq = 501250
+
+[19]
+freq = 507250
+
+[20]
+freq = 513250
+
+[21]
+freq = 519250
+
+[22]
+freq = 525250
+
+[23]
+freq = 531250
+
+[24]
+freq = 537250
+
+[25]
+freq = 543250
+
+[26]
+freq = 549250
+
+[27]
+freq = 555250
+
+[28]
+freq = 561250
+
+[29]
+freq = 567250
+
+[30]
+freq = 573250
+
+[31]
+freq = 579250
+
+[32]
+freq = 585250
+
+[33]
+freq = 591250
+
+[34]
+freq = 597250
+
+[35]
+freq = 603250
+
+[36]
+freq = 609250
+
+[37]
+freq = 615250
+
+[38]
+freq = 621250
+
+[39]
+freq = 627250
+
+[40]
+freq = 633250
+
+[41]
+freq = 639250
+
+[42]
+freq = 645250
+
+[43]
+freq = 651250
+
+[44]
+freq = 657250
+
+[45]
+freq = 663250
+
+[46]
+freq = 669250
+
+[47]
+freq = 675250
+
+[48]
+freq = 681250
+
+[49]
+freq = 687250
+
+[50]
+freq = 693250
+
+[51]
+freq = 699250
+
+[52]
+freq = 705250
+
+[53]
+freq = 711250
+
+[54]
+freq = 717250
+
+[55]
+freq = 723250
+
+[56]
+freq = 729250
+
+[57]
+freq = 735250
+
+[58]
+freq = 741250
+
+[59]
+freq = 747250
+
+[60]
+freq = 753250
+
+[61]
+freq = 759250
+
+[62]
+freq = 765250
+
diff --git a/frequencies/ntsc-bcast.list b/frequencies/ntsc-bcast.list
new file mode 100644
index 0000000..6014be8
--- /dev/null
+++ b/frequencies/ntsc-bcast.list
@@ -0,0 +1,246 @@
+[2]
+freq = 55250
+
+[3]
+freq = 61250
+
+[4]
+freq = 67250
+
+[5]
+freq = 77250
+
+[6]
+freq = 83250
+
+[7]
+freq = 175250
+
+[8]
+freq = 181250
+
+[9]
+freq = 187250
+
+[10]
+freq = 193250
+
+[11]
+freq = 199250
+
+[12]
+freq = 205250
+
+[13]
+freq = 211250
+
+[14]
+freq = 471250
+
+[15]
+freq = 477250
+
+[16]
+freq = 483250
+
+[17]
+freq = 489250
+
+[18]
+freq = 495250
+
+[19]
+freq = 501250
+
+[20]
+freq = 507250
+
+[21]
+freq = 513250
+
+[22]
+freq = 519250
+
+[23]
+freq = 525250
+
+[24]
+freq = 531250
+
+[25]
+freq = 537250
+
+[26]
+freq = 543250
+
+[27]
+freq = 549250
+
+[28]
+freq = 555250
+
+[29]
+freq = 561250
+
+[30]
+freq = 567250
+
+[31]
+freq = 573250
+
+[32]
+freq = 579250
+
+[33]
+freq = 585250
+
+[34]
+freq = 591250
+
+[35]
+freq = 597250
+
+[36]
+freq = 603250
+
+[37]
+freq = 609250
+
+[38]
+freq = 615250
+
+[39]
+freq = 621250
+
+[40]
+freq = 627250
+
+[41]
+freq = 633250
+
+[42]
+freq = 639250
+
+[43]
+freq = 645250
+
+[44]
+freq = 651250
+
+[45]
+freq = 657250
+
+[46]
+freq = 663250
+
+[47]
+freq = 669250
+
+[48]
+freq = 675250
+
+[49]
+freq = 681250
+
+[50]
+freq = 687250
+
+[51]
+freq = 693250
+
+[52]
+freq = 699250
+
+[53]
+freq = 705250
+
+[54]
+freq = 711250
+
+[55]
+freq = 717250
+
+[56]
+freq = 723250
+
+[57]
+freq = 729250
+
+[58]
+freq = 735250
+
+[59]
+freq = 741250
+
+[60]
+freq = 747250
+
+[61]
+freq = 753250
+
+[62]
+freq = 759250
+
+[63]
+freq = 765250
+
+[64]
+freq = 771250
+
+[65]
+freq = 777250
+
+[66]
+freq = 783250
+
+[67]
+freq = 789250
+
+[68]
+freq = 795250
+
+[69]
+freq = 801250
+
+[70]
+freq = 807250
+
+[71]
+freq = 813250
+
+[72]
+freq = 819250
+
+[73]
+freq = 825250
+
+[74]
+freq = 831250
+
+[75]
+freq = 837250
+
+[76]
+freq = 843250
+
+[77]
+freq = 849250
+
+[78]
+freq = 855250
+
+[79]
+freq = 861250
+
+[80]
+freq = 867250
+
+[81]
+freq = 873250
+
+[82]
+freq = 879250
+
+[83]
+freq = 885250
+
diff --git a/frequencies/ntsc-cable-ca.list b/frequencies/ntsc-cable-ca.list
new file mode 100644
index 0000000..fa3b86d
--- /dev/null
+++ b/frequencies/ntsc-cable-ca.list
@@ -0,0 +1,372 @@
+[2]
+freq = 61750
+
+[3]
+freq = 67750
+
+[4]
+freq = 73750
+
+[5]
+freq = 83750
+
+[6]
+freq = 89750
+
+[7]
+freq = 181750
+
+[8]
+freq = 187750
+
+[9]
+freq = 193750
+
+[10]
+freq = 199750
+
+[11]
+freq = 205750
+
+[12]
+freq = 211750
+
+[13]
+freq = 217750
+
+[14]
+freq = 127750
+
+[15]
+freq = 133750
+
+[16]
+freq = 139750
+
+[17]
+freq = 145750
+
+[18]
+freq = 151750
+
+[19]
+freq = 157750
+
+[20]
+freq = 163750
+
+[21]
+freq = 169750
+
+[22]
+freq = 175750
+
+[23]
+freq = 223750
+
+[24]
+freq = 229750
+
+[25]
+freq = 235750
+
+[26]
+freq = 241750
+
+[27]
+freq = 247750
+
+[28]
+freq = 253750
+
+[29]
+freq = 259750
+
+[30]
+freq = 265750
+
+[31]
+freq = 271750
+
+[32]
+freq = 277750
+
+[33]
+freq = 283750
+
+[34]
+freq = 289750
+
+[35]
+freq = 295750
+
+[36]
+freq = 301750
+
+[37]
+freq = 307750
+
+[38]
+freq = 313750
+
+[39]
+freq = 319750
+
+[40]
+freq = 325750
+
+[41]
+freq = 331750
+
+[42]
+freq = 337750
+
+[43]
+freq = 343750
+
+[44]
+freq = 349750
+
+[45]
+freq = 355750
+
+[46]
+freq = 361750
+
+[47]
+freq = 367750
+
+[48]
+freq = 373750
+
+[49]
+freq = 379750
+
+[50]
+freq = 385750
+
+[51]
+freq = 391750
+
+[52]
+freq = 397750
+
+[53]
+freq = 403750
+
+[54]
+freq = 409750
+
+[55]
+freq = 415750
+
+[56]
+freq = 421750
+
+[57]
+freq = 427750
+
+[58]
+freq = 433750
+
+[59]
+freq = 439750
+
+[60]
+freq = 445750
+
+[61]
+freq = 451750
+
+[62]
+freq = 457750
+
+[63]
+freq = 463750
+
+[64]
+freq = 469750
+
+[65]
+freq = 475750
+
+[66]
+freq = 481750
+
+[67]
+freq = 487750
+
+[68]
+freq = 493750
+
+[69]
+freq = 499750
+
+[70]
+freq = 505750
+
+[71]
+freq = 511750
+
+[72]
+freq = 517750
+
+[73]
+freq = 523750
+
+[74]
+freq = 529750
+
+[75]
+freq = 535750
+
+[76]
+freq = 541750
+
+[77]
+freq = 547750
+
+[78]
+freq = 553750
+
+[79]
+freq = 559750
+
+[80]
+freq = 565750
+
+[81]
+freq = 571750
+
+[82]
+freq = 577750
+
+[83]
+freq = 583750
+
+[84]
+freq = 589750
+
+[85]
+freq = 595750
+
+[86]
+freq = 601750
+
+[87]
+freq = 607750
+
+[88]
+freq = 613750
+
+[89]
+freq = 619750
+
+[90]
+freq = 625750
+
+[91]
+freq = 631750
+
+[92]
+freq = 637750
+
+[93]
+freq = 643750
+
+[94]
+freq = 649750
+
+[95]
+freq = 97750
+
+[96]
+freq = 103750
+
+[97]
+freq = 109750
+
+[98]
+freq = 115750
+
+[99]
+freq = 121750
+
+[100]
+freq = 655750
+
+[101]
+freq = 661750
+
+[102]
+freq = 667750
+
+[103]
+freq = 673750
+
+[104]
+freq = 679750
+
+[105]
+freq = 685750
+
+[106]
+freq = 691750
+
+[107]
+freq = 697750
+
+[108]
+freq = 703750
+
+[109]
+freq = 709750
+
+[110]
+freq = 715750
+
+[111]
+freq = 721750
+
+[112]
+freq = 727750
+
+[113]
+freq = 733750
+
+[114]
+freq = 739750
+
+[115]
+freq = 745750
+
+[116]
+freq = 751750
+
+[117]
+freq = 757750
+
+[118]
+freq = 763750
+
+[119]
+freq = 769750
+
+[120]
+freq = 775750
+
+[121]
+freq = 781750
+
+[122]
+freq = 787750
+
+[123]
+freq = 793750
+
+[124]
+freq = 799750
+
+[125]
+freq = 805750
+
diff --git a/frequencies/ntsc-cable-jp.list b/frequencies/ntsc-cable-jp.list
new file mode 100644
index 0000000..091c2e3
--- /dev/null
+++ b/frequencies/ntsc-cable-jp.list
@@ -0,0 +1,153 @@
+[13]
+freq = 109250
+
+[14]
+freq = 115250
+
+[15]
+freq = 121250
+
+[16]
+freq = 127250
+
+[17]
+freq = 133250
+
+[18]
+freq = 139250
+
+[19]
+freq = 145250
+
+[20]
+freq = 151250
+
+[21]
+freq = 157250
+
+[22]
+freq = 165250
+
+[23]
+freq = 223250
+
+[24]
+freq = 231250
+
+[25]
+freq = 237250
+
+[26]
+freq = 243250
+
+[27]
+freq = 249250
+
+[28]
+freq = 253250
+
+[29]
+freq = 259250
+
+[30]
+freq = 265250
+
+[31]
+freq = 271250
+
+[32]
+freq = 277250
+
+[33]
+freq = 283250
+
+[34]
+freq = 289250
+
+[35]
+freq = 295250
+
+[36]
+freq = 301250
+
+[37]
+freq = 307250
+
+[38]
+freq = 313250
+
+[39]
+freq = 319250
+
+[40]
+freq = 325250
+
+[41]
+freq = 331250
+
+[42]
+freq = 337250
+
+[43]
+freq = 343250
+
+[44]
+freq = 349250
+
+[45]
+freq = 355250
+
+[46]
+freq = 361250
+
+[47]
+freq = 367250
+
+[48]
+freq = 373250
+
+[49]
+freq = 379250
+
+[50]
+freq = 385250
+
+[51]
+freq = 391250
+
+[52]
+freq = 397250
+
+[53]
+freq = 403250
+
+[54]
+freq = 409250
+
+[55]
+freq = 415250
+
+[56]
+freq = 421250
+
+[57]
+freq = 427250
+
+[58]
+freq = 433250
+
+[59]
+freq = 439250
+
+[60]
+freq = 445250
+
+[61]
+freq = 451250
+
+[62]
+freq = 457250
+
+[63]
+freq = 463250
+
diff --git a/frequencies/ntsc-cable.list b/frequencies/ntsc-cable.list
new file mode 100644
index 0000000..d66a2f7
--- /dev/null
+++ b/frequencies/ntsc-cable.list
@@ -0,0 +1,399 @@
+[1]
+freq = 73250
+
+[2]
+freq = 55250
+
+[3]
+freq = 61250
+
+[4]
+freq = 67250
+
+[5]
+freq = 77250
+
+[6]
+freq = 83250
+
+[7]
+freq = 175250
+
+[8]
+freq = 181250
+
+[9]
+freq = 187250
+
+[10]
+freq = 193250
+
+[11]
+freq = 199250
+
+[12]
+freq = 205250
+
+[13]
+freq = 211250
+
+[14]
+freq = 121250
+
+[15]
+freq = 127250
+
+[16]
+freq = 133250
+
+[17]
+freq = 139250
+
+[18]
+freq = 145250
+
+[19]
+freq = 151250
+
+[20]
+freq = 157250
+
+[21]
+freq = 163250
+
+[22]
+freq = 169250
+
+[23]
+freq = 217250
+
+[24]
+freq = 223250
+
+[25]
+freq = 229250
+
+[26]
+freq = 235250
+
+[27]
+freq = 241250
+
+[28]
+freq = 247250
+
+[29]
+freq = 253250
+
+[30]
+freq = 259250
+
+[31]
+freq = 265250
+
+[32]
+freq = 271250
+
+[33]
+freq = 277250
+
+[34]
+freq = 283250
+
+[35]
+freq = 289250
+
+[36]
+freq = 295250
+
+[37]
+freq = 301250
+
+[38]
+freq = 307250
+
+[39]
+freq = 313250
+
+[40]
+freq = 319250
+
+[41]
+freq = 325250
+
+[42]
+freq = 331250
+
+[43]
+freq = 337250
+
+[44]
+freq = 343250
+
+[45]
+freq = 349250
+
+[46]
+freq = 355250
+
+[47]
+freq = 361250
+
+[48]
+freq = 367250
+
+[49]
+freq = 373250
+
+[50]
+freq = 379250
+
+[51]
+freq = 385250
+
+[52]
+freq = 391250
+
+[53]
+freq = 397250
+
+[54]
+freq = 403250
+
+[55]
+freq = 409250
+
+[56]
+freq = 415250
+
+[57]
+freq = 421250
+
+[58]
+freq = 427250
+
+[59]
+freq = 433250
+
+[60]
+freq = 439250
+
+[61]
+freq = 445250
+
+[62]
+freq = 451250
+
+[63]
+freq = 457250
+
+[64]
+freq = 463250
+
+[65]
+freq = 469250
+
+[66]
+freq = 475250
+
+[67]
+freq = 481250
+
+[68]
+freq = 487250
+
+[69]
+freq = 493250
+
+[70]
+freq = 499250
+
+[71]
+freq = 505250
+
+[72]
+freq = 511250
+
+[73]
+freq = 517250
+
+[74]
+freq = 523250
+
+[75]
+freq = 529250
+
+[76]
+freq = 535250
+
+[77]
+freq = 541250
+
+[78]
+freq = 547250
+
+[79]
+freq = 553250
+
+[80]
+freq = 559250
+
+[81]
+freq = 565250
+
+[82]
+freq = 571250
+
+[83]
+freq = 577250
+
+[84]
+freq = 583250
+
+[85]
+freq = 589250
+
+[86]
+freq = 595250
+
+[87]
+freq = 601250
+
+[88]
+freq = 607250
+
+[89]
+freq = 613250
+
+[90]
+freq = 619250
+
+[91]
+freq = 625250
+
+[92]
+freq = 631250
+
+[93]
+freq = 637250
+
+[94]
+freq = 643250
+
+[95]
+freq = 91250
+
+[96]
+freq = 97250
+
+[97]
+freq = 103250
+
+[98]
+freq = 109250
+
+[99]
+freq = 115250
+
+[100]
+freq = 649250
+
+[101]
+freq = 655250
+
+[102]
+freq = 661250
+
+[103]
+freq = 667250
+
+[104]
+freq = 673250
+
+[105]
+freq = 679250
+
+[106]
+freq = 685250
+
+[107]
+freq = 691250
+
+[108]
+freq = 697250
+
+[109]
+freq = 703250
+
+[110]
+freq = 709250
+
+[111]
+freq = 715250
+
+[112]
+freq = 721250
+
+[113]
+freq = 727250
+
+[114]
+freq = 733250
+
+[115]
+freq = 739250
+
+[116]
+freq = 745250
+
+[117]
+freq = 751250
+
+[118]
+freq = 757250
+
+[119]
+freq = 763250
+
+[120]
+freq = 769250
+
+[121]
+freq = 775250
+
+[122]
+freq = 781250
+
+[123]
+freq = 787250
+
+[124]
+freq = 793250
+
+[125]
+freq = 799250
+
+[T7]
+freq = 8250
+
+[T8]
+freq = 14250
+
+[T9]
+freq = 20250
+
+[T10]
+freq = 26250
+
+[T11]
+freq = 32250
+
+[T12]
+freq = 38250
+
+[T13]
+freq = 44250
+
+[T14]
+freq = 50250
+
diff --git a/frequencies/ntsc-hrc.list b/frequencies/ntsc-hrc.list
new file mode 100644
index 0000000..f5f40ed
--- /dev/null
+++ b/frequencies/ntsc-hrc.list
@@ -0,0 +1,399 @@
+[1]
+freq = 72000
+
+[2]
+freq = 54000
+
+[3]
+freq = 60000
+
+[4]
+freq = 66000
+
+[5]
+freq = 78000
+
+[6]
+freq = 84000
+
+[7]
+freq = 174000
+
+[8]
+freq = 180000
+
+[9]
+freq = 186000
+
+[10]
+freq = 192000
+
+[11]
+freq = 198000
+
+[12]
+freq = 204000
+
+[13]
+freq = 210000
+
+[14]
+freq = 120000
+
+[15]
+freq = 126000
+
+[16]
+freq = 132000
+
+[17]
+freq = 138000
+
+[18]
+freq = 144000
+
+[19]
+freq = 150000
+
+[20]
+freq = 156000
+
+[21]
+freq = 162000
+
+[22]
+freq = 168000
+
+[23]
+freq = 216000
+
+[24]
+freq = 222000
+
+[25]
+freq = 228000
+
+[26]
+freq = 234000
+
+[27]
+freq = 240000
+
+[28]
+freq = 246000
+
+[29]
+freq = 252000
+
+[30]
+freq = 258000
+
+[31]
+freq = 264000
+
+[32]
+freq = 270000
+
+[33]
+freq = 276000
+
+[34]
+freq = 282000
+
+[35]
+freq = 288000
+
+[36]
+freq = 294000
+
+[37]
+freq = 300000
+
+[38]
+freq = 306000
+
+[39]
+freq = 312000
+
+[40]
+freq = 318000
+
+[41]
+freq = 324000
+
+[42]
+freq = 330000
+
+[43]
+freq = 336000
+
+[44]
+freq = 342000
+
+[45]
+freq = 348000
+
+[46]
+freq = 354000
+
+[47]
+freq = 360000
+
+[48]
+freq = 366000
+
+[49]
+freq = 372000
+
+[50]
+freq = 378000
+
+[51]
+freq = 384000
+
+[52]
+freq = 390000
+
+[53]
+freq = 396000
+
+[54]
+freq = 402000
+
+[55]
+freq = 408000
+
+[56]
+freq = 414000
+
+[57]
+freq = 420000
+
+[58]
+freq = 426000
+
+[59]
+freq = 432000
+
+[60]
+freq = 438000
+
+[61]
+freq = 444000
+
+[62]
+freq = 450000
+
+[63]
+freq = 456000
+
+[64]
+freq = 462000
+
+[65]
+freq = 468000
+
+[66]
+freq = 474000
+
+[67]
+freq = 480000
+
+[68]
+freq = 486000
+
+[69]
+freq = 492000
+
+[70]
+freq = 498000
+
+[71]
+freq = 504000
+
+[72]
+freq = 510000
+
+[73]
+freq = 516000
+
+[74]
+freq = 522000
+
+[75]
+freq = 528000
+
+[76]
+freq = 534000
+
+[77]
+freq = 540000
+
+[78]
+freq = 546000
+
+[79]
+freq = 552000
+
+[80]
+freq = 558000
+
+[81]
+freq = 564000
+
+[82]
+freq = 570000
+
+[83]
+freq = 576000
+
+[84]
+freq = 582000
+
+[85]
+freq = 588000
+
+[86]
+freq = 594000
+
+[87]
+freq = 600000
+
+[88]
+freq = 606000
+
+[89]
+freq = 612000
+
+[90]
+freq = 618000
+
+[91]
+freq = 624000
+
+[92]
+freq = 630000
+
+[93]
+freq = 636000
+
+[94]
+freq = 642000
+
+[95]
+freq = 900000
+
+[96]
+freq = 960000
+
+[97]
+freq = 102000
+
+[98]
+freq = 108000
+
+[99]
+freq = 114000
+
+[100]
+freq = 648000
+
+[101]
+freq = 654000
+
+[102]
+freq = 660000
+
+[103]
+freq = 666000
+
+[104]
+freq = 672000
+
+[105]
+freq = 678000
+
+[106]
+freq = 684000
+
+[107]
+freq = 690000
+
+[108]
+freq = 696000
+
+[109]
+freq = 702000
+
+[110]
+freq = 708000
+
+[111]
+freq = 714000
+
+[112]
+freq = 720000
+
+[113]
+freq = 726000
+
+[114]
+freq = 732000
+
+[115]
+freq = 738000
+
+[116]
+freq = 744000
+
+[117]
+freq = 750000
+
+[118]
+freq = 756000
+
+[119]
+freq = 762000
+
+[120]
+freq = 768000
+
+[121]
+freq = 774000
+
+[122]
+freq = 780000
+
+[123]
+freq = 786000
+
+[124]
+freq = 792000
+
+[125]
+freq = 798000
+
+[T7]
+freq = 7000
+
+[T8]
+freq = 13000
+
+[T9]
+freq = 19000
+
+[T10]
+freq = 25000
+
+[T11]
+freq = 31000
+
+[T12]
+freq = 37000
+
+[T13]
+freq = 43000
+
+[T14]
+freq = 49000
+
diff --git a/frequencies/oirt-i-iii.list b/frequencies/oirt-i-iii.list
new file mode 100644
index 0000000..dc351fc
--- /dev/null
+++ b/frequencies/oirt-i-iii.list
@@ -0,0 +1,36 @@
+[R1]
+freq = 49750
+
+[R2]
+freq = 59250
+
+[R3]
+freq = 77250
+
+[R4]
+freq = 85250
+
+[R5]
+freq = 93250
+
+[R6]
+freq = 175250
+
+[R7]
+freq = 183250
+
+[R8]
+freq = 191250
+
+[R9]
+freq = 199250
+
+[R10]
+freq = 207250
+
+[R11]
+freq = 215250
+
+[R12]
+freq = 223250
+
diff --git a/frequencies/oirt-sl-sh.list b/frequencies/oirt-sl-sh.list
new file mode 100644
index 0000000..9b054d2
--- /dev/null
+++ b/frequencies/oirt-sl-sh.list
@@ -0,0 +1,51 @@
+[SR1]
+freq = 111250
+
+[SR2]
+freq = 119250
+
+[SR3]
+freq = 127250
+
+[SR4]
+freq = 135250
+
+[SR5]
+freq = 143250
+
+[SR6]
+freq = 151250
+
+[SR7]
+freq = 159250
+
+[SR8]
+freq = 167250
+
+[SR11]
+freq = 231250
+
+[SR12]
+freq = 239250
+
+[SR13]
+freq = 247250
+
+[SR14]
+freq = 255250
+
+[SR15]
+freq = 263250
+
+[SR16]
+freq = 271250
+
+[SR17]
+freq = 279250
+
+[SR18]
+freq = 287250
+
+[SR19]
+freq = 295250
+
diff --git a/frequencies/pal-australia-optus.list b/frequencies/pal-australia-optus.list
new file mode 100644
index 0000000..b84016b
--- /dev/null
+++ b/frequencies/pal-australia-optus.list
@@ -0,0 +1,144 @@
+[1]
+freq = 138250
+
+[2]
+freq = 147250
+
+[3]
+freq = 154250
+
+[4]
+freq = 161250
+
+[5]
+freq = 168250
+
+[6]
+freq = 175250
+
+[7]
+freq = 182250
+
+[8]
+freq = 189250
+
+[9]
+freq = 196250
+
+[10]
+freq = 209250
+
+[11]
+freq = 216250
+
+[12]
+freq = 224250
+
+[13]
+freq = 231250
+
+[14]
+freq = 238250
+
+[15]
+freq = 245250
+
+[16]
+freq = 252250
+
+[17]
+freq = 259250
+
+[18]
+freq = 266250
+
+[19]
+freq = 273250
+
+[20]
+freq = 280250
+
+[21]
+freq = 287250
+
+[22]
+freq = 294250
+
+[23]
+freq = 303250
+
+[24]
+freq = 310250
+
+[25]
+freq = 317250
+
+[26]
+freq = 324250
+
+[27]
+freq = 338250
+
+[28]
+freq = 345250
+
+[29]
+freq = 352250
+
+[30]
+freq = 359250
+
+[31]
+freq = 366250
+
+[32]
+freq = 373250
+
+[33]
+freq = 380250
+
+[34]
+freq = 387250
+
+[35]
+freq = 394250
+
+[36]
+freq = 401250
+
+[37]
+freq = 408250
+
+[38]
+freq = 415250
+
+[39]
+freq = 422250
+
+[40]
+freq = 429250
+
+[41]
+freq = 436250
+
+[42]
+freq = 443250
+
+[43]
+freq = 450250
+
+[44]
+freq = 457250
+
+[45]
+freq = 464250
+
+[46]
+freq = 471250
+
+[47]
+freq = 478250
+
+[48]
+freq = 485250
+
diff --git a/frequencies/pal-australia.list b/frequencies/pal-australia.list
new file mode 100644
index 0000000..c857f8c
--- /dev/null
+++ b/frequencies/pal-australia.list
@@ -0,0 +1,159 @@
+[0]
+freq = 46250
+
+[1]
+freq = 57250
+
+[2]
+freq = 64250
+
+[3]
+freq = 86250
+
+[4]
+freq = 95250
+
+[5]
+freq = 102250
+
+[5A]
+freq = 138250
+
+[6]
+freq = 175250
+
+[7]
+freq = 182250
+
+[8]
+freq = 189250
+
+[9]
+freq = 196250
+
+[10]
+freq = 209250
+
+[11]
+freq = 216250
+
+[28]
+freq = 527250
+
+[29]
+freq = 534250
+
+[30]
+freq = 541250
+
+[31]
+freq = 548250
+
+[32]
+freq = 555250
+
+[33]
+freq = 562250
+
+[34]
+freq = 569250
+
+[35]
+freq = 576250
+
+[36]
+freq = 591250
+
+[39]
+freq = 604250
+
+[40]
+freq = 611250
+
+[41]
+freq = 618250
+
+[42]
+freq = 625250
+
+[43]
+freq = 632250
+
+[44]
+freq = 639250
+
+[45]
+freq = 646250
+
+[46]
+freq = 653250
+
+[47]
+freq = 660250
+
+[48]
+freq = 667250
+
+[49]
+freq = 674250
+
+[50]
+freq = 681250
+
+[51]
+freq = 688250
+
+[52]
+freq = 695250
+
+[53]
+freq = 702250
+
+[54]
+freq = 709250
+
+[55]
+freq = 716250
+
+[56]
+freq = 723250
+
+[57]
+freq = 730250
+
+[58]
+freq = 737250
+
+[59]
+freq = 744250
+
+[60]
+freq = 751250
+
+[61]
+freq = 758250
+
+[62]
+freq = 765250
+
+[63]
+freq = 772250
+
+[64]
+freq = 779250
+
+[65]
+freq = 786250
+
+[66]
+freq = 793250
+
+[67]
+freq = 800250
+
+[68]
+freq = 807250
+
+[69]
+freq = 814250
+
diff --git a/frequencies/pal-bcast-cn.list b/frequencies/pal-bcast-cn.list
new file mode 100644
index 0000000..5ec6383
--- /dev/null
+++ b/frequencies/pal-bcast-cn.list
@@ -0,0 +1,282 @@
+[1]
+freq = 49750
+
+[2]
+freq = 57750
+
+[3]
+freq = 65750
+
+[4]
+freq = 77250
+
+[5]
+freq = 85250
+
+[6]
+freq = 112250
+
+[7]
+freq = 120250
+
+[8]
+freq = 128250
+
+[9]
+freq = 136250
+
+[10]
+freq = 144250
+
+[11]
+freq = 152250
+
+[12]
+freq = 160250
+
+[13]
+freq = 168250
+
+[14]
+freq = 176250
+
+[15]
+freq = 184250
+
+[16]
+freq = 192250
+
+[17]
+freq = 200250
+
+[18]
+freq = 208250
+
+[19]
+freq = 216250
+
+[20]
+freq = 224250
+
+[21]
+freq = 232250
+
+[22]
+freq = 240250
+
+[23]
+freq = 248250
+
+[24]
+freq = 256250
+
+[25]
+freq = 264250
+
+[26]
+freq = 272250
+
+[27]
+freq = 280250
+
+[28]
+freq = 288250
+
+[29]
+freq = 296250
+
+[30]
+freq = 304250
+
+[31]
+freq = 312250
+
+[32]
+freq = 320250
+
+[33]
+freq = 328250
+
+[34]
+freq = 336250
+
+[35]
+freq = 344250
+
+[36]
+freq = 352250
+
+[37]
+freq = 360250
+
+[38]
+freq = 368250
+
+[39]
+freq = 376250
+
+[40]
+freq = 384250
+
+[41]
+freq = 392250
+
+[42]
+freq = 400250
+
+[43]
+freq = 408250
+
+[44]
+freq = 416250
+
+[45]
+freq = 424250
+
+[46]
+freq = 432250
+
+[47]
+freq = 440250
+
+[48]
+freq = 448250
+
+[49]
+freq = 456250
+
+[50]
+freq = 463250
+
+[51]
+freq = 471250
+
+[52]
+freq = 479250
+
+[53]
+freq = 487250
+
+[54]
+freq = 495250
+
+[55]
+freq = 503250
+
+[56]
+freq = 511250
+
+[57]
+freq = 519250
+
+[58]
+freq = 527250
+
+[59]
+freq = 535250
+
+[60]
+freq = 543250
+
+[61]
+freq = 551250
+
+[62]
+freq = 559250
+
+[63]
+freq = 607250
+
+[64]
+freq = 615250
+
+[65]
+freq = 623250
+
+[66]
+freq = 631250
+
+[67]
+freq = 639250
+
+[68]
+freq = 647250
+
+[69]
+freq = 655250
+
+[70]
+freq = 663250
+
+[71]
+freq = 671250
+
+[72]
+freq = 679250
+
+[73]
+freq = 687250
+
+[74]
+freq = 695250
+
+[75]
+freq = 703250
+
+[76]
+freq = 711250
+
+[77]
+freq = 719250
+
+[78]
+freq = 727250
+
+[79]
+freq = 735250
+
+[80]
+freq = 743250
+
+[81]
+freq = 751250
+
+[82]
+freq = 759250
+
+[83]
+freq = 767250
+
+[84]
+freq = 775250
+
+[85]
+freq = 783250
+
+[86]
+freq = 791250
+
+[87]
+freq = 799250
+
+[88]
+freq = 807250
+
+[89]
+freq = 815250
+
+[90]
+freq = 823250
+
+[91]
+freq = 831250
+
+[92]
+freq = 839250
+
+[93]
+freq = 847250
+
+[94]
+freq = 855250
+
diff --git a/frequencies/pal-bcast-za.list b/frequencies/pal-bcast-za.list
new file mode 100644
index 0000000..ea1e70f
--- /dev/null
+++ b/frequencies/pal-bcast-za.list
@@ -0,0 +1,40 @@
+[1]
+freq = 175250
+
+[2]
+freq = 183250
+
+[3]
+freq = 191250
+
+[4]
+freq = 199250
+
+[5]
+freq = 207250
+
+[6]
+freq = 215250
+
+[7]
+freq = 223250
+
+[8]
+freq = 231250
+
+[9]
+freq = 239250
+
+[10]
+freq = 247250
+
+[11]
+freq = 255250
+
+[12]
+freq = 263250
+
+[13]
+freq = 271250
+
+#include "uhf.list"
diff --git a/frequencies/pal-ireland.list b/frequencies/pal-ireland.list
new file mode 100644
index 0000000..49d4685
--- /dev/null
+++ b/frequencies/pal-ireland.list
@@ -0,0 +1,112 @@
+[A0]
+freq = 45750
+
+[A1]
+freq = 48000
+
+[A2]
+freq = 53750
+
+[A3]
+freq = 56000
+
+[A4]
+freq = 61750
+
+[A5]
+freq = 64000
+
+[A6]
+freq = 175250
+
+[A7]
+freq = 176000
+
+[A8]
+freq = 183250
+
+[A9]
+freq = 184000
+
+[A10]
+freq = 191250
+
+[A11]
+freq = 192000
+
+[A12]
+freq = 199250
+
+[A13]
+freq = 200000
+
+[A14]
+freq = 207250
+
+[A15]
+freq = 208000
+
+[A16]
+freq = 215250
+
+[A17]
+freq = 216000
+
+[A18]
+freq = 224000
+
+[A19]
+freq = 232000
+
+[A20]
+freq = 248000
+
+[A21]
+freq = 256000
+
+[A22]
+freq = 264000
+
+[A23]
+freq = 272000
+
+[A24]
+freq = 280000
+
+[A25]
+freq = 288000
+
+[A26]
+freq = 296000
+
+[A27]
+freq = 304000
+
+[A28]
+freq = 312000
+
+[A29]
+freq = 320000
+
+[A30]
+freq = 344000
+
+[A31]
+freq = 352000
+
+[A32]
+freq = 408000
+
+[A33]
+freq = 416000
+
+[A34]
+freq = 448000
+
+[A35]
+freq = 480000
+
+[A36]
+freq = 520000
+
+#include "uhf.list"
diff --git a/frequencies/pal-italy.list b/frequencies/pal-italy.list
new file mode 100644
index 0000000..ff75b1f
--- /dev/null
+++ b/frequencies/pal-italy.list
@@ -0,0 +1,31 @@
+[A]
+freq = 53750
+
+[B]
+freq = 62250
+
+[C]
+freq = 82250
+
+[D]
+freq = 175250
+
+[E]
+freq = 183750
+
+[F]
+freq = 192250
+
+[G]
+freq = 201250
+
+[H]
+freq = 210250
+
+[H1]
+freq = 217250
+
+[H2]
+freq = 224250
+
+#include "uhf.list"
diff --git a/frequencies/pal-newzealand.list b/frequencies/pal-newzealand.list
new file mode 100644
index 0000000..66c6a53
--- /dev/null
+++ b/frequencies/pal-newzealand.list
@@ -0,0 +1,34 @@
+[1]
+freq = 45250
+
+[2]
+freq = 55250
+
+[3]
+freq = 62250
+
+[4]
+freq = 175250
+
+[5]
+freq = 182250
+
+[6]
+freq = 189250
+
+[7]
+freq = 196250
+
+[8]
+freq = 203250
+
+[9]
+freq = 210250
+
+[10]
+freq = 217250
+
+[11]
+freq = 224250
+
+#include "uhf.list"
diff --git a/frequencies/secam-france.list b/frequencies/secam-france.list
new file mode 100644
index 0000000..e0f46e4
--- /dev/null
+++ b/frequencies/secam-france.list
@@ -0,0 +1,136 @@
+[K01]
+freq = 47750
+
+[K02]
+freq = 55750
+
+[K03]
+freq = 60500
+
+[K04]
+freq = 63750
+
+[K05]
+freq = 176000
+
+[K06]
+freq = 184000
+
+[K07]
+freq = 192000
+
+[K08]
+freq = 200000
+
+[K09]
+freq = 208000
+
+[K10]
+freq = 216000
+
+[KB]
+freq = 116750
+
+[KC]
+freq = 128750
+
+[KD]
+freq = 140750
+
+[KE]
+freq = 159750
+
+[KF]
+freq = 164750
+
+[KG]
+freq = 176750
+
+[KH]
+freq = 188750
+
+[KI]
+freq = 200750
+
+[KJ]
+freq = 212750
+
+[KK]
+freq = 224750
+
+[KL]
+freq = 236750
+
+[KM]
+freq = 248750
+
+[KN]
+freq = 260750
+
+[KO]
+freq = 272750
+
+[KP]
+freq = 284750
+
+[KQ]
+freq = 296750
+
+[H01]
+freq = 303250
+
+[H02]
+freq = 311250
+
+[H03]
+freq = 319250
+
+[H04]
+freq = 327250
+
+[H05]
+freq = 335250
+
+[H06]
+freq = 343250
+
+[H07]
+freq = 351250
+
+[H08]
+freq = 359250
+
+[H09]
+freq = 367250
+
+[H10]
+freq = 375250
+
+[H11]
+freq = 383250
+
+[H12]
+freq = 391250
+
+[H13]
+freq = 399250
+
+[H14]
+freq = 407250
+
+[H15]
+freq = 415250
+
+[H16]
+freq = 423250
+
+[H17]
+freq = 431250
+
+[H18]
+freq = 439250
+
+[H19]
+freq = 447250
+
+#include "uhf.list"
diff --git a/frequencies/uhf.list b/frequencies/uhf.list
new file mode 100644
index 0000000..43a98e6
--- /dev/null
+++ b/frequencies/uhf.list
@@ -0,0 +1,147 @@
+[21]
+freq = 471250
+
+[22]
+freq = 479250
+
+[23]
+freq = 487250
+
+[24]
+freq = 495250
+
+[25]
+freq = 503250
+
+[26]
+freq = 511250
+
+[27]
+freq = 519250
+
+[28]
+freq = 527250
+
+[29]
+freq = 535250
+
+[30]
+freq = 543250
+
+[31]
+freq = 551250
+
+[32]
+freq = 559250
+
+[33]
+freq = 567250
+
+[34]
+freq = 575250
+
+[35]
+freq = 583250
+
+[36]
+freq = 591250
+
+[37]
+freq = 599250
+
+[38]
+freq = 607250
+
+[39]
+freq = 615250
+
+[40]
+freq = 623250
+
+[41]
+freq = 631250
+
+[42]
+freq = 639250
+
+[43]
+freq = 647250
+
+[44]
+freq = 655250
+
+[45]
+freq = 663250
+
+[46]
+freq = 671250
+
+[47]
+freq = 679250
+
+[48]
+freq = 687250
+
+[49]
+freq = 695250
+
+[50]
+freq = 703250
+
+[51]
+freq = 711250
+
+[52]
+freq = 719250
+
+[53]
+freq = 727250
+
+[54]
+freq = 735250
+
+[55]
+freq = 743250
+
+[56]
+freq = 751250
+
+[57]
+freq = 759250
+
+[58]
+freq = 767250
+
+[59]
+freq = 775250
+
+[60]
+freq = 783250
+
+[61]
+freq = 791250
+
+[62]
+freq = 799250
+
+[63]
+freq = 807250
+
+[64]
+freq = 815250
+
+[65]
+freq = 823250
+
+[66]
+freq = 831250
+
+[67]
+freq = 839250
+
+[68]
+freq = 847250
+
+[69]
+freq = 855250
+
diff --git a/libng/contrib-plugins/Subdir.mk b/libng/contrib-plugins/Subdir.mk
index 2841fc8..a34a2c4 100644
--- a/libng/contrib-plugins/Subdir.mk
+++ b/libng/contrib-plugins/Subdir.mk
@@ -1,12 +1,25 @@
# targets to build
TARGETS-contrib-plugins := \
- libng/contrib-plugins/flt-smooth.so
+ libng/contrib-plugins/flt-smooth.so \
+ libng/contrib-plugins/bilinear.so \
+ libng/contrib-plugins/cubic.so \
+ libng/contrib-plugins/linear-blend.so \
+ libng/contrib-plugins/linedoubler.so
+
ifeq ($(FOUND_ALSA),yes)
TARGETS-contrib-plugins += \
libng/contrib-plugins/snd-alsa.so
endif
+# alsa is c++ and thus we should call g++ for linking ...
+libng/contrib-plugins/snd-alsa.so : CC := $(CXX)
+
+# linear-blend has mmx support ...
+ifeq ($(USE_MMX),yes)
+libng/contrib-plugins/linear-blend.so : CFLAGS += -DMMX=1
+endif
+
# global targets
all:: $(TARGETS-contrib-plugins)
@@ -17,5 +30,9 @@ install::
clean::
rm -f $(TARGETS-contrib-plugins)
-libng/contrib-plugins/flt-smooth.so: libng/contrib-plugins/flt-smooth.o
-libng/contrib-plugins/snd-alsa.so: libng/contrib-plugins/snd-alsa.o
+libng/contrib-plugins/flt-smooth.so: libng/contrib-plugins/flt-smooth.o
+libng/contrib-plugins/snd-alsa.so: libng/contrib-plugins/snd-alsa.o
+libng/contrib-plugins/bilinear.so: libng/contrib-plugins/bilinear.o
+libng/contrib-pluginsa/cubic.so: libng/contrib-plugins/cubic.o
+libng/contrib-plugins/linear-blend.so: libng/contrib-plugins/linear-blend.o
+libng/contrib-plugins/linedoubler.so: libng/contrib-plugins/linedoubler.o
diff --git a/libng/contrib-plugins/bilinear.c b/libng/contrib-plugins/bilinear.c
new file mode 100644
index 0000000..e9ff9df
--- /dev/null
+++ b/libng/contrib-plugins/bilinear.c
@@ -0,0 +1,89 @@
+/*
+ * Simple xawtv deinterlacing plugin - bilinear interpolation
+ *
+ * CAVEATS: Effectively halves framerate, (working on it)
+ * May cause some general slowness (uses more cpu) but the framerate is smooth
+ * on my athlon 700, running the -mjc branch of 2.4 kernel (preempt and other
+ * patches for desktop performance)
+ * Text (in console games for example) looks really ugly
+ *
+ * BENEFITS: It's no longer interlaced ;)
+ * Looks a metric shitton better than line doubling
+ *
+ * AUTHORS:
+ * Conrad Kreyling <conrad@conrad.nerdland.org>
+ * Patrick Barrett <yebyen@nerdland.org>
+ *
+ * This is licenced under the GNU GPL until someone tells me I'm stealing code
+ * and can't do that ;) www.gnu.org for any version of the license.
+ *
+ * Based on xawtv-3.66/libng/plugins/flt-nop.c (also GPL)
+ */
+
+
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+
+#include "grab-ng.h"
+
+static void inline
+deinterlace (struct ng_video_buf *frame)
+{
+ int x, y;
+
+ for (y = 1; y < frame->fmt.height - 1; y += 2)
+ for (x = 0; x < frame->fmt.bytesperline + 1; x++)
+ (frame->data[y * (frame->fmt.bytesperline) + x]) =
+ ((frame->data[((y - 1) * (frame->fmt.bytesperline)) + x]) +
+ (frame->data[((y + 1) * (frame->fmt.bytesperline)) + x])) >> 1;
+
+}
+
+
+static void *
+init (struct ng_video_fmt *out)
+{
+ /* don't have to carry around status info */
+ static int dummy;
+ return &dummy;
+}
+
+static struct ng_video_buf *
+frame (void *handle, struct ng_video_buf *frame)
+{
+ deinterlace (frame); // In hindsight, we may not have needed the function ;)
+ // Added clarity when we make it more complicated.
+ return frame;
+}
+
+static void
+fini (void *handle)
+{
+ /* nothing to clean up */
+}
+
+/* ------------------------------------------------------------------- */
+
+static struct ng_filter filter = {
+ name:"bilinear deinterlace",
+ fmts:
+ (1 << VIDEO_GRAY) |
+ (1 << VIDEO_RGB15_NATIVE) |
+ (1 << VIDEO_RGB16_NATIVE) |
+ (1 << VIDEO_BGR24) |
+ (1 << VIDEO_RGB24) |
+ (1 << VIDEO_BGR32) | (1 << VIDEO_RGB32) | (1 << VIDEO_YUV422),
+ init:init,
+ frame:frame,
+ fini:fini,
+};
+
+extern void ng_plugin_init (void);
+void
+ng_plugin_init (void)
+{
+ ng_filter_register (NG_PLUGIN_MAGIC,__FILE__,&filter);
+}
diff --git a/libng/contrib-plugins/cubic.c b/libng/contrib-plugins/cubic.c
new file mode 100644
index 0000000..1647b52
--- /dev/null
+++ b/libng/contrib-plugins/cubic.c
@@ -0,0 +1,126 @@
+/*
+ * Simple xawtv deinterlacing plugin - cubic interpolation
+ *
+ * CAVEATS: Effectively halves framerate, (working on it)
+ * May cause some general slowness (uses more cpu) but the framerate is smooth
+ * on my athlon 700, running the -mjc branch of 2.4 kernel (preempt and other
+ * patches for desktop performance)
+ *
+ * BENEFITS: It's no longer interlaced ;)
+ * Looks a metric shitton better than line doubling & bilinear interpolation
+ * around text, but these nasty white specks occur on the border of pure black
+ * (0) and pure white (255). My original theory was that it had something to
+ * do with 0 messing up our multiplication, but that does not appear to be the
+ * case based on preliminary fiddling around.
+ *
+ * AUTHORS:
+ * Conrad Kreyling <conrad@conrad.nerdland.org>
+ * Patrick Barrett <yebyen@nerdland.org>
+ *
+ * This is licenced under the GNU GPL until someone tells me I'm stealing code
+ * and can't do that ;) www.gnu.org for any version of the license.
+ *
+ * Based on xawtv-3.66/libng/plugins/flt-nop.c (also GPL)
+ * Cubic deinterlacing algorithm adapted from mplayer's libpostproc
+ */
+
+
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+
+#include "grab-ng.h"
+
+/*static int isOdd; // Global variable so we can tell if a frame uses even or
+ //odd scanlines, not implemented properly yet */
+
+static void inline
+deinterlace (struct ng_video_buf *frame)
+{
+ int x, y, bytes = frame->fmt.bytesperline;
+
+ /*
+ * if(isOdd){
+ * isOdd=0;
+ * y=3;
+ * }
+ * else
+ * {
+ * isOdd=1;
+ * y=4;
+ * } //Set y based on scanline evenness/oddness, not implemented yet
+ */
+
+ /* for (x=0; x < strlen(frame->data); x++){
+ switch (frame->data[x])
+ {
+ case 0:
+ frame->data[x]++;
+ break;
+ case 255:
+ frame->data[x]--;
+ break;
+ }
+ }*/ // This doesn't work to fix the problem with the specks
+
+ for (y = 3; y < frame->fmt.height - 3; y += 2)
+ {
+ for (x = 0; x < bytes; x++)
+ {
+ frame->data[(y * bytes + x)] =
+ ((-frame->data[((y - 3) * bytes + x)]) +
+ (9 * frame->data[((y - 1) * bytes + x)]) +
+ (9 * frame->data[((y + 1) * bytes + x)]) +
+ (-frame->data[((y + 3) * bytes + x)])) >> 4;
+ } // Basic algorithm borrowed from mplayer's libpostproc
+ } // Angry math
+}
+
+
+static void *
+init (struct ng_video_fmt *out)
+{
+ /* we will be using this variable soon enough */
+ static int isOdd = 0;
+ return &isOdd;
+}
+
+static struct ng_video_buf *
+frame (void *handle, struct ng_video_buf *frame)
+{
+ deinterlace (frame);
+ return frame;
+}
+
+static void
+fini (void *handle)
+{
+ /* nothing to clean up */
+}
+
+/* ------------------------------------------------------------------- */
+
+static struct ng_filter filter = {
+ name:"cubic interpolation",
+ fmts:
+ (1 << VIDEO_GRAY) |
+ (1 << VIDEO_RGB15_NATIVE) |
+ (1 << VIDEO_RGB16_NATIVE) |
+ (1 << VIDEO_BGR24) |
+ (1 << VIDEO_RGB24) |
+ (1 << VIDEO_BGR32) |
+ (1 << VIDEO_RGB32) |
+ (1 << VIDEO_YUV422),
+ init: init,
+ frame: frame,
+ fini: fini,
+};
+
+extern void ng_plugin_init (void);
+void
+ng_plugin_init (void)
+{
+ ng_filter_register (NG_PLUGIN_MAGIC,__FILE__,&filter);
+}
diff --git a/libng/contrib-plugins/linear-blend.c b/libng/contrib-plugins/linear-blend.c
new file mode 100644
index 0000000..a50987e
--- /dev/null
+++ b/libng/contrib-plugins/linear-blend.c
@@ -0,0 +1,166 @@
+/*
+ * Simple xawtv deinterlacing plugin - linear blend
+ *
+ * CAVEATS: Still some interlacing effects in high motion perhaps
+ * Some ghosting in instant transitions, slightly noticeable
+ *
+ * BENEFITS: NO DROP IN FRAMERATE =]
+ * Looks absolutely beautiful
+ * Doesn't lower framerate
+ * Oh and did I mention it doesn't lower framerate?
+ * Plus, its MMX'itized now, so it really doesn't lower framerate.
+ *
+ * AUTHORS:
+ * Conrad Kreyling <conrad@conrad.nerdland.org>
+ * Patrick Barrett <yebyen@nerdland.org>
+ *
+ * This is licenced under the GNU GPL until someone tells me I'm stealing code
+ * and can't do that ;) www.gnu.org for any version of the license.
+ *
+ * Based on xawtv-3.72/libng/plugins/flt-nop.c (also GPL)
+ * Linear blend deinterlacing algorithm adapted from mplayer's libpostproc
+ */
+
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+
+#include "grab-ng.h"
+
+#define PAVGB(a,b) "pavgb " #a ", " #b " \n\t"
+
+#ifdef MMX
+#define emms() __asm__ __volatile__ ("emms")
+#else
+#define emms()
+#endif
+
+static inline void linearBlend(unsigned char *src, int stride)
+{
+#ifdef MMX
+ asm volatile(
+ "leal (%0, %1), %%eax \n\t"
+ "leal (%%eax, %1, 4), %%ebx \n\t"
+
+ "movq (%0), %%mm0 \n\t" // L0
+ "movq (%%eax, %1), %%mm1 \n\t" // L2
+ PAVGB(%%mm1, %%mm0) // L0+L2
+ "movq (%%eax), %%mm2 \n\t" // L1
+ PAVGB(%%mm2, %%mm0)
+ "movq %%mm0, (%0) \n\t"
+ "movq (%%eax, %1, 2), %%mm0 \n\t" // L3
+ PAVGB(%%mm0, %%mm2) // L1+L3
+ PAVGB(%%mm1, %%mm2) // 2L2 + L1 + L3
+ "movq %%mm2, (%%eax) \n\t"
+ "movq (%0, %1, 4), %%mm2 \n\t" // L4
+ PAVGB(%%mm2, %%mm1) // L2+L4
+ PAVGB(%%mm0, %%mm1) // 2L3 + L2 + L4
+ "movq %%mm1, (%%eax, %1) \n\t"
+ "movq (%%ebx), %%mm1 \n\t" // L5
+ PAVGB(%%mm1, %%mm0) // L3+L5
+ PAVGB(%%mm2, %%mm0) // 2L4 + L3 + L5
+ "movq %%mm0, (%%eax, %1, 2) \n\t"
+ "movq (%%ebx, %1), %%mm0 \n\t" // L6
+ PAVGB(%%mm0, %%mm2) // L4+L6
+ PAVGB(%%mm1, %%mm2) // 2L5 + L4 + L6
+ "movq %%mm2, (%0, %1, 4) \n\t"
+ "movq (%%ebx, %1, 2), %%mm2 \n\t" // L7
+ PAVGB(%%mm2, %%mm1) // L5+L7
+ PAVGB(%%mm0, %%mm1) // 2L6 + L5 + L7
+ "movq %%mm1, (%%ebx) \n\t"
+ "movq (%0, %1, 8), %%mm1 \n\t" // L8
+ PAVGB(%%mm1, %%mm0) // L6+L8
+ PAVGB(%%mm2, %%mm0) // 2L7 + L6 + L8
+ "movq %%mm0, (%%ebx, %1) \n\t"
+ "movq (%%ebx, %1, 4), %%mm0 \n\t" // L9
+ PAVGB(%%mm0, %%mm2) // L7+L9
+ PAVGB(%%mm1, %%mm2) // 2L8 + L7 + L9
+ "movq %%mm2, (%%ebx, %1, 2) \n\t"
+
+ : : "r" (src), "r" (stride)
+ : "%eax", "%ebx"
+ );
+ emms();
+#else
+ int x;
+ for (x=0; x<8; x++)
+ {
+ src[0 ] = (src[0 ] + 2*src[stride ] + src[stride*2])>>2;
+ src[stride ] = (src[stride ] + 2*src[stride*2] + src[stride*3])>>2;
+ src[stride*2] = (src[stride*2] + 2*src[stride*3] + src[stride*4])>>2;
+ src[stride*3] = (src[stride*3] + 2*src[stride*4] + src[stride*5])>>2;
+ src[stride*4] = (src[stride*4] + 2*src[stride*5] + src[stride*6])>>2;
+ src[stride*5] = (src[stride*5] + 2*src[stride*6] + src[stride*7])>>2;
+ src[stride*6] = (src[stride*6] + 2*src[stride*7] + src[stride*8])>>2;
+ src[stride*7] = (src[stride*7] + 2*src[stride*8] + src[stride*9])>>2;
+
+ src++;
+ }
+#endif
+}
+
+static void inline
+deinterlace (struct ng_video_buf *frame)
+{
+ int x, y, bytes = frame->fmt.bytesperline;
+ unsigned char *src;
+
+ for (y = 1; y < frame->fmt.height - 8; y+=8)
+ {
+ for (x = 0; x < bytes; x+=8)
+ {
+ src = frame->data + x + y * bytes;
+ linearBlend(src, bytes);
+ }
+ }
+
+ emms();
+}
+
+
+static void *
+init (struct ng_video_fmt *out)
+{
+ /* no status info needed */
+ static int dummy;
+ return &dummy;
+}
+
+static struct ng_video_buf *
+frame (void *handle, struct ng_video_buf *frame)
+{
+ deinterlace (frame);
+ return frame;
+}
+
+static void
+fini (void *handle)
+{
+ /* nothing to clean up */
+}
+
+/* ------------------------------------------------------------------- */
+
+static struct ng_filter filter = {
+ name:"linear blend",
+ fmts:
+ (1 << VIDEO_GRAY) |
+ (1 << VIDEO_RGB15_NATIVE) |
+ (1 << VIDEO_RGB16_NATIVE) |
+ (1 << VIDEO_BGR24) |
+ (1 << VIDEO_RGB24) |
+ (1 << VIDEO_BGR32) | (1 << VIDEO_RGB32) | (1 << VIDEO_YUV422),
+ init:init,
+ frame:frame,
+ fini:fini,
+};
+
+extern void ng_plugin_init (void);
+void
+ng_plugin_init (void)
+{
+ ng_filter_register (NG_PLUGIN_MAGIC,__FILE__,&filter);
+}
+
diff --git a/libng/contrib-plugins/linedoubler.c b/libng/contrib-plugins/linedoubler.c
new file mode 100644
index 0000000..8fec152
--- /dev/null
+++ b/libng/contrib-plugins/linedoubler.c
@@ -0,0 +1,84 @@
+/*
+ * Simple xawtv deinterlacing plugin - line doubling
+ *
+ * CAVEATS: Effectively halves framerate and vertical resolution
+ * Framerate problem is to be addressed, vertical resolution problem is
+ * inherent in line doubling. Use one of the interpolating (or blending, when
+ * we write them) filters.
+ *
+ * BENEFITS: It's no longer interlaced ;) thats about it.
+ *
+ * AUTHORS:
+ * Conrad Kreyling <conrad@conrad.nerdland.org>
+ * Patrick Barrett <yebyen@nerdland.org>
+ *
+ * This is licenced under the GNU GPL until someone tells me I'm stealing code
+ * and can't do that ;) www.gnu.org for any version of the license.
+ *
+ * Based on xawtv-3.67/libng/plugins/flt-nop.c (also GPL)
+ */
+
+
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+
+#include "grab-ng.h"
+
+static void inline
+deinterlace(struct ng_video_buf *frame)
+{
+ int x,y;
+
+ for (y = 1; y < frame->fmt.height; y += 2)
+ for (x = 0; x < frame->fmt.bytesperline + 1; x++)
+ frame->data[(y * frame->fmt.bytesperline) + x] =
+ frame->data[((y - 1) * frame->fmt.bytesperline) + x];
+}
+
+
+static void *init(struct ng_video_fmt *out)
+{
+ /* don't have to carry around status info */
+ static int dummy;
+ return &dummy;
+}
+
+static struct ng_video_buf*
+frame(void *handle, struct ng_video_buf *frame)
+{
+ deinterlace(frame); // In hindsight, we may not have needed the function ;)
+ // Added clarity when we make it more complicated.
+ return frame;
+}
+
+static void fini(void *handle)
+{
+ /* nothing to clean up */
+}
+
+/* ------------------------------------------------------------------- */
+
+static struct ng_filter filter = {
+ name: "line doubler deinterlace",
+ fmts:
+ (1 << VIDEO_GRAY) |
+ (1 << VIDEO_RGB15_NATIVE) |
+ (1 << VIDEO_RGB16_NATIVE) |
+ (1 << VIDEO_BGR24) |
+ (1 << VIDEO_RGB24) |
+ (1 << VIDEO_BGR32) |
+ (1 << VIDEO_RGB32) |
+ (1 << VIDEO_YUV422),
+ init: init,
+ frame: frame,
+ fini: fini,
+};
+
+extern void ng_plugin_init(void);
+void ng_plugin_init(void)
+{
+ ng_filter_register(NG_PLUGIN_MAGIC,__FILE__,&filter);
+}
diff --git a/libng/grab-ng.c b/libng/grab-ng.c
index 73f968a..f5ea7d7 100644
--- a/libng/grab-ng.c
+++ b/libng/grab-ng.c
@@ -241,9 +241,10 @@ ng_attr_getint(struct ng_attribute *attr, char *value)
if (attr->type != ATTR_TYPE_CHOICE)
return -1;
- for (i = 0; attr->choices[i].str != NULL; i++)
+ for (i = 0; attr->choices[i].str != NULL; i++) {
if (0 == strcasecmp(attr->choices[i].str,value))
return attr->choices[i].nr;
+ }
if (isdigit(value[0])) {
/* Hmm. String not found, but starts with a digit.
diff --git a/libng/grab-ng.h b/libng/grab-ng.h
index 8569c60..a0170b3 100644
--- a/libng/grab-ng.h
+++ b/libng/grab-ng.h
@@ -370,7 +370,7 @@ struct ng_filter {
/* --------------------------------------------------------------------- */
/* must be changed if we break compatibility */
-#define NG_PLUGIN_MAGIC 0x20020910
+#define NG_PLUGIN_MAGIC 0x20021114
extern struct ng_video_conv **ng_conv;
extern struct ng_filter **ng_filters;
diff --git a/libng/plugins/Subdir.mk b/libng/plugins/Subdir.mk
index a37751e..fc0f7b6 100644
--- a/libng/plugins/Subdir.mk
+++ b/libng/plugins/Subdir.mk
@@ -55,8 +55,6 @@ clean::
libng/plugins/conv-mjpeg.so: libng/plugins/conv-mjpeg.o
libng/plugins/drv0-bsd.so: libng/plugins/drv0-bsd.o
libng/plugins/drv0-v4l2-new.so: libng/plugins/drv0-v4l2-new.o
-libng/plugins/drv0-v4l2.so: libng/plugins/drv0-v4l2.o
-libng/plugins/drv1-v4l.so: libng/plugins/drv1-v4l.o
libng/plugins/flt-debug.so: libng/plugins/flt-debug.o
libng/plugins/flt-disor.so: libng/plugins/flt-disor.o
libng/plugins/flt-gamma.so: libng/plugins/flt-gamma.o
@@ -68,3 +66,28 @@ libng/plugins/snd-oss.so: libng/plugins/snd-oss.o
libng/plugins/write-avi.so: libng/plugins/write-avi.o
libng/plugins/write-dv.so: libng/plugins/write-dv.o
libng/plugins/write-qt.so: libng/plugins/write-qt.o
+
+libng/plugins/drv0-v4l2.so: \
+ libng/plugins/drv0-v4l2.o \
+ libng/plugins/struct-v4l2.o \
+ libng/plugins/struct-dump.o
+
+libng/plugins/drv1-v4l.so: \
+ libng/plugins/drv1-v4l.o \
+ libng/plugins/struct-v4l.o \
+ libng/plugins/struct-dump.o
+
+libng/plugins/struct-dump.o:: structs/struct-dump.c
+ @$(echo_compile_c)
+ @$(compile_c)
+ @$(fixup_deps)
+
+libng/plugins/struct-v4l.o:: structs/struct-v4l.c
+ @$(echo_compile_c)
+ @$(compile_c)
+ @$(fixup_deps)
+
+libng/plugins/struct-v4l2.o:: structs/struct-v4l2.c
+ @$(echo_compile_c)
+ @$(compile_c)
+ @$(fixup_deps)
diff --git a/libng/plugins/drv0-v4l2.c b/libng/plugins/drv0-v4l2.c
index a51866e..d1b3d8f 100644
--- a/libng/plugins/drv0-v4l2.c
+++ b/libng/plugins/drv0-v4l2.c
@@ -26,6 +26,9 @@
#include "grab-ng.h"
+#include "struct-dump.h"
+#include "struct-v4l2.h"
+
/* ---------------------------------------------------------------------- */
/* open+close */
@@ -157,51 +160,6 @@ static struct STRTAB stereo[] = {
#define PREFIX "ioctl: "
-static const char *io_names[] = {
- [VIDIOC_QUERYCAP & 0xff] = "QUERYCAP",
- [VIDIOC_ENUM_FMT & 0xff] = "ENUM_FMT",
- [VIDIOC_G_FMT & 0xff] = "G_FMT",
- [VIDIOC_S_FMT & 0xff] = "S_FMT",
- [VIDIOC_REQBUFS & 0xff] = "REQBUFS",
- [VIDIOC_QUERYBUF & 0xff] = "QUERYBUF",
- [VIDIOC_G_FBUF & 0xff] = "G_FBUF",
- [VIDIOC_S_FBUF & 0xff] = "S_FBUF",
- [VIDIOC_OVERLAY & 0xff] = "OVERLAY",
- [VIDIOC_QBUF & 0xff] = "QBUF",
- [VIDIOC_DQBUF & 0xff] = "DQBUF",
- [VIDIOC_STREAMON & 0xff] = "STREAMON",
- [VIDIOC_STREAMOFF & 0xff] = "STREAMOFF",
- [VIDIOC_G_PARM & 0xff] = "G_PARM",
- [VIDIOC_S_PARM & 0xff] = "S_PARM",
- [VIDIOC_G_STD & 0xff] = "G_STD",
- [VIDIOC_S_STD & 0xff] = "S_STD",
- [VIDIOC_ENUMSTD & 0xff] = "ENUMSTD",
- [VIDIOC_ENUMINPUT & 0xff] = "ENUMINPUT",
- [VIDIOC_G_CTRL & 0xff] = "G_CTRL",
- [VIDIOC_S_CTRL & 0xff] = "S_CTRL",
- [VIDIOC_G_TUNER & 0xff] = "G_TUNER",
- [VIDIOC_S_TUNER & 0xff] = "S_TUNER",
- [VIDIOC_G_AUDIO & 0xff] = "G_AUDIO",
- [VIDIOC_S_AUDIO & 0xff] = "S_AUDIO",
- [VIDIOC_QUERYCTRL & 0xff] = "QUERYCTRL",
- [VIDIOC_QUERYMENU & 0xff] = "QUERYMENU",
- [VIDIOC_G_INPUT & 0xff] = "G_INPUT",
- [VIDIOC_S_INPUT & 0xff] = "S_INPUT",
- [VIDIOC_G_OUTPUT & 0xff] = "G_OUTPUT",
- [VIDIOC_S_OUTPUT & 0xff] = "S_OUTPUT",
- [VIDIOC_ENUMOUTPUT & 0xff] = "ENUMOUTPUT",
- [VIDIOC_G_AUDOUT & 0xff] = "G_AUDOUT",
- [VIDIOC_S_AUDOUT & 0xff] = "S_AUDOUT",
- [VIDIOC_G_MODULATOR & 0xff] = "G_MODULATOR",
- [VIDIOC_S_MODULATOR & 0xff] = "S_MODULATOR",
- [VIDIOC_TRY_FMT & 0xff] = "TRY_FMT",
- [VIDIOC_G_FREQUENCY & 0xff] = "G_FREQUENCY",
- [VIDIOC_S_FREQUENCY & 0xff] = "S_FREQUENCY",
-};
-static const int io_count = (sizeof(io_names)/sizeof(char*));
-#define IONAME(cmd) ((cmd & 0xff) < io_count ? \
- io_names[cmd & 0xff] : "UNKNOWN")
-
static int
xioctl(int fd, int cmd, void *arg, int mayfail)
{
@@ -212,207 +170,12 @@ xioctl(int fd, int cmd, void *arg, int mayfail)
return rc;
if (mayfail && errno == mayfail && ng_debug < 2)
return rc;
- switch (cmd) {
- case VIDIOC_QUERYCAP:
- {
- struct v4l2_capability *a = arg;
- fprintf(stderr,PREFIX "VIDIOC_QUERYCAP(%s,%s,%s,ver=%d.%d.%d,"
- "cap=0x%x)",
- a->driver,a->card,a->bus_info,
- (a->version >> 16) & 0xff,
- (a->version >> 8) & 0xff,
- a->version & 0xff,
- a->capabilities);
- break;
- }
-
- case VIDIOC_G_FMT:
- case VIDIOC_S_FMT:
- case VIDIOC_TRY_FMT:
- {
- struct v4l2_format *a = arg;
-
- fprintf(stderr,PREFIX "VIDIOC_%s(type=%d,",IONAME(cmd),a->type);
- switch (a->type) {
- case V4L2_BUF_TYPE_VIDEO_CAPTURE:
- fprintf(stderr,
- "%dx%d,%c%c%c%c,bpl=%d,size=%d)",
- a->fmt.pix.width,a->fmt.pix.height,
- a->fmt.pix.pixelformat & 0xff,
- (a->fmt.pix.pixelformat >> 8) & 0xff,
- (a->fmt.pix.pixelformat >> 16) & 0xff,
- (a->fmt.pix.pixelformat >> 24) & 0xff,
- a->fmt.pix.bytesperline,
- a->fmt.pix.sizeimage);
- break;
- case V4L2_BUF_TYPE_VIDEO_OVERLAY:
- fprintf(stderr,"%dx%d+%d+%d,key=0x%x,clips=%d)",
- a->fmt.win.w.width, a->fmt.win.w.height,
- a->fmt.win.w.left, a->fmt.win.w.top,
- a->fmt.win.chromakey,a->fmt.win.clipcount);
- break;
- default:
- fprintf(stderr,"??" "?)"); /* break trigraph */
- break;
- }
- break;
- }
- case VIDIOC_REQBUFS:
- {
- struct v4l2_requestbuffers *a = arg;
-
- fprintf(stderr,PREFIX "VIDIOC_REQBUFS(count=%d,type=%d)",
- a->count,a->type);
- break;
- }
- case VIDIOC_QBUF:
- case VIDIOC_DQBUF:
- {
- struct v4l2_buffer *a = arg;
-
- fprintf(stderr,PREFIX "VIDIOC_%s(%d,type=%d,off=%d,len=%d,used=%d,"
- "flags=0x%x,ts=%ld.%ld,seq=%d)",
- IONAME(cmd),a->index,a->type,a->m.offset,a->length,
- a->bytesused,a->flags,
- a->timestamp.tv_sec,a->timestamp.tv_usec,a->sequence);
- break;
- }
-
- case VIDIOC_OVERLAY:
- {
- int *a = arg;
-
- fprintf(stderr,PREFIX "VIDIOC_OVERLAY(%s)",*a ? "on" : "off");
- break;
- }
-
- case VIDIOC_QUERYCTRL:
- {
- struct v4l2_queryctrl *a = arg;
-
- fprintf(stderr,PREFIX "VIDIOC_QUERYCTRL(id=%d,%s,%d-%d/%d,def=%d,"
- "type=%d,flags=0x%x)",
- a->id,a->name,a->minimum,a->maximum,a->step,
- a->default_value,a->type,a->flags);
- break;
- }
- case VIDIOC_QUERYMENU:
- {
- struct v4l2_querymenu *a = arg;
-
- fprintf(stderr,PREFIX "VIDIOC_QUERYMENU(id=%d,index=%d,%s)",
- a->id,a->index,a->name);
- break;
- }
- case VIDIOC_G_CTRL:
- case VIDIOC_S_CTRL:
- {
- struct v4l2_control *a = arg;
-
- fprintf(stderr,PREFIX "VIDIOC_%s(id=%d,value=%d)",
- IONAME(cmd),a->id,a->value);
- break;
- }
-
- default:
- fprintf(stderr,PREFIX "VIDIOC_%s(cmd=0x%x)",IONAME(cmd),cmd);
- break;
- }
+ print_ioctl(stderr,ioctls_v4l2,PREFIX,cmd,arg);
fprintf(stderr,": %s\n",(rc == 0) ? "ok" : strerror(errno));
return rc;
}
static void
-print_bits(char *title, char **names, int count, int value)
-{
- int i;
-
- fprintf(stderr,"%s: ",title);
- for (i = 0; i < count; i++) {
- if (value & (1 << i))
- fprintf(stderr,"%s ",names[i]);
- }
- fprintf(stderr,"\n");
-}
-
-static void
-print_device_capabilities(struct v4l2_handle *h)
-{
- static char *caps[] = {
- "video-cap", "video-out", "video-over", "",
- "vbi-cap", "vbi-out", "?","?",
- "rds-cap", "?", "?", "?",
- "?", "?", "?", "?",
- "tuner", "audio", "?", "?",
- "?", "?", "?", "?",
- "read/write", "async-i/o", "streaming", "?",
- };
- static char *ctl_type[] = {
- "integer",
- "boolean",
- "menu"
- };
- static char *cap_parm[] = {
- "highquality",
- "vflip",
- "hflip"
- };
-
- int i;
-
- fprintf(stderr,"\n*** v4l2: video device capabilities ***\n");
-
- /* capabilities */
- print_bits("caps",caps,sizeof(caps)/sizeof(char*),h->cap.capabilities);
- fprintf(stderr,"\n");
-
- /* inputs */
- fprintf(stderr,"video inputs:\n");
- for (i = 0; i < h->ninputs; i++) {
- printf(" %d: \"%s\", tuner: %s\n", i, h->inp[i].name,
- (h->inp[i].type == V4L2_INPUT_TYPE_TUNER) ? "yes" : "no");
- }
-
- /* video standards */
- fprintf(stderr,"video standards:\n");
- for (i = 0; i < h->nstds; i++) {
- printf(" %d: \"%s\"\n", i, h->std[i].name);
- }
-
- /* capture formats */
- fprintf(stderr,"capture formats:\n");
- for (i = 0; i < h->nfmts; i++) {
- fprintf(stderr," %d: %c%c%c%c, %s \"%s\"\n", i,
- h->fmt[i].pixelformat & 0xff,
- (h->fmt[i].pixelformat >> 8) & 0xff,
- (h->fmt[i].pixelformat >> 16) & 0xff,
- (h->fmt[i].pixelformat >> 24) & 0xff,
- (h->fmt[i].flags & V4L2_FMT_FLAG_COMPRESSED) ? " compressed" : "",
- h->fmt[i].description);
- }
-
- /* capture parameters */
- fprintf(stderr,"capture parameters:\n");
- print_bits(" cap",cap_parm,sizeof(cap_parm)/sizeof(char*),
- h->streamparm.parm.capture.capability);
- print_bits(" cur",cap_parm,sizeof(cap_parm)/sizeof(char*),
- h->streamparm.parm.capture.capturemode);
-
- /* controls */
- fprintf(stderr,"supported controls:\n");
- for (i = 0; i < MAX_CTRL*2; i++) {
- if (h->ctl[i].id == -1)
- continue;
- fprintf(stderr," %2d: \"%s\", [%d .. %d], step=%d, def=%d, type=%s\n",
- i, h->ctl[i].name,
- h->ctl[i].minimum,h->ctl[i].maximum,
- h->ctl[i].step,h->ctl[i].default_value,
- ctl_type[h->ctl[i].type]);
- }
- fprintf(stderr,"\n");
-}
-
-static void
print_bufinfo(struct v4l2_buffer *buf)
{
static char *type[] = {
@@ -430,36 +193,6 @@ print_bufinfo(struct v4l2_buffer *buf)
buf->m.offset,buf->length,buf->bytesused);
}
-static void
-print_fbinfo(struct v4l2_framebuffer *fb)
-{
- static char *fb_cap[] = {
- "extern",
- "chromakey",
- "clipping",
- "scale-up",
- "scale-down"
- };
- static char *fb_flags[] = {
- "primary",
- "overlay",
- "chromakey"
- };
-
- /* capabilities */
- fprintf(stderr,"v4l2: framebuffer info\n");
- print_bits(" cap",fb_cap,sizeof(fb_cap)/sizeof(char*),fb->capability);
- print_bits(" flags",fb_cap,sizeof(fb_flags)/sizeof(char*),fb->flags);
- fprintf(stderr," base: %p\n",fb->base);
- fprintf(stderr," format: %dx%d, %c%c%c%c, %d byte\n",
- fb->fmt.width, fb->fmt.height,
- fb->fmt.pixelformat & 0xff,
- (fb->fmt.pixelformat >> 8) & 0xff,
- (fb->fmt.pixelformat >> 16) & 0xff,
- (fb->fmt.pixelformat >> 24) & 0xff,
- fb->fmt.sizeimage);
-}
-
/* ---------------------------------------------------------------------- */
/* helpers */
@@ -511,7 +244,7 @@ build_norms(struct v4l2_handle *h)
norms = malloc(sizeof(struct STRTAB) * (h->nstds+1));
for (i = 0; i < h->nstds; i++) {
- norms[i].nr = h->std[i].id;
+ norms[i].nr = i;
norms[i].str = h->std[i].name;
}
norms[i].nr = -1;
@@ -685,7 +418,7 @@ static void v4l2_write_attr(struct ng_attribute *attr, int value)
xioctl(h->fd,VIDIOC_S_CTRL,&c,0);
} else if (attr->id == ATTR_ID_NORM) {
- xioctl(h->fd,VIDIOC_S_STD,&value,0);
+ xioctl(h->fd,VIDIOC_S_STD,&h->std[value].id,0);
} else if (attr->id == ATTR_ID_INPUT) {
xioctl(h->fd,VIDIOC_S_INPUT,&value,0);
@@ -716,7 +449,7 @@ v4l2_open(char *device)
goto err;
}
- if (-1 == ioctl(h->fd,VIDIOC_QUERYCAP,&h->cap))
+ if (-1 == xioctl(h->fd,VIDIOC_QUERYCAP,&h->cap,EINVAL))
goto err;
if (ng_debug)
fprintf(stderr, "v4l2: open\n");
@@ -729,10 +462,7 @@ v4l2_open(char *device)
(h->cap.version >> 8) & 0xff,
h->cap.version & 0xff,
h->cap.card,h->cap.bus_info);
-
get_device_capabilities(h);
- if (ng_debug)
- print_device_capabilities(h);
/* attributes */
v4l2_add_attr(h, NULL, ATTR_ID_NORM, build_norms(h));
@@ -851,9 +581,6 @@ v4l2_setupfb(void *handle, struct ng_video_fmt *fmt, void *base)
if (-1 == xioctl(h->fd, VIDIOC_G_FBUF, &h->ov_fb, 0))
return -1;
- if (1 /* ng_debug */)
- print_fbinfo(&h->ov_fb);
-
/* double-check settings */
if (NULL != base && h->ov_fb.base != base) {
fprintf(stderr,"v4l2: WARNING: framebuffer base address mismatch\n");
diff --git a/libng/plugins/drv1-v4l.c b/libng/plugins/drv1-v4l.c
index 70b042e..dec74d1 100644
--- a/libng/plugins/drv1-v4l.c
+++ b/libng/plugins/drv1-v4l.c
@@ -25,6 +25,9 @@
#include "grab-ng.h"
+#include "struct-dump.h"
+#include "struct-v4l.h"
+
#define SYNC_TIMEOUT 3
/* ---------------------------------------------------------------------- */
@@ -226,116 +229,7 @@ xioctl(int fd, int cmd, void *arg)
rc = ioctl(fd,cmd,arg);
if (0 == rc && ng_debug < 2)
return 0;
- switch (cmd) {
- case VIDIOCGCAP:
- {
- struct video_capability *a = arg;
- fprintf(stderr,PREFIX "VIDIOCGCAP(%s,type=0x%x,chan=%d,audio=%d,"
- "size=%dx%d-%dx%d)",
- a->name,a->type,a->channels,a->audios,
- a->minwidth,a->minheight,a->maxwidth,a->maxheight);
- break;
- }
- case VIDIOCGCHAN:
- case VIDIOCSCHAN:
- {
- struct video_channel *a = arg;
- fprintf(stderr,PREFIX "%s(%d,%s,flags=0x%x,type=%d,norm=%d)",
- (cmd == VIDIOCGCHAN) ? "VIDIOCGCHAN" : "VIDIOCSCHAN",
- a->channel,a->name,a->flags,a->type,a->norm);
- break;
- }
- case VIDIOCGTUNER:
- case VIDIOCSTUNER:
- {
- struct video_tuner *a = arg;
- fprintf(stderr,PREFIX "%s(%d,%s,range=%ld-%ld,flags=0x%x,"
- "mode=%d,signal=%d)",
- (cmd == VIDIOCGTUNER) ? "VIDIOCGTUNER" : "VIDIOCSTUNER",
- a->tuner,a->name,a->rangelow,a->rangehigh,
- a->flags,a->mode,a->signal);
- break;
- }
- case VIDIOCGPICT:
- case VIDIOCSPICT:
- {
- struct video_picture *a = arg;
- fprintf(stderr,PREFIX "%s(params=%d/%d/%d/%d/%d,depth=%d,fmt=%d)",
- (cmd == VIDIOCGPICT) ? "VIDIOCGPICT" : "VIDIOCSPICT",
- a->brightness,a->hue,a->colour,a->contrast,a->whiteness,
- a->depth,a->palette);
- break;
- }
- case VIDIOCGAUDIO:
- case VIDIOCSAUDIO:
- {
- struct video_audio *a = arg;
- fprintf(stderr,PREFIX "%s(%d,%s,flags=0x%x,vol=%d,balance=%d,"
- "bass=%d,treble=%d,mode=0x%x,step=%d)",
- (cmd == VIDIOCGAUDIO) ? "VIDIOCGAUDIO" : "VIDIOCSAUDIO",
- a->audio,a->name,a->flags,a->volume,a->balance,
- a->bass,a->treble,a->mode,a->step);
- break;
- }
- case VIDIOCGWIN:
- case VIDIOCSWIN:
- {
- struct video_window *a = arg;
- fprintf(stderr,PREFIX "%s(win=%dx%d+%d+%d,key=%d,flags=0x%x,clips=%d)",
- (cmd == VIDIOCGWIN) ? "VIDIOCGWIN" : "VIDIOCSWIN",
- a->width,a->height,a->x,a->y,
- a->chromakey,a->flags,a->clipcount);
- break;
- }
- case VIDIOCGFBUF:
- case VIDIOCSFBUF:
- {
- struct video_buffer *a = arg;
- fprintf(stderr,PREFIX "%s(base=%p,size=%dx%d,depth=%d,bpl=%d)",
- (cmd == VIDIOCGFBUF) ? "VIDIOCGFBUF" : "VIDIOCSFBUF",
- a->base,a->width,a->height,a->depth,a->bytesperline);
- break;
- }
- case VIDIOCGFREQ:
- case VIDIOCSFREQ:
- {
- unsigned long *a = arg;
- fprintf(stderr,PREFIX "%s(%.3f MHz)",
- (cmd == VIDIOCGFREQ) ? "VIDIOCGFREQ" : "VIDIOCSFREQ",
- (float)*a/16);
- break;
- }
- case VIDIOCCAPTURE:
- {
- int *a = arg;
- fprintf(stderr,PREFIX "VIDIOCCAPTURE(%s)",
- *a ? "on" : "off");
- break;
- }
- case VIDIOCGMBUF:
- {
- struct video_mbuf *a = arg;
- fprintf(stderr,PREFIX "VIDIOCGMBUF(size=%d,frames=%d)",
- a->size,a->frames);
- break;
- }
- case VIDIOCMCAPTURE:
- {
- struct video_mmap *a = arg;
- fprintf(stderr,PREFIX "VIDIOCMCAPTURE(%d,fmt=%d,size=%dx%d)",
- a->frame,a->format,a->width,a->height);
- break;
- }
- case VIDIOCSYNC:
- {
- int *a = arg;
- fprintf(stderr,PREFIX "VIDIOCSYNC(%d)",*a);
- break;
- }
- default:
- fprintf(stderr,PREFIX "UNKNOWN(cmd=0x%x)",cmd);
- break;
- }
+ print_ioctl(stderr,ioctls_v4l1,PREFIX,cmd,arg);
fprintf(stderr,": %s\n",(rc == 0) ? "ok" : strerror(errno));
return rc;
}
diff --git a/libng/plugins/read-avi.c b/libng/plugins/read-avi.c
index 139d234..4b0f17a 100644
--- a/libng/plugins/read-avi.c
+++ b/libng/plugins/read-avi.c
@@ -376,7 +376,7 @@ static struct ng_audio_buf* avi_adata(void *handle)
return buf;
}
-static long long avi_frame_time(void *handle)
+static int64_t avi_frame_time(void *handle)
{
struct avi_handle *h = handle;
diff --git a/libng/plugins/read-dv.c b/libng/plugins/read-dv.c
index 9d6e1a1..6388756 100644
--- a/libng/plugins/read-dv.c
+++ b/libng/plugins/read-dv.c
@@ -10,6 +10,7 @@
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
+#include <inttypes.h>
#include <sys/mman.h>
#include <libdv/dv.h>
@@ -117,7 +118,7 @@ static void dv_fmt(struct dv_handle *h, int *vfmt, int vn)
h->frames = len / h->dec->frame_size;
if (ng_debug) {
- fprintf(stderr,"dv: len=%lld => %d frames [%lld]\n",len,h->frames,
+ fprintf(stderr,"dv: len=%lld => %d frames [%" PRId64 "]\n",len,h->frames,
len - (off_t)h->frames * h->dec->frame_size);
fprintf(stderr,
"dv: quality=%d system=%d std=%d sampling=%d num_dif_seqs=%d\n"
@@ -280,7 +281,7 @@ static struct ng_audio_buf* dv_adata(void *handle)
return buf;
}
-static long long dv_frame_time(void *handle)
+static int64_t dv_frame_time(void *handle)
{
struct dv_handle *h = handle;
@@ -327,4 +328,7 @@ void ng_plugin_init(void)
ng_reader_register(NG_PLUGIN_MAGIC,__FILE__,&dv_reader);
}
+#else /* gcc3 */
+extern void ng_plugin_init(void);
+void ng_plugin_init(void) {}
#endif /* gcc3 */
diff --git a/libng/plugins/read-qt.c b/libng/plugins/read-qt.c
index 66c0e2b..2a3e2a0 100644
--- a/libng/plugins/read-qt.c
+++ b/libng/plugins/read-qt.c
@@ -247,7 +247,7 @@ static struct ng_audio_buf* qt_adata(void *handle)
return buf;
}
-static long long qt_frame_time(void *handle)
+static int64_t qt_frame_time(void *handle)
{
struct qt_handle *h = handle;
diff --git a/libng/plugins/snd-oss.c b/libng/plugins/snd-oss.c
index 1c626c6..9a742a0 100644
--- a/libng/plugins/snd-oss.c
+++ b/libng/plugins/snd-oss.c
@@ -465,7 +465,7 @@ oss_bufswap(void *ptr, int size)
}
static struct ng_audio_buf*
-oss_read(void *handle, long long stopby)
+oss_read(void *handle, int64_t stopby)
{
struct oss_handle *h = handle;
struct ng_audio_buf* buf;
@@ -521,7 +521,7 @@ oss_write(void *handle, struct ng_audio_buf *buf)
return buf;
}
-static long long
+static int64_t
oss_latency(void *handle)
{
struct oss_handle *h = handle;
diff --git a/libng/videodev2.h b/libng/videodev2.h
index 134367e..8cbb556 100644
--- a/libng/videodev2.h
+++ b/libng/videodev2.h
@@ -818,7 +818,7 @@ struct v4l2_streamparm
#define VIDIOC_G_JPEGCOMP _IOR ('V', 61, struct v4l2_jpegcompression)
#define VIDIOC_S_JPEGCOMP _IOW ('V', 62, struct v4l2_jpegcompression)
#define VIDIOC_QUERYSTD _IOR ('V', 63, v4l2_std_id)
-#define VIDIOC_TRY_FMT _IOWR ('V', 63, struct v4l2_format)
+#define VIDIOC_TRY_FMT _IOWR ('V', 64, struct v4l2_format)
#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
diff --git a/man/xawtvrc.5 b/man/xawtvrc.5
index a7ab31a..6411c19 100644
--- a/man/xawtvrc.5
+++ b/man/xawtvrc.5
@@ -118,6 +118,10 @@ another channel scheme.
.TP
.B midi = note
Use midi noteon event for <note> as hotkey for the channel.
+.TP
+.B group = name
+Put the channel into the group <name>. motv uses that to create
+submenus per channel group.
.P
.SS Global options
A number of not channel-related settings go to the "[global]" section:
diff --git a/structs/Makefile b/structs/Makefile
new file mode 100644
index 0000000..4e33e30
--- /dev/null
+++ b/structs/Makefile
@@ -0,0 +1,2 @@
+default:
+ cd ..; $(MAKE)
diff --git a/structs/README b/structs/README
new file mode 100644
index 0000000..11aee7a
--- /dev/null
+++ b/structs/README
@@ -0,0 +1,12 @@
+
+some infrastructure to dump the content of structures for info/debugging
+
+struct-dump.[ch] the actual code
+struct-<name>.[ch] descriptions for structs of <name> API
+struct2desc quick&dirty perl script to build initial
+ description data files.
+
+used by:
+ console/v4l-info
+ libng/plugins/<various>
+
diff --git a/structs/ioctl2desc b/structs/ioctl2desc
new file mode 100644
index 0000000..5575ee0
--- /dev/null
+++ b/structs/ioctl2desc
@@ -0,0 +1,16 @@
+#!/usr/bin/perl
+use strict;
+
+my ($name,$type);
+
+while (<>) {
+ ($name,$type) = m/\#define\s+(\w+)\s+_IO\w+\s*\([^,]+,\s*\d+,\s*(.*?)\)/
+ or next;
+
+ $type =~ s/struct /desc_/;
+
+ print "[_IOC_NR($name)] = {\n";
+ print "\t.name = \"$name\",\n";
+ print "\t.desc = $type,\n";
+ print "},\n";
+}
diff --git a/structs/struct-dump.c b/structs/struct-dump.c
new file mode 100644
index 0000000..602975d
--- /dev/null
+++ b/structs/struct-dump.c
@@ -0,0 +1,247 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <inttypes.h>
+#include <ctype.h>
+#include <sys/ioctl.h>
+
+#include "struct-dump.h"
+
+/* ---------------------------------------------------------------------- */
+
+struct struct_desc desc_int[] = {{
+ .type = SINT32,
+ .name = "int",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_long[] = {{
+ .type = SINT32,
+ .name = "long",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_timeval[] = {{
+ /* FIXME */
+ /* end of list */
+}};
+
+/* ---------------------------------------------------------------------- */
+
+int print_struct(FILE *fp, struct struct_desc *desc, void *data,
+ char *prefix, int tab)
+{
+ char name[256];
+ unsigned char *ptr = data;
+ uint64_t u64;
+ int64_t s64;
+ uint32_t u32;
+ int32_t s32;
+ uint16_t u16;
+ int16_t s16;
+ uint8_t u8;
+ int8_t s8;
+ void *p;
+ int i,j,first;
+
+ for (i = 0; desc[i].name != NULL; i++) {
+ sprintf(name,"%s%s",prefix,desc[i].name);
+ if (STRUCT == desc[i].type) {
+ strcat(name,".");
+ print_struct(fp,desc[i].desc, ptr, name, tab);
+ ptr += desc[i].length;
+ if (!tab && desc[i+1].name != NULL)
+ fprintf(fp,";");
+ continue;
+ }
+ if (UNION == desc[i].type) {
+ u32 = *((uint32_t*)(ptr-4));
+ for (j = 0; desc[i].u[j].name != NULL; j++)
+ if (desc[i].u[j].value == u32)
+ break;
+ if (desc[i].u[j].name != NULL) {
+ strcat(name,".");
+ strcat(name,desc[i].u[j].name);
+ strcat(name,".");
+ print_struct(fp,desc[i].u[j].desc,
+ ptr, name, tab);
+ }
+ return 0; /* FIXME */
+ }
+ if (tab)
+ fprintf(fp,"\t%-24s: ",name);
+ else
+ fprintf(fp,"%s=",name);
+ switch (desc[i].type) {
+ case STRING:
+ fprintf(fp,"\"%-.*s\"",desc[i].length,ptr);
+ ptr += desc[i].length;
+ break;
+ case PTR:
+ p = *(void**)ptr;
+ fprintf(fp,"%p",p);
+ ptr += sizeof(p);
+ break;
+ case VER:
+ u32 = *((uint32_t*)ptr);
+ fprintf(fp,"%d.%d.%d",
+ (u32 >> 16) & 0xff,
+ (u32 >> 8) & 0xff,
+ u32 & 0xff);
+ ptr += 4;
+ break;
+ case FOURCC:
+ u32 = *((uint32_t*)ptr);
+ fprintf(fp,"0x%08x [%c%c%c%c]", u32,
+ isprint(ptr[0]) ? ptr[0] : '.',
+ isprint(ptr[1]) ? ptr[1] : '.',
+ isprint(ptr[2]) ? ptr[2] : '.',
+ isprint(ptr[3]) ? ptr[3] : '.');
+ ptr += 4;
+ break;
+
+ case ENUM16:
+ u16 = *((uint16_t*)ptr);
+ fprintf(fp,"%s", (u16 < desc[i].length && desc[i].enums[u16])
+ ? desc[i].enums[u16] : "unknown");
+ ptr += 2;
+ break;
+ case ENUM32:
+ u32 = *((uint32_t*)ptr);
+ fprintf(fp,"%s", (u32 < desc[i].length && desc[i].enums[u32])
+ ? desc[i].enums[u32] : "unknown");
+ ptr += 4;
+ break;
+
+ case BITS16:
+ u16 = *((uint16_t*)ptr);
+ first = 1;
+ fprintf(fp,"0x%x [",u16);
+ for (j = 0; j < 16; j++) {
+ if (0 == (u16 & (1 << j)))
+ continue;
+ fprintf(fp,"%s%s",
+ first ? "" : ",",
+ desc[i].bits[j]);
+ first = 0;
+ }
+ fprintf(fp,"]");
+ ptr += 2;
+ break;
+ case BITS32:
+ u32 = *((uint32_t*)ptr);
+ first = 1;
+ fprintf(fp,"0x%x [",u32);
+ for (j = 0; j < 32; j++) {
+ if (0 == (u32 & (1 << j)))
+ continue;
+ fprintf(fp,"%s%s",
+ first ? "" : ",",
+ desc[i].bits[j]);
+ first = 0;
+ }
+ fprintf(fp,"]");
+ ptr += 4;
+ break;
+ case BITS64:
+ u64 = *((uint64_t*)ptr);
+ first = 1;
+ fprintf(fp,"0x%" PRIx64 " [",u64);
+ for (j = 0; j < 64; j++) {
+ if (0 == (u64 & ((int64_t)1 << j)))
+ continue;
+ fprintf(fp,"%s%s",
+ first ? "" : ",",
+ desc[i].bits[j]);
+ first = 0;
+ }
+ fprintf(fp,"]");
+ ptr += 8;
+ break;
+
+ case UINT64:
+ u64 = *((uint64_t*)ptr);
+ fprintf(fp,"%" PRIu64,u64);
+ ptr += 8;
+ break;
+ case SINT64:
+ s64 = *((int64_t*)ptr);
+ fprintf(fp,"%" PRId64,s64);
+ ptr += 8;
+ break;
+ case UINT32:
+ u32 = *((uint32_t*)ptr);
+ fprintf(fp,"%u",u32);
+ ptr += 4;
+ break;
+ case SINT32:
+ s32 = *((int32_t*)ptr);
+ fprintf(fp,"%d",s32);
+ ptr += 4;
+ break;
+ case UINT16:
+ u16 = *((uint16_t*)ptr);
+ fprintf(fp,"%u",u16);
+ ptr += 2;
+ break;
+ case SINT16:
+ s16 = *((int16_t*)ptr);
+ fprintf(fp,"%d",s16);
+ ptr += 2;
+ break;
+ case UINT8:
+ u8 = *((uint8_t*)ptr);
+ fprintf(fp,"%u",u8);
+ ptr += 1;
+ break;
+ case SINT8:
+ s8 = *((int8_t*)ptr);
+ fprintf(fp,"%d",s8);
+ ptr += 1;
+ break;
+
+ case PADDING:
+ ptr += desc[i].length;
+ break;
+
+ case STRUCT:
+ case UNION:
+ /* shouldn't happen */
+ fprintf(fp,"FIXME [type=%d]\n",desc[i].type);
+ exit(1);
+ }
+ if (tab)
+ fprintf(fp,"\n");
+ else if (desc[i+1].name != NULL)
+ fprintf(fp,";");
+ }
+ return 0;
+}
+
+/* ---------------------------------------------------------------------- */
+
+int print_ioctl(FILE *fp, struct ioctl_desc *ioctls, char *prefix,
+ int cmd, void *ptr)
+{
+ int index = _IOC_NR(cmd);
+ char *name = ioctls[index].name;
+ struct struct_desc *desc = ioctls[index].desc;
+
+ fprintf(fp,"%s%s(", prefix, name ? name : "UNKNOWN");
+ if (desc) {
+ print_struct(fp,desc,ptr,"",0);
+ } else {
+ fprintf(stderr,"???");
+ }
+ fprintf(fp,")");
+ return 0;
+}
+
+/* ---------------------------------------------------------------------- */
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/structs/struct-dump.h b/structs/struct-dump.h
new file mode 100644
index 0000000..62b6d4b
--- /dev/null
+++ b/structs/struct-dump.h
@@ -0,0 +1,55 @@
+
+enum desc_type {
+ UINT64,
+ SINT64,
+ UINT32,
+ SINT32,
+ UINT16,
+ SINT16,
+ UINT8,
+ SINT8,
+ FOURCC,
+ STRING,
+ PTR,
+ ENUM16,
+ ENUM32,
+ STRUCT,
+ UNION,
+ BITS16,
+ BITS32,
+ BITS64,
+ VER,
+ PADDING,
+};
+
+struct struct_desc {
+ enum desc_type type;
+ char *name;
+ int length;
+ char **enums;
+ char **bits;
+ struct struct_desc *desc;
+ struct {
+ int value;
+ char *name;
+ struct struct_desc *desc;
+ } u[16];
+};
+
+struct ioctl_desc {
+ char *name;
+ struct struct_desc *desc;
+};
+
+/* ---------------------------------------------------------------------- */
+
+extern struct struct_desc desc_int[];
+extern struct struct_desc desc_long[];
+extern struct struct_desc desc_timeval[];
+
+/* ---------------------------------------------------------------------- */
+
+int print_struct(FILE *fp, struct struct_desc *desc, void *data,
+ char *prefix, int tab);
+int print_ioctl(FILE *fp, struct ioctl_desc *ioctls, char *prefix,
+ int cmd, void *ptr);
diff --git a/structs/struct-v4l.c b/structs/struct-v4l.c
new file mode 100644
index 0000000..5a01b4a
--- /dev/null
+++ b/structs/struct-v4l.c
@@ -0,0 +1,441 @@
+#include <stdio.h>
+#include <sys/ioctl.h>
+
+#include "videodev.h"
+
+#include "struct-dump.h"
+#include "struct-v4l.h"
+
+/* ---------------------------------------------------------------------- */
+
+char *bits_vid_cap[32] = {
+ "CAPTURE",
+ "TUNER",
+ "TELETEXT",
+ "OVERLAY",
+ "CHROMAKEY",
+ "CLIPPING",
+ "FRAMERAM",
+ "SCALES",
+ "MONOCHROME",
+ "SUBCAPTURE",
+ "MPEG_DECODER",
+ "MPEG_ENCODER",
+ "MJPEG_DECODER",
+ "MJPEG_ENCODER",
+};
+
+char *bits_chan_flags[32] = {
+ "TUNER",
+ "AUDIO",
+};
+
+char *desc_chan_type[] = {
+ [ VIDEO_TYPE_TV ] = "TV",
+ [ VIDEO_TYPE_CAMERA ] = "CAMERA",
+};
+
+char *bits_tuner_flags[32] = {
+ "PAL",
+ "NTSC",
+ "SECAM",
+ "LOW",
+ "NORM",
+ "?",
+ "?",
+ "STEREO_ON",
+ "RDS_ON",
+ "MBS_ON",
+};
+
+char *desc_tuner_mode[] = {
+ [ VIDEO_MODE_PAL ] = "PAL",
+ [ VIDEO_MODE_NTSC ] = "NTSC",
+ [ VIDEO_MODE_SECAM ] = "SECAM",
+ [ VIDEO_MODE_AUTO ] = "AUTO",
+};
+
+char *desc_pict_palette[] = {
+ [ VIDEO_PALETTE_GREY ] = "GREY",
+ [ VIDEO_PALETTE_HI240 ] = "HI240",
+ [ VIDEO_PALETTE_RGB565 ] = "RGB565",
+ [ VIDEO_PALETTE_RGB24 ] = "RGB24",
+ [ VIDEO_PALETTE_RGB32 ] = "RGB32",
+ [ VIDEO_PALETTE_RGB555 ] = "RGB555",
+ [ VIDEO_PALETTE_YUV422 ] = "YUV422",
+ [ VIDEO_PALETTE_YUYV ] = "YUYV",
+ [ VIDEO_PALETTE_UYVY ] = "UYVY",
+ [ VIDEO_PALETTE_YUV420 ] = "YUV420",
+ [ VIDEO_PALETTE_YUV411 ] = "YUV411",
+ [ VIDEO_PALETTE_RAW ] = "RAW",
+ [ VIDEO_PALETTE_YUV422P ] = "YUV422P",
+ [ VIDEO_PALETTE_YUV411P ] = "YUV411P",
+ [ VIDEO_PALETTE_YUV420P ] = "YUV420P",
+ [ VIDEO_PALETTE_YUV410P ] = "YUV410P",
+};
+
+char *bits_audio_flags[32] = {
+ "MUTE",
+ "MUTABLE",
+ "VOLUME",
+ "BASS",
+ "TREBLE",
+ "BALANCE",
+};
+
+char *bits_audio_mode[32] = {
+ "MONO",
+ "STEREO",
+ "LANG1",
+ "LANG2",
+};
+
+/* ---------------------------------------------------------------------- */
+
+struct struct_desc desc_video_capability[] = {{
+ .type = STRING,
+ .name = "name",
+ .length = 32,
+},{
+ .type = BITS32,
+ .name = "type",
+ .bits = bits_vid_cap,
+},{
+ .type = SINT32,
+ .name = "channels",
+},{
+ .type = SINT32,
+ .name = "audios",
+},{
+ .type = SINT32,
+ .name = "maxwidth",
+},{
+ .type = SINT32,
+ .name = "maxheight",
+},{
+ .type = SINT32,
+ .name = "minwidth",
+},{
+ .type = SINT32,
+ .name = "minheight",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_video_channel[] = {{
+ .type = SINT32,
+ .name = "channel",
+},{
+ .type = STRING,
+ .name = "name",
+ .length = 32,
+},{
+ .type = SINT32,
+ .name = "tuners",
+},{
+ .type = BITS32,
+ .name = "flags",
+ .bits = bits_chan_flags
+},{
+ .type = ENUM16,
+ .name = "type",
+ .enums = desc_chan_type,
+ .length = sizeof(desc_chan_type) / sizeof(char*),
+},{
+ .type = UINT16,
+ .name = "norm",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_video_tuner[] = {{
+ .type = SINT32,
+ .name = "tuner",
+},{
+ .type = STRING,
+ .name = "name",
+ .length = 32,
+},{
+ .type = UINT32,
+ .name = "rangelow",
+},{
+ .type = UINT32,
+ .name = "rangehigh",
+},{
+ .type = BITS32,
+ .name = "flags",
+ .bits = bits_tuner_flags,
+},{
+ .type = ENUM16,
+ .name = "mode",
+ .enums = desc_tuner_mode,
+ .length = sizeof(desc_tuner_mode) / sizeof(char*),
+},{
+ .type = UINT16,
+ .name = "signal",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_video_picture[] = {{
+ .type = UINT16,
+ .name = "brightness",
+},{
+ .type = UINT16,
+ .name = "hue",
+},{
+ .type = UINT16,
+ .name = "colour",
+},{
+ .type = UINT16,
+ .name = "contrast",
+},{
+ .type = UINT16,
+ .name = "whiteness",
+},{
+ .type = UINT16,
+ .name = "depth",
+},{
+ .type = ENUM16,
+ .name = "palette",
+ .enums = desc_pict_palette,
+ .length = sizeof(desc_pict_palette) / sizeof(char*),
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_video_audio[] = {{
+ .type = SINT32,
+ .name = "audio",
+},{
+ .type = UINT16,
+ .name = "volume",
+},{
+ .type = UINT16,
+ .name = "bass",
+},{
+ .type = UINT16,
+ .name = "treble",
+},{
+ .type = PADDING,
+ .length = 2,
+},{
+ .type = BITS32,
+ .name = "flags",
+ .bits = bits_audio_flags,
+},{
+ .type = STRING,
+ .name = "name",
+ .length = 16,
+},{
+ .type = BITS16,
+ .name = "mode",
+ .bits = bits_audio_mode,
+},{
+ .type = UINT16,
+ .name = "balance",
+},{
+ .type = UINT16,
+ .name = "step",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_video_window[] = {{
+ .type = UINT32,
+ .name = "x",
+},{
+ .type = UINT32,
+ .name = "y",
+},{
+ .type = UINT32,
+ .name = "width",
+},{
+ .type = UINT32,
+ .name = "height",
+},{
+ .type = UINT32,
+ .name = "chromakey",
+},{
+ .type = UINT32,
+ .name = "flags",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_video_buffer[] = {{
+ .type = PTR,
+ .name = "base",
+},{
+ .type = SINT32,
+ .name = "height",
+},{
+ .type = SINT32,
+ .name = "width",
+},{
+ .type = SINT32,
+ .name = "depth",
+},{
+ .type = SINT32,
+ .name = "bytesperline",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_video_mmap[] = {{
+ .type = UINT32,
+ .name = "frame",
+},{
+ .type = SINT32,
+ .name = "height",
+},{
+ .type = SINT32,
+ .name = "width",
+},{
+ .type = UINT32,
+ .name = "format",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_video_mbuf[] = {{
+ .type = SINT32,
+ .name = "size",
+},{
+ .type = SINT32,
+ .name = "frames",
+},{
+ .type = SINT32,
+ .name = "offsets",
+ /* FIXME len=32 */
+},{
+ /* end of list */
+}};
+
+/* ---------------------------------------------------------------------- */
+
+struct ioctl_desc ioctls_v4l1[256] = {
+ [_IOC_NR(VIDIOCGCAP)] = {
+ .name = "VIDIOCGCAP",
+ .desc = desc_video_capability,
+ },
+ [_IOC_NR(VIDIOCGCHAN)] = {
+ .name = "VIDIOCGCHAN",
+ .desc = desc_video_channel,
+ },
+ [_IOC_NR(VIDIOCSCHAN)] = {
+ .name = "VIDIOCSCHAN",
+ .desc = desc_video_channel,
+ },
+ [_IOC_NR(VIDIOCGTUNER)] = {
+ .name = "VIDIOCGTUNER",
+ .desc = desc_video_tuner,
+ },
+ [_IOC_NR(VIDIOCSTUNER)] = {
+ .name = "VIDIOCSTUNER",
+ .desc = desc_video_tuner,
+ },
+ [_IOC_NR(VIDIOCGPICT)] = {
+ .name = "VIDIOCGPICT",
+ .desc = desc_video_picture,
+ },
+ [_IOC_NR(VIDIOCSPICT)] = {
+ .name = "VIDIOCSPICT",
+ .desc = desc_video_picture,
+ },
+ [_IOC_NR(VIDIOCCAPTURE)] = {
+ .name = "VIDIOCCAPTURE",
+ .desc = desc_int,
+ },
+ [_IOC_NR(VIDIOCGWIN)] = {
+ .name = "VIDIOCGWIN",
+ .desc = desc_video_window,
+ },
+ [_IOC_NR(VIDIOCSWIN)] = {
+ .name = "VIDIOCSWIN",
+ .desc = desc_video_window,
+ },
+ [_IOC_NR(VIDIOCGFBUF)] = {
+ .name = "VIDIOCGFBUF",
+ .desc = desc_video_buffer,
+ },
+ [_IOC_NR(VIDIOCSFBUF)] = {
+ .name = "VIDIOCSFBUF",
+ .desc = desc_video_buffer,
+ },
+ [_IOC_NR(VIDIOCKEY)] = {
+ .name = "VIDIOCKEY",
+// .desc = desc_video_key,
+ },
+ [_IOC_NR(VIDIOCGFREQ)] = {
+ .name = "VIDIOCGFREQ",
+ .desc = desc_long,
+ },
+ [_IOC_NR(VIDIOCSFREQ)] = {
+ .name = "VIDIOCSFREQ",
+ .desc = desc_long,
+ },
+ [_IOC_NR(VIDIOCGAUDIO)] = {
+ .name = "VIDIOCGAUDIO",
+ .desc = desc_video_audio,
+ },
+ [_IOC_NR(VIDIOCSAUDIO)] = {
+ .name = "VIDIOCSAUDIO",
+ .desc = desc_video_audio,
+ },
+ [_IOC_NR(VIDIOCSYNC)] = {
+ .name = "VIDIOCSYNC",
+ .desc = desc_int,
+ },
+ [_IOC_NR(VIDIOCMCAPTURE)] = {
+ .name = "VIDIOCMCAPTURE",
+ .desc = desc_video_mmap,
+ },
+ [_IOC_NR(VIDIOCGMBUF)] = {
+ .name = "VIDIOCGMBUF",
+ .desc = desc_video_mbuf,
+ },
+ [_IOC_NR(VIDIOCGUNIT)] = {
+ .name = "VIDIOCGUNIT",
+// .desc = desc_video_unit,
+ },
+ [_IOC_NR(VIDIOCGCAPTURE)] = {
+ .name = "VIDIOCGCAPTURE",
+// .desc = desc_video_capture,
+ },
+ [_IOC_NR(VIDIOCSCAPTURE)] = {
+ .name = "VIDIOCSCAPTURE",
+// .desc = desc_video_capture,
+ },
+ [_IOC_NR(VIDIOCSPLAYMODE)] = {
+ .name = "VIDIOCSPLAYMODE",
+// .desc = desc_video_play_mode,
+ },
+ [_IOC_NR(VIDIOCSWRITEMODE)] = {
+ .name = "VIDIOCSWRITEMODE",
+ .desc = desc_int,
+ },
+ [_IOC_NR(VIDIOCGPLAYINFO)] = {
+ .name = "VIDIOCGPLAYINFO",
+// .desc = desc_video_info,
+ },
+ [_IOC_NR(VIDIOCSMICROCODE)] = {
+ .name = "VIDIOCSMICROCODE",
+// .desc = desc_video_code,
+ },
+ [_IOC_NR(VIDIOCGVBIFMT)] = {
+ .name = "VIDIOCGVBIFMT",
+// .desc = desc_vbi_format,
+ },
+ [_IOC_NR(VIDIOCSVBIFMT)] = {
+ .name = "VIDIOCSVBIFMT",
+// .desc = desc_vbi_format,
+ },
+};
+
+/* ---------------------------------------------------------------------- */
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/structs/struct-v4l.h b/structs/struct-v4l.h
new file mode 100644
index 0000000..342ee40
--- /dev/null
+++ b/structs/struct-v4l.h
@@ -0,0 +1,20 @@
+extern char *bits_vid_cap[32];
+extern char *bits_chan_flags[32];
+extern char *desc_chan_type[];
+extern char *bits_tuner_flags[32];
+extern char *desc_tuner_mode[];
+extern char *desc_pict_palette[];
+extern char *bits_audio_flags[32];
+extern char *bits_audio_mode[32];
+
+extern struct struct_desc desc_video_capability[];
+extern struct struct_desc desc_video_channel[];
+extern struct struct_desc desc_video_tuner[];
+extern struct struct_desc desc_video_picture[];
+extern struct struct_desc desc_video_audio[];
+extern struct struct_desc desc_video_window[];
+extern struct struct_desc desc_video_buffer[];
+extern struct struct_desc desc_video_mmap[];
+extern struct struct_desc desc_video_mbuf[];
+
+extern struct ioctl_desc ioctls_v4l1[256];
diff --git a/structs/struct-v4l2.c b/structs/struct-v4l2.c
new file mode 100644
index 0000000..7237c5d
--- /dev/null
+++ b/structs/struct-v4l2.c
@@ -0,0 +1,1031 @@
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#include <asm/types.h>
+#include "videodev2.h"
+
+#include "struct-dump.h"
+#include "struct-v4l2.h"
+
+/* ---------------------------------------------------------------------- */
+
+char *desc_v4l2_field[] = {
+ [V4L2_FIELD_ANY] = "ANY",
+ [V4L2_FIELD_NONE] = "NONE",
+ [V4L2_FIELD_TOP] = "TOP",
+ [V4L2_FIELD_BOTTOM] = "BOTTOM",
+ [V4L2_FIELD_INTERLACED] = "INTERLACED",
+ [V4L2_FIELD_SEQ_TB] = "SEQ_TB",
+ [V4L2_FIELD_SEQ_BT] = "SEQ_BT",
+ [V4L2_FIELD_ALTERNATE] = "ALTERNATE",
+};
+
+char *desc_v4l2_buf_type[] = {
+ [V4L2_BUF_TYPE_VIDEO_CAPTURE] = "VIDEO_CAPTURE",
+ [V4L2_BUF_TYPE_VIDEO_OUTPUT] = "VIDEO_OUTPUT",
+ [V4L2_BUF_TYPE_VIDEO_OVERLAY] = "VIDEO_OVERLAY",
+ [V4L2_BUF_TYPE_VBI_CAPTURE] = "VBI_CAPTURE",
+ [V4L2_BUF_TYPE_VBI_OUTPUT] = "VBI_OUTPUT",
+ [V4L2_BUF_TYPE_PRIVATE] = "PRIVATE",
+};
+
+char *desc_v4l2_ctrl_type[] = {
+ [V4L2_CTRL_TYPE_INTEGER] = "INTEGER",
+ [V4L2_CTRL_TYPE_BOOLEAN] = "BOOLEAN",
+ [V4L2_CTRL_TYPE_MENU] = "MENU",
+ [V4L2_CTRL_TYPE_BUTTON] = "BUTTON",
+};
+
+char *desc_v4l2_tuner_type[] = {
+ [V4L2_TUNER_RADIO] = "RADIO",
+ [V4L2_TUNER_ANALOG_TV] = "ANALOG_TV",
+};
+
+char *desc_v4l2_memory[] = {
+ [V4L2_MEMORY_MMAP] = "MMAP",
+ [V4L2_MEMORY_USERPTR] = "USERPTR",
+ [V4L2_MEMORY_OVERLAY] = "OVERLAY",
+};
+
+char *desc_v4l2_colorspace[] = {
+ [V4L2_COLORSPACE_SMPTE170M] = "SMPTE170M",
+ [V4L2_COLORSPACE_SMPTE240M] = "SMPTE240M",
+ [V4L2_COLORSPACE_REC709] = "REC709",
+ [V4L2_COLORSPACE_BT878] = "BT878",
+ [V4L2_COLORSPACE_470_SYSTEM_M] = "470_SYSTEM_M",
+ [V4L2_COLORSPACE_470_SYSTEM_BG] = "470_SYSTEM_BG",
+ [V4L2_COLORSPACE_JPEG] = "JPEG",
+ [V4L2_COLORSPACE_SRGB] = "SRGB",
+};
+
+char *bits_capabilities[32] = {
+ "VIDEO_CAPTURE", "VIDEO_OUTPUT", "VIDEO_OVERLAY", "",
+ "VBI_CAPTURE", "VBI_OUTPUT", "?","?",
+ "RDS_CAPTURE", "?", "?", "?",
+ "?", "?", "?", "?",
+ "TUNER", "AUDIO", "?", "?",
+ "?", "?", "?", "?",
+ "READWRITE", "ASYNCIO", "STREAMING", "?",
+};
+
+char *bits_standard[64] = {
+ "PAL_B", "PAL_B1", "PAL_G", "PAL_H",
+ "PAL_I", "PAL_D", "PAL_D1", "PAL_K",
+ "PAL_M", "PAL_N", "PAL_Nc", "PAL_60",
+ "NTSC_M", "NTSC_M_JP", "?", "?",
+ "SECAM_B", "SECAM_D", "SECAM_G", "SECAM_H",
+ "SECAM_K", "SECAM_K1", "SECAM_L", "?"
+ "ATSC_8_VSB", "ATSC_16_VSB",
+};
+
+char *bits_buf_flags[32] = {
+ "MAPPED",
+ "QUEUED",
+ "DONE",
+ "KEYFRAME",
+ "PFRAME",
+ "BFRAME",
+ "?", "?",
+ "TIMECODE",
+};
+
+char *bits_fbuf_cap[32] = {
+ "EXTERNOVERLAY",
+ "CHROMAKEY",
+ "LIST_CLIPPING",
+ "BITMAP_CLIPPING",
+};
+
+char *bits_fbuf_flags[32] = {
+ "PRIMARY",
+ "OVERLAY",
+ "CHROMAKEY",
+};
+
+char *desc_input_type[32] = {
+ [ V4L2_INPUT_TYPE_TUNER ] = "TUNER",
+ [ V4L2_INPUT_TYPE_CAMERA ] = "CAMERA",
+};
+
+char *bits_input_status[32] = {
+ "NO_POWER", "NO_SIGNAL", "NO_COLOR", "?",
+ "?","?","?","?",
+ "NO_H_LOCK", "COLOR_KILL", "?", "?",
+ "?","?","?","?",
+ "NO_SYNC", "NO_EQU", "NO_CARRIER", "?",
+ "?","?","?","?",
+ "MACROVISION", "NO_ACCESS", "VTR", "?",
+ "?","?","?","?",
+};
+
+char *bits_tuner_cap[32] = {
+ "LOW", "NORM", "?", "?",
+ "STEREO", "LANG2", "LANG1", "?",
+};
+
+char *bits_tuner_rx[32] = {
+ "MONO",
+ "STEREO",
+ "LANG2",
+ "LANG1",
+};
+
+char *desc_tuner2_mode[] = {
+ [ V4L2_TUNER_MODE_MONO ] = "MONO",
+ [ V4L2_TUNER_MODE_STEREO ] = "STEREO",
+ [ V4L2_TUNER_MODE_LANG2 ] = "LANG2",
+ [ V4L2_TUNER_MODE_LANG1 ] = "LANG1",
+};
+
+/* ---------------------------------------------------------------------- */
+
+struct struct_desc desc_v4l2_rect[] = {{
+ .type = SINT32,
+ .name = "left",
+},{
+ .type = SINT32,
+ .name = "top",
+},{
+ .type = SINT32,
+ .name = "width",
+},{
+ .type = SINT32,
+ .name = "height",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_fract[] = {{
+ .type = UINT32,
+ .name = "numerator",
+},{
+ .type = UINT32,
+ .name = "denominator",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_capability[] = {{
+ .type = STRING,
+ .name = "driver",
+ .length = 16,
+},{
+ .type = STRING,
+ .name = "card",
+ .length = 32,
+},{
+ .type = STRING,
+ .name = "bus_info",
+ .length = 32,
+},{
+ .type = VER,
+ .name = "version",
+},{
+ .type = BITS32,
+ .name = "capabilities",
+ .bits = bits_capabilities,
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_pix_format[] = {{
+ .type = UINT32,
+ .name = "width",
+},{
+ .type = UINT32,
+ .name = "height",
+},{
+ .type = FOURCC,
+ .name = "pixelformat",
+},{
+ .type = ENUM32,
+ .name = "field",
+ .enums = desc_v4l2_field,
+ .length = sizeof(desc_v4l2_field) / sizeof(char*),
+},{
+ .type = UINT32,
+ .name = "bytesperline",
+},{
+ .type = UINT32,
+ .name = "sizeimage",
+},{
+ .type = ENUM32,
+ .name = "colorspace",
+ .enums = desc_v4l2_colorspace,
+ .length = sizeof(desc_v4l2_colorspace) / sizeof(char*),
+},{
+ .type = UINT32,
+ .name = "priv",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_fmtdesc[] = {{
+ .type = UINT32,
+ .name = "index",
+},{
+ .type = ENUM32,
+ .name = "type",
+ .enums = desc_v4l2_buf_type,
+ .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
+},{
+ .type = UINT32,
+ .name = "flags",
+},{
+ .type = STRING,
+ .name = "description",
+ .length = 32,
+},{
+ .type = FOURCC,
+ .name = "pixelformat",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_timecode[] = {{
+ .type = UINT32,
+ .name = "type",
+},{
+ .type = UINT32,
+ .name = "flags",
+},{
+ .type = UINT8,
+ .name = "frames",
+},{
+ .type = UINT8,
+ .name = "seconds",
+},{
+ .type = UINT8,
+ .name = "minutes",
+},{
+ .type = UINT8,
+ .name = "hours",
+},{
+ .type = STRING,
+ .name = "userbits",
+ .length = 4,
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_compression[] = {{
+ .type = UINT32,
+ .name = "quality",
+},{
+ .type = UINT32,
+ .name = "keyframerate",
+},{
+ .type = UINT32,
+ .name = "pframerate",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_jpegcompression[] = {{
+ .type = SINT32,
+ .name = "quality",
+},{
+ .type = SINT32,
+ .name = "APPn",
+},{
+ .type = SINT32,
+ .name = "APP_len",
+},{
+ .type = STRING,
+ .name = "APP_data",
+ .length = 60,
+},{
+ .type = SINT32,
+ .name = "COM_len",
+},{
+ .type = STRING,
+ .name = "COM_data",
+ .length = 60,
+},{
+ .type = UINT32,
+ .name = "jpeg_markers",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_requestbuffers[] = {{
+ .type = UINT32,
+ .name = "count",
+},{
+ .type = ENUM32,
+ .name = "type",
+ .enums = desc_v4l2_buf_type,
+ .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
+},{
+ .type = ENUM32,
+ .name = "memory",
+ .enums = desc_v4l2_memory,
+ .length = sizeof(desc_v4l2_memory) / sizeof(char*),
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_buffer[] = {{
+ .type = UINT32,
+ .name = "index",
+},{
+ .type = ENUM32,
+ .name = "type",
+ .enums = desc_v4l2_buf_type,
+ .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
+},{
+ .type = UINT32,
+ .name = "bytesused",
+},{
+ .type = BITS32,
+ .name = "flags",
+ .bits = bits_buf_flags,
+},{
+ .type = ENUM32,
+ .name = "field",
+ .enums = desc_v4l2_field,
+ .length = sizeof(desc_v4l2_field) / sizeof(char*),
+},{
+ .type = STRUCT,
+ .name = "timestamp",
+ .desc = desc_timeval,
+ .length = sizeof(struct timeval),
+},{
+ .type = STRUCT,
+ .name = "timecode",
+ .desc = desc_v4l2_timecode,
+ .length = sizeof(struct v4l2_timecode),
+},{
+ .type = UINT32,
+ .name = "sequence",
+},{
+ .type = ENUM32,
+ .name = "memory",
+ .enums = desc_v4l2_memory,
+ .length = sizeof(desc_v4l2_memory) / sizeof(char*),
+},{
+ /* FIXME ... */
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_framebuffer[] = {{
+ .type = BITS32,
+ .name = "capability",
+ .bits = bits_fbuf_cap,
+},{
+ .type = BITS32,
+ .name = "flags",
+ .bits = bits_fbuf_flags,
+},{
+ .type = PTR,
+ .name = "base",
+},{
+ .type = STRUCT,
+ .name = "fmt",
+ .desc = desc_v4l2_pix_format,
+ .length = sizeof(struct v4l2_pix_format),
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_clip[] = {{
+ .type = STRUCT,
+ .name = "c",
+ .desc = desc_v4l2_rect,
+ .length = sizeof(struct v4l2_rect),
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_window[] = {{
+ .type = STRUCT,
+ .name = "w",
+ .desc = desc_v4l2_rect,
+ .length = sizeof(struct v4l2_rect),
+},{
+ .type = ENUM32,
+ .name = "field",
+ .enums = desc_v4l2_field,
+ .length = sizeof(desc_v4l2_field) / sizeof(char*),
+},{
+ .type = UINT32,
+ .name = "chromakey",
+},{
+ .type = PTR,
+ .name = "clips",
+},{
+ .type = UINT32,
+ .name = "clipcount",
+},{
+ .type = PTR,
+ .name = "bitmap",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_captureparm[] = {{
+ .type = UINT32,
+ .name = "capability",
+},{
+ .type = UINT32,
+ .name = "capturemode",
+},{
+ .type = STRUCT,
+ .name = "timeperframe",
+ .desc = desc_v4l2_fract,
+ .length = sizeof(struct v4l2_fract),
+},{
+ .type = UINT32,
+ .name = "extendedmode",
+},{
+ .type = UINT32,
+ .name = "readbuffers",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_outputparm[] = {{
+ .type = UINT32,
+ .name = "capability",
+},{
+ .type = UINT32,
+ .name = "outputmode",
+},{
+ .type = STRUCT,
+ .name = "timeperframe",
+ .desc = desc_v4l2_fract,
+ .length = sizeof(struct v4l2_fract),
+},{
+ .type = UINT32,
+ .name = "extendedmode",
+},{
+ .type = UINT32,
+ .name = "writebuffers",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_cropcap[] = {{
+ .type = ENUM32,
+ .name = "type",
+ .enums = desc_v4l2_buf_type,
+ .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
+},{
+ .type = STRUCT,
+ .name = "bounds",
+ .desc = desc_v4l2_rect,
+ .length = sizeof(struct v4l2_rect),
+},{
+ .type = STRUCT,
+ .name = "defrect",
+ .desc = desc_v4l2_rect,
+ .length = sizeof(struct v4l2_rect),
+},{
+ .type = STRUCT,
+ .name = "pixelaspect",
+ .desc = desc_v4l2_fract,
+ .length = sizeof(struct v4l2_fract),
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_crop[] = {{
+ .type = ENUM32,
+ .name = "type",
+ .enums = desc_v4l2_buf_type,
+ .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
+},{
+ .type = STRUCT,
+ .name = "c",
+ .desc = desc_v4l2_rect,
+ .length = sizeof(struct v4l2_rect),
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_standard[] = {{
+ .type = UINT32,
+ .name = "index",
+},{
+ .type = BITS64,
+ .name = "id",
+ .bits = bits_standard,
+},{
+ .type = STRING,
+ .name = "name",
+ .length = 24,
+},{
+ .type = STRUCT,
+ .name = "frameperiod",
+ .desc = desc_v4l2_fract,
+ .length = sizeof(struct v4l2_fract),
+},{
+ .type = UINT32,
+ .name = "framelines",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_input[] = {{
+ .type = UINT32,
+ .name = "index",
+},{
+ .type = STRING,
+ .name = "name",
+ .length = 32,
+},{
+ .type = ENUM32,
+ .name = "type",
+ .enums = desc_input_type,
+ .length = sizeof(desc_input_type) / sizeof(char*),
+},{
+ .type = UINT32,
+ .name = "audioset",
+},{
+ .type = UINT32,
+ .name = "tuner",
+},{
+ .type = BITS64,
+ .name = "std",
+ .bits = bits_standard
+},{
+ .type = BITS32,
+ .name = "status",
+ .bits = bits_input_status,
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_output[] = {{
+ .type = UINT32,
+ .name = "index",
+},{
+ .type = STRING,
+ .name = "name",
+ .length = 32,
+},{
+ .type = UINT32,
+ .name = "type",
+},{
+ .type = UINT32,
+ .name = "audioset",
+},{
+ .type = UINT32,
+ .name = "modulator",
+},{
+ .type = BITS64,
+ .name = "std",
+ .bits = bits_standard
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_control[] = {{
+ .type = UINT32,
+ .name = "id",
+},{
+ .type = SINT32,
+ .name = "value",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_queryctrl[] = {{
+ .type = UINT32,
+ .name = "id",
+},{
+ .type = ENUM32,
+ .name = "type",
+ .enums = desc_v4l2_ctrl_type,
+ .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
+},{
+ .type = STRING,
+ .name = "name",
+ .length = 32,
+},{
+ .type = SINT32,
+ .name = "minimum",
+},{
+ .type = SINT32,
+ .name = "maximum",
+},{
+ .type = SINT32,
+ .name = "step",
+},{
+ .type = SINT32,
+ .name = "default_value",
+},{
+ .type = UINT32,
+ .name = "flags",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_querymenu[] = {{
+ .type = UINT32,
+ .name = "id",
+},{
+ .type = UINT32,
+ .name = "index",
+},{
+ .type = STRING,
+ .name = "name",
+ .length = 32,
+},{
+ .type = UINT32,
+ .name = "reserved",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_tuner[] = {{
+ .type = UINT32,
+ .name = "index",
+},{
+ .type = STRING,
+ .name = "name",
+ .length = 32,
+},{
+ .type = ENUM32,
+ .name = "type",
+ .enums = desc_v4l2_tuner_type,
+ .length = sizeof(desc_v4l2_tuner_type) / sizeof(char*),
+},{
+ .type = BITS32,
+ .name = "capability",
+ .bits = bits_tuner_cap,
+},{
+ .type = UINT32,
+ .name = "rangelow",
+},{
+ .type = UINT32,
+ .name = "rangehigh",
+},{
+ .type = BITS32,
+ .name = "rxsubchans",
+ .bits = bits_tuner_rx,
+},{
+ .type = ENUM32,
+ .name = "audmode",
+ .enums = desc_tuner2_mode,
+ .length = sizeof(desc_tuner2_mode) / sizeof(char*),
+},{
+ .type = SINT32,
+ .name = "signal",
+},{
+ .type = SINT32,
+ .name = "afc",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_modulator[] = {{
+ .type = UINT32,
+ .name = "index",
+},{
+ .type = STRING,
+ .name = "name",
+ .length = 32,
+},{
+ .type = UINT32,
+ .name = "capability",
+},{
+ .type = UINT32,
+ .name = "rangelow",
+},{
+ .type = UINT32,
+ .name = "rangehigh",
+},{
+ .type = UINT32,
+ .name = "txsubchans",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_frequency[] = {{
+ .type = UINT32,
+ .name = "tuner",
+},{
+ .type = ENUM32,
+ .name = "type",
+ .enums = desc_v4l2_tuner_type,
+ .length = sizeof(desc_v4l2_tuner_type) / sizeof(char*),
+},{
+ .type = UINT32,
+ .name = "frequency",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_audio[] = {{
+ .type = UINT32,
+ .name = "index",
+},{
+ .type = STRING,
+ .name = "name",
+ .length = 32,
+},{
+ .type = UINT32,
+ .name = "capability",
+},{
+ .type = UINT32,
+ .name = "mode",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_audioout[] = {{
+ .type = UINT32,
+ .name = "index",
+},{
+ .type = STRING,
+ .name = "name",
+ .length = 32,
+},{
+ .type = UINT32,
+ .name = "capability",
+},{
+ .type = UINT32,
+ .name = "mode",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_vbi_format[] = {{
+ .type = UINT32,
+ .name = "sampling_rate",
+},{
+ .type = UINT32,
+ .name = "offset",
+},{
+ .type = UINT32,
+ .name = "samples_per_line",
+},{
+ .type = FOURCC,
+ .name = "sample_format",
+},{
+ .type = UINT32,
+ .name = "start[0]",
+},{
+ .type = UINT32,
+ .name = "start[1]",
+},{
+ .type = UINT32,
+ .name = "count[0]",
+},{
+ .type = UINT32,
+ .name = "count[1]",
+},{
+ .type = UINT32,
+ .name = "flags",
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_format[] = {{
+ .type = ENUM32,
+ .name = "type",
+ .enums = desc_v4l2_buf_type,
+ .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
+},{
+ .type = UNION,
+ .name = "fmt",
+ .u = {{
+ .value = V4L2_BUF_TYPE_VIDEO_CAPTURE,
+ .name = "pix",
+ .desc = desc_v4l2_pix_format,
+ },{
+ .value = V4L2_BUF_TYPE_VIDEO_OVERLAY,
+ .name = "win",
+ .desc = desc_v4l2_window,
+ },{
+ .value = V4L2_BUF_TYPE_VBI_CAPTURE,
+ .name = "vbi",
+ .desc = desc_v4l2_vbi_format,
+ },{
+ /* end of list */
+ }},
+},{
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_streamparm[] = {{
+ .type = ENUM32,
+ .name = "type",
+ .enums = desc_v4l2_buf_type,
+ .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
+},{
+ /* FIXME ... */
+ /* end of list */
+}};
+
+struct struct_desc desc_v4l2_std_id[] = {{
+ .type = BITS64,
+ .name = "std",
+ .bits = bits_standard,
+},{
+ /* end of list */
+}};
+
+/* ---------------------------------------------------------------------- */
+
+struct ioctl_desc ioctls_v4l2[256] = {
+ [_IOC_NR(VIDIOC_QUERYCAP)] = {
+ .name = "VIDIOC_QUERYCAP",
+ .desc = desc_v4l2_capability,
+ },
+ [_IOC_NR(VIDIOC_ENUM_FMT)] = {
+ .name = "VIDIOC_ENUM_FMT",
+ .desc = desc_v4l2_fmtdesc,
+ },
+ [_IOC_NR(VIDIOC_G_FMT)] = {
+ .name = "VIDIOC_G_FMT",
+ .desc = desc_v4l2_format,
+ },
+ [_IOC_NR(VIDIOC_S_FMT)] = {
+ .name = "VIDIOC_S_FMT",
+ .desc = desc_v4l2_format,
+ },
+#if 0
+ [_IOC_NR(VIDIOC_G_COMP)] = {
+ .name = "VIDIOC_G_COMP",
+ .desc = desc_v4l2_compression,
+ },
+ [_IOC_NR(VIDIOC_S_COMP)] = {
+ .name = "VIDIOC_S_COMP",
+ .desc = desc_v4l2_compression,
+ },
+#endif
+ [_IOC_NR(VIDIOC_REQBUFS)] = {
+ .name = "VIDIOC_REQBUFS",
+ .desc = desc_v4l2_requestbuffers,
+ },
+ [_IOC_NR(VIDIOC_QUERYBUF)] = {
+ .name = "VIDIOC_QUERYBUF",
+ .desc = desc_v4l2_buffer,
+ },
+ [_IOC_NR(VIDIOC_G_FBUF)] = {
+ .name = "VIDIOC_G_FBUF",
+ .desc = desc_v4l2_framebuffer,
+ },
+ [_IOC_NR(VIDIOC_S_FBUF)] = {
+ .name = "VIDIOC_S_FBUF",
+ .desc = desc_v4l2_framebuffer,
+ },
+ [_IOC_NR(VIDIOC_OVERLAY)] = {
+ .name = "VIDIOC_OVERLAY",
+ .desc = desc_int,
+ },
+ [_IOC_NR(VIDIOC_QBUF)] = {
+ .name = "VIDIOC_QBUF",
+ .desc = desc_v4l2_buffer,
+ },
+ [_IOC_NR(VIDIOC_DQBUF)] = {
+ .name = "VIDIOC_DQBUF",
+ .desc = desc_v4l2_buffer,
+ },
+ [_IOC_NR(VIDIOC_STREAMON)] = {
+ .name = "VIDIOC_STREAMON",
+ .desc = desc_int,
+ },
+ [_IOC_NR(VIDIOC_STREAMOFF)] = {
+ .name = "VIDIOC_STREAMOFF",
+ .desc = desc_int,
+ },
+ [_IOC_NR(VIDIOC_G_PARM)] = {
+ .name = "VIDIOC_G_PARM",
+ .desc = desc_v4l2_streamparm,
+ },
+ [_IOC_NR(VIDIOC_S_PARM)] = {
+ .name = "VIDIOC_S_PARM",
+ .desc = desc_v4l2_streamparm,
+ },
+ [_IOC_NR(VIDIOC_G_STD)] = {
+ .name = "VIDIOC_G_STD",
+ .desc = desc_v4l2_std_id,
+ },
+ [_IOC_NR(VIDIOC_S_STD)] = {
+ .name = "VIDIOC_S_STD",
+ .desc = desc_v4l2_std_id,
+ },
+ [_IOC_NR(VIDIOC_ENUMSTD)] = {
+ .name = "VIDIOC_ENUMSTD",
+ .desc = desc_v4l2_standard,
+ },
+ [_IOC_NR(VIDIOC_ENUMINPUT)] = {
+ .name = "VIDIOC_ENUMINPUT",
+ .desc = desc_v4l2_input,
+ },
+ [_IOC_NR(VIDIOC_G_CTRL)] = {
+ .name = "VIDIOC_G_CTRL",
+ .desc = desc_v4l2_control,
+ },
+ [_IOC_NR(VIDIOC_S_CTRL)] = {
+ .name = "VIDIOC_S_CTRL",
+ .desc = desc_v4l2_control,
+ },
+ [_IOC_NR(VIDIOC_G_TUNER)] = {
+ .name = "VIDIOC_G_TUNER",
+ .desc = desc_v4l2_tuner,
+ },
+ [_IOC_NR(VIDIOC_S_TUNER)] = {
+ .name = "VIDIOC_S_TUNER",
+ .desc = desc_v4l2_tuner,
+ },
+ [_IOC_NR(VIDIOC_G_AUDIO)] = {
+ .name = "VIDIOC_G_AUDIO",
+ .desc = desc_v4l2_audio,
+ },
+ [_IOC_NR(VIDIOC_S_AUDIO)] = {
+ .name = "VIDIOC_S_AUDIO",
+ .desc = desc_v4l2_audio,
+ },
+ [_IOC_NR(VIDIOC_QUERYCTRL)] = {
+ .name = "VIDIOC_QUERYCTRL",
+ .desc = desc_v4l2_queryctrl,
+ },
+ [_IOC_NR(VIDIOC_QUERYMENU)] = {
+ .name = "VIDIOC_QUERYMENU",
+ .desc = desc_v4l2_querymenu,
+ },
+ [_IOC_NR(VIDIOC_G_INPUT)] = {
+ .name = "VIDIOC_G_INPUT",
+ .desc = desc_int,
+ },
+ [_IOC_NR(VIDIOC_S_INPUT)] = {
+ .name = "VIDIOC_S_INPUT",
+ .desc = desc_int,
+ },
+ [_IOC_NR(VIDIOC_G_OUTPUT)] = {
+ .name = "VIDIOC_G_OUTPUT",
+ .desc = desc_int,
+ },
+ [_IOC_NR(VIDIOC_S_OUTPUT)] = {
+ .name = "VIDIOC_S_OUTPUT",
+ .desc = desc_int,
+ },
+ [_IOC_NR(VIDIOC_ENUMOUTPUT)] = {
+ .name = "VIDIOC_ENUMOUTPUT",
+ .desc = desc_v4l2_output,
+ },
+ [_IOC_NR(VIDIOC_G_AUDOUT)] = {
+ .name = "VIDIOC_G_AUDOUT",
+ .desc = desc_v4l2_audioout,
+ },
+ [_IOC_NR(VIDIOC_S_AUDOUT)] = {
+ .name = "VIDIOC_S_AUDOUT",
+ .desc = desc_v4l2_audioout,
+ },
+ [_IOC_NR(VIDIOC_G_MODULATOR)] = {
+ .name = "VIDIOC_G_MODULATOR",
+ .desc = desc_v4l2_modulator,
+ },
+ [_IOC_NR(VIDIOC_S_MODULATOR)] = {
+ .name = "VIDIOC_S_MODULATOR",
+ .desc = desc_v4l2_modulator,
+ },
+ [_IOC_NR(VIDIOC_G_FREQUENCY)] = {
+ .name = "VIDIOC_G_FREQUENCY",
+ .desc = desc_v4l2_frequency,
+ },
+ [_IOC_NR(VIDIOC_S_FREQUENCY)] = {
+ .name = "VIDIOC_S_FREQUENCY",
+ .desc = desc_v4l2_frequency,
+ },
+ [_IOC_NR(VIDIOC_CROPCAP)] = {
+ .name = "VIDIOC_CROPCAP",
+ .desc = desc_v4l2_cropcap,
+ },
+ [_IOC_NR(VIDIOC_G_CROP)] = {
+ .name = "VIDIOC_G_CROP",
+ .desc = desc_v4l2_crop,
+ },
+ [_IOC_NR(VIDIOC_S_CROP)] = {
+ .name = "VIDIOC_S_CROP",
+ .desc = desc_v4l2_crop,
+ },
+ [_IOC_NR(VIDIOC_G_JPEGCOMP)] = {
+ .name = "VIDIOC_G_JPEGCOMP",
+ .desc = desc_v4l2_jpegcompression,
+ },
+ [_IOC_NR(VIDIOC_S_JPEGCOMP)] = {
+ .name = "VIDIOC_S_JPEGCOMP",
+ .desc = desc_v4l2_jpegcompression,
+ },
+ [_IOC_NR(VIDIOC_QUERYSTD)] = {
+ .name = "VIDIOC_QUERYSTD",
+ .desc = desc_v4l2_std_id,
+ },
+ [_IOC_NR(VIDIOC_TRY_FMT)] = {
+ .name = "VIDIOC_TRY_FMT",
+ .desc = desc_v4l2_format,
+ },
+};
+
+/* ---------------------------------------------------------------------- */
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/structs/struct-v4l2.h b/structs/struct-v4l2.h
new file mode 100644
index 0000000..da3a3fa
--- /dev/null
+++ b/structs/struct-v4l2.h
@@ -0,0 +1,50 @@
+extern char *desc_v4l2_field[];
+extern char *desc_v4l2_buf_type[];
+extern char *desc_v4l2_ctrl_type[];
+extern char *desc_v4l2_tuner_type[];
+extern char *desc_v4l2_memory[];
+extern char *desc_v4l2_colorspace[];
+extern char *bits_capabilities[32];
+extern char *bits_standard[64];
+extern char *bits_buf_flags[32];
+extern char *bits_fbuf_cap[32];
+extern char *bits_fbuf_flags[32];
+extern char *desc_input_type[32];
+extern char *bits_input_status[32];
+extern char *bits_tuner_cap[32];
+extern char *bits_tuner_rx[32];
+extern char *desc_tuner2_mode[];
+
+extern struct struct_desc desc_v4l2_rect[];
+extern struct struct_desc desc_v4l2_fract[];
+extern struct struct_desc desc_v4l2_capability[];
+extern struct struct_desc desc_v4l2_pix_format[];
+extern struct struct_desc desc_v4l2_fmtdesc[];
+extern struct struct_desc desc_v4l2_timecode[];
+extern struct struct_desc desc_v4l2_compression[];
+extern struct struct_desc desc_v4l2_jpegcompression[];
+extern struct struct_desc desc_v4l2_requestbuffers[];
+extern struct struct_desc desc_v4l2_buffer[];
+extern struct struct_desc desc_v4l2_framebuffer[];
+extern struct struct_desc desc_v4l2_clip[];
+extern struct struct_desc desc_v4l2_window[];
+extern struct struct_desc desc_v4l2_captureparm[];
+extern struct struct_desc desc_v4l2_outputparm[];
+extern struct struct_desc desc_v4l2_cropcap[];
+extern struct struct_desc desc_v4l2_crop[];
+extern struct struct_desc desc_v4l2_standard[];
+extern struct struct_desc desc_v4l2_input[];
+extern struct struct_desc desc_v4l2_output[];
+extern struct struct_desc desc_v4l2_control[];
+extern struct struct_desc desc_v4l2_queryctrl[];
+extern struct struct_desc desc_v4l2_querymenu[];
+extern struct struct_desc desc_v4l2_tuner[];
+extern struct struct_desc desc_v4l2_modulator[];
+extern struct struct_desc desc_v4l2_frequency[];
+extern struct struct_desc desc_v4l2_audio[];
+extern struct struct_desc desc_v4l2_audioout[];
+extern struct struct_desc desc_v4l2_vbi_format[];
+extern struct struct_desc desc_v4l2_format[];
+extern struct struct_desc desc_v4l2_streamparm[];
+
+extern struct ioctl_desc ioctls_v4l2[256];
diff --git a/structs/struct2desc b/structs/struct2desc
new file mode 100644
index 0000000..7ca7386
--- /dev/null
+++ b/structs/struct2desc
@@ -0,0 +1,87 @@
+#!/usr/bin/perl
+use strict;
+
+my %mapit = (
+ "int" => "SINT32",
+ "__s32" => "SINT32",
+ "__u32" => "UINT32",
+ "__s16" => "SINT16",
+ "__u16" => "UINT16",
+ "__s8" => "SINT8",
+ "__u8" => "UINT8",
+);
+
+my $struct = 0;
+my $enum = 0;
+
+while (my $line = <>) {
+
+ # start of struct
+ if ($line =~ m/^struct\s+(\w+)/) {
+ die "--\n$line\nstruct is 1" if $struct == 1;
+ $struct = 1;
+ print "\n";
+ print "struct struct_desc desc_$1\[\] = {{\n";
+ next;
+ }
+ next if ($struct == 1 && $line =~ /^\{/);
+
+ # end of struct
+ if ($struct == 1 && $line =~ m/^\};/) {
+ $struct = 0;
+ print " .type = END_OF_LIST,\n";
+ print "}};\n";
+ next;
+ }
+
+ # struct elements
+ if ($struct == 1 && $line =~ m/^\s+(int|__u32|__s32|__u16|__s16|__u8|__s8)\s+(\w+);/) {
+ print " .type = $mapit{$1},\n";
+ print " .name = \"$2\",\n";
+ print "},{\n";
+ next;
+ }
+ if ($struct == 1 && $line =~ m/^\s+(char|__u8)\s+(\w+)\[(\d+)\];/) {
+ print " .type = STRING,\n";
+ print " .name = \"$2\",\n";
+ print " .length = $3,\n";
+ print "},{\n";
+ next;
+ }
+ if ($struct == 1 && $line =~ m/^\s+enum\s+(\w+)\s+(\w+);/) {
+ print " .type = ENUM,\n";
+ print " .name = \"$2\",\n";
+ print " .enums = desc_$1,\n";
+ print "},{\n";
+ next;
+ }
+
+
+ # start of enum
+ if ($line =~ m/^enum\s+(\w+)/) {
+ die "--\n$line\nenum is 1" if $enum == 1;
+ $enum = 1;
+ print "\n";
+ print "char desc_$1\[\] = {\n";
+ next;
+ }
+
+ # end of enum
+ if ($enum == 1 && $line =~ m/^\};/) {
+ $enum = 0;
+ print "};\n";
+ next;
+ }
+
+ # enum elements
+ if ($enum == 1 && $line =~ m/^\s+(\w+)/) {
+ print " [$1] = \"$1\",\n";
+ next;
+ }
+
+ next if $line =~ m/#define/;
+ next if $struct == 0;
+
+ chomp $line;
+ print "/* FIXME $line */\n";
+}
diff --git a/structs/x b/structs/x
new file mode 100644
index 0000000..7152db4
--- /dev/null
+++ b/structs/x
@@ -0,0 +1,188 @@
+[_IOC_NR(VIDIOC_QUERYCAP)] = {
+ .name = "VIDIOC_QUERYCAP",
+ .desc = desc_v4l2_capability,
+},
+[_IOC_NR(VIDIOC_ENUM_FMT)] = {
+ .name = "VIDIOC_ENUM_FMT",
+ .desc = desc_v4l2_fmtdesc,
+},
+[_IOC_NR(VIDIOC_G_FMT)] = {
+ .name = "VIDIOC_G_FMT",
+ .desc = desc_v4l2_format,
+},
+[_IOC_NR(VIDIOC_S_FMT)] = {
+ .name = "VIDIOC_S_FMT",
+ .desc = desc_v4l2_format,
+},
+[_IOC_NR(VIDIOC_G_COMP)] = {
+ .name = "VIDIOC_G_COMP",
+ .desc = desc_v4l2_compression,
+},
+[_IOC_NR(VIDIOC_S_COMP)] = {
+ .name = "VIDIOC_S_COMP",
+ .desc = desc_v4l2_compression,
+},
+[_IOC_NR(VIDIOC_REQBUFS)] = {
+ .name = "VIDIOC_REQBUFS",
+ .desc = desc_v4l2_requestbuffers,
+},
+[_IOC_NR(VIDIOC_QUERYBUF)] = {
+ .name = "VIDIOC_QUERYBUF",
+ .desc = desc_v4l2_buffer,
+},
+[_IOC_NR(VIDIOC_G_FBUF)] = {
+ .name = "VIDIOC_G_FBUF",
+ .desc = desc_v4l2_framebuffer,
+},
+[_IOC_NR(VIDIOC_S_FBUF)] = {
+ .name = "VIDIOC_S_FBUF",
+ .desc = desc_v4l2_framebuffer,
+},
+[_IOC_NR(VIDIOC_OVERLAY)] = {
+ .name = "VIDIOC_OVERLAY",
+ .desc = int,
+},
+[_IOC_NR(VIDIOC_QBUF)] = {
+ .name = "VIDIOC_QBUF",
+ .desc = desc_v4l2_buffer,
+},
+[_IOC_NR(VIDIOC_DQBUF)] = {
+ .name = "VIDIOC_DQBUF",
+ .desc = desc_v4l2_buffer,
+},
+[_IOC_NR(VIDIOC_STREAMON)] = {
+ .name = "VIDIOC_STREAMON",
+ .desc = int,
+},
+[_IOC_NR(VIDIOC_STREAMOFF)] = {
+ .name = "VIDIOC_STREAMOFF",
+ .desc = int,
+},
+[_IOC_NR(VIDIOC_G_PARM)] = {
+ .name = "VIDIOC_G_PARM",
+ .desc = desc_v4l2_streamparm,
+},
+[_IOC_NR(VIDIOC_S_PARM)] = {
+ .name = "VIDIOC_S_PARM",
+ .desc = desc_v4l2_streamparm,
+},
+[_IOC_NR(VIDIOC_G_STD)] = {
+ .name = "VIDIOC_G_STD",
+ .desc = v4l2_std_id,
+},
+[_IOC_NR(VIDIOC_S_STD)] = {
+ .name = "VIDIOC_S_STD",
+ .desc = v4l2_std_id,
+},
+[_IOC_NR(VIDIOC_ENUMSTD)] = {
+ .name = "VIDIOC_ENUMSTD",
+ .desc = desc_v4l2_standard,
+},
+[_IOC_NR(VIDIOC_ENUMINPUT)] = {
+ .name = "VIDIOC_ENUMINPUT",
+ .desc = desc_v4l2_input,
+},
+[_IOC_NR(VIDIOC_G_CTRL)] = {
+ .name = "VIDIOC_G_CTRL",
+ .desc = desc_v4l2_control,
+},
+[_IOC_NR(VIDIOC_S_CTRL)] = {
+ .name = "VIDIOC_S_CTRL",
+ .desc = desc_v4l2_control,
+},
+[_IOC_NR(VIDIOC_G_TUNER)] = {
+ .name = "VIDIOC_G_TUNER",
+ .desc = desc_v4l2_tuner,
+},
+[_IOC_NR(VIDIOC_S_TUNER)] = {
+ .name = "VIDIOC_S_TUNER",
+ .desc = desc_v4l2_tuner,
+},
+[_IOC_NR(VIDIOC_G_AUDIO)] = {
+ .name = "VIDIOC_G_AUDIO",
+ .desc = desc_v4l2_audio,
+},
+[_IOC_NR(VIDIOC_S_AUDIO)] = {
+ .name = "VIDIOC_S_AUDIO",
+ .desc = desc_v4l2_audio,
+},
+[_IOC_NR(VIDIOC_QUERYCTRL)] = {
+ .name = "VIDIOC_QUERYCTRL",
+ .desc = desc_v4l2_queryctrl,
+},
+[_IOC_NR(VIDIOC_QUERYMENU)] = {
+ .name = "VIDIOC_QUERYMENU",
+ .desc = desc_v4l2_querymenu,
+},
+[_IOC_NR(VIDIOC_G_INPUT)] = {
+ .name = "VIDIOC_G_INPUT",
+ .desc = int,
+},
+[_IOC_NR(VIDIOC_S_INPUT)] = {
+ .name = "VIDIOC_S_INPUT",
+ .desc = int,
+},
+[_IOC_NR(VIDIOC_G_OUTPUT)] = {
+ .name = "VIDIOC_G_OUTPUT",
+ .desc = int,
+},
+[_IOC_NR(VIDIOC_S_OUTPUT)] = {
+ .name = "VIDIOC_S_OUTPUT",
+ .desc = int,
+},
+[_IOC_NR(VIDIOC_ENUMOUTPUT)] = {
+ .name = "VIDIOC_ENUMOUTPUT",
+ .desc = desc_v4l2_output,
+},
+[_IOC_NR(VIDIOC_G_AUDOUT)] = {
+ .name = "VIDIOC_G_AUDOUT",
+ .desc = desc_v4l2_audioout,
+},
+[_IOC_NR(VIDIOC_S_AUDOUT)] = {
+ .name = "VIDIOC_S_AUDOUT",
+ .desc = desc_v4l2_audioout,
+},
+[_IOC_NR(VIDIOC_G_MODULATOR)] = {
+ .name = "VIDIOC_G_MODULATOR",
+ .desc = desc_v4l2_modulator,
+},
+[_IOC_NR(VIDIOC_S_MODULATOR)] = {
+ .name = "VIDIOC_S_MODULATOR",
+ .desc = desc_v4l2_modulator,
+},
+[_IOC_NR(VIDIOC_G_FREQUENCY)] = {
+ .name = "VIDIOC_G_FREQUENCY",
+ .desc = desc_v4l2_frequency,
+},
+[_IOC_NR(VIDIOC_S_FREQUENCY)] = {
+ .name = "VIDIOC_S_FREQUENCY",
+ .desc = desc_v4l2_frequency,
+},
+[_IOC_NR(VIDIOC_CROPCAP)] = {
+ .name = "VIDIOC_CROPCAP",
+ .desc = desc_v4l2_cropcap,
+},
+[_IOC_NR(VIDIOC_G_CROP)] = {
+ .name = "VIDIOC_G_CROP",
+ .desc = desc_v4l2_crop,
+},
+[_IOC_NR(VIDIOC_S_CROP)] = {
+ .name = "VIDIOC_S_CROP",
+ .desc = desc_v4l2_crop,
+},
+[_IOC_NR(VIDIOC_G_JPEGCOMP)] = {
+ .name = "VIDIOC_G_JPEGCOMP",
+ .desc = desc_v4l2_jpegcompression,
+},
+[_IOC_NR(VIDIOC_S_JPEGCOMP)] = {
+ .name = "VIDIOC_S_JPEGCOMP",
+ .desc = desc_v4l2_jpegcompression,
+},
+[_IOC_NR(VIDIOC_QUERYSTD)] = {
+ .name = "VIDIOC_QUERYSTD",
+ .desc = v4l2_std_id,
+},
+[_IOC_NR(VIDIOC_TRY_FMT)] = {
+ .name = "VIDIOC_TRY_FMT",
+ .desc = desc_v4l2_format,
+},
diff --git a/x11/MoTV-de b/x11/MoTV-de
index 90a6628..3a4adaa 100644
--- a/x11/MoTV-de
+++ b/x11/MoTV-de
@@ -208,6 +208,7 @@ control*box.XmPushButton*menu.edit.labelString: Ändern ...
*prop_popup.title: Einstellungen
*prop_popup*rc.nameL.labelString: Sendername
*prop_popup*rc.keyL.labelString: Hotkey
+*prop_popup*rc.groupL.labelString: Gruppe
*prop_popup*rc.channelL.labelString: Kanal
*prop_popup*rc.buttons.ok.labelString: OK
*prop_popup*rc.buttons.cancel.labelString: Abbrechen
diff --git a/x11/MoTV-default b/x11/MoTV-default
index 4a618b4..fa0ab0f 100644
--- a/x11/MoTV-default
+++ b/x11/MoTV-default
@@ -214,6 +214,7 @@ control*box.XmPushButton*menu.edit.labelString: Edit ...
*prop_popup.title: Edit Station
*prop_popup*rc.nameL.labelString: Station name
*prop_popup*rc.keyL.labelString: Hotkey
+*prop_popup*rc.groupL.labelString: Group
*prop_popup*rc.channelL.labelString: Channel
*prop_popup*rc.buttons.ok.labelString: OK
*prop_popup*rc.buttons.cancel.labelString: Cancel
diff --git a/x11/MoTV-fixed b/x11/MoTV-fixed
index d098286..e60c5b3 100644
--- a/x11/MoTV-fixed
+++ b/x11/MoTV-fixed
@@ -166,6 +166,7 @@ control.form.status.f.?.labelString:
*prop_popup*rc.channel.comboBoxType: DROP_DOWN_LIST
*prop_popup*rc.channel.positionMode: ONE_BASED
*prop_popup*rc.keyL.marginTop: 10
+*prop_popup*rc.groupL.marginTop: 10
*prop_popup*rc.channelL.marginTop: 10
*prop_popup*rc.XmLabel.alignment: ALIGNMENT_BEGINNING
diff --git a/x11/MoTV-fr b/x11/MoTV-fr
index d7d35a5..86903cf 100644
--- a/x11/MoTV-fr
+++ b/x11/MoTV-fr
@@ -216,6 +216,7 @@ control*box.XmPushButton*menu.edit.labelString: Editer ...
*prop_popup.title: Editer émetteur
*prop_popup*rc.nameL.labelString: Nom de l'émetteur
*prop_popup*rc.keyL.labelString: Raccourci clavier
+*prop_popup*rc.groupL.labelString: [en] Group
*prop_popup*rc.channelL.labelString: Emetteur
*prop_popup*rc.buttons.ok.labelString: OK
*prop_popup*rc.buttons.cancel.labelString: Annuler
diff --git a/x11/MoTV-it b/x11/MoTV-it
index 0b67b9e..fbaed71 100644
--- a/x11/MoTV-it
+++ b/x11/MoTV-it
@@ -215,6 +215,7 @@ control*box.XmPushButton*menu.edit.labelString: Modifica ...
*prop_popup.title: Modifica stazione
*prop_popup*rc.nameL.labelString: Nome stazione
*prop_popup*rc.keyL.labelString: Acceleratore
+*prop_popup*rc.groupL.labelString: [en] Group
*prop_popup*rc.channelL.labelString: Canale
*prop_popup*rc.buttons.ok.labelString: OK
*prop_popup*rc.buttons.cancel.labelString: Annulla
diff --git a/x11/motv.c b/x11/motv.c
index 34522f0..883d3d0 100644
--- a/x11/motv.c
+++ b/x11/motv.c
@@ -1,5 +1,5 @@
/*
- * OpenMotif user interface
+ * Openmotif user interface
*
* (c) 2000-2002 Gerd Knorr <kraxel@bytesex.org>
*
@@ -141,6 +141,7 @@ static struct vbi_window *vtx;
/* properties */
static Widget prop_dlg,prop_name,prop_key,prop_channel,prop_button;
+static Widget prop_group;
/* preferences */
static Widget pref_dlg,pref_fs_toggle,pref_fs_menu,pref_fs_option;
@@ -694,6 +695,7 @@ chan_add_cb(Widget widget, XtPointer clientdata, XtPointer call_data)
prop_button = NULL;
XmTextSetString(prop_name,"");
XmTextSetString(prop_key,"");
+ XmTextSetString(prop_group,"main");
i = (-1 == cur_channel) ? 0 : cur_channel;
str = XmStringGenerate(chanlist[i].name, NULL, XmMULTIBYTE_TEXT, NULL);
XtVaSetValues(prop_channel,XmNselectedItem,str,NULL);
@@ -719,6 +721,7 @@ chan_edit_cb(Widget widget, XtPointer clientdata, XtPointer call_data)
/* init stuff */
XmTextSetString(prop_name,channels[i]->name);
XmTextSetString(prop_key,channels[i]->key);
+ XmTextSetString(prop_group,channels[i]->group);
i = (-1 == channels[i]->channel) ? 0 : channels[i]->channel;
str = XmStringGenerate(chanlist[i].name, NULL, XmMULTIBYTE_TEXT, NULL);
XtVaSetValues(prop_channel,XmNselectedItem,str,NULL);
@@ -730,7 +733,7 @@ chan_edit_cb(Widget widget, XtPointer clientdata, XtPointer call_data)
static void
chan_apply_cb(Widget widget, XtPointer clientdata, XtPointer call_data)
{
- char *name, *key, *cname;
+ char *name, *key, *cname, *group;
struct CHANNEL *c;
XmString str;
int i,channel;
@@ -745,6 +748,10 @@ chan_apply_cb(Widget widget, XtPointer clientdata, XtPointer call_data)
name = XmTextGetString(prop_name);
key = XmTextGetString(prop_key);
+ group = XmTextGetString(prop_group);
+ if (0 == strlen(group))
+ group = "main";
+
XtVaGetValues(prop_channel,XmNselectedItem,&str,NULL);
cname = XmStringUnparse(str,NULL,XmMULTIBYTE_TEXT,XmMULTIBYTE_TEXT,
NULL,0,0);
@@ -765,6 +772,7 @@ chan_apply_cb(Widget widget, XtPointer clientdata, XtPointer call_data)
if (strlen(key) > 0)
c->key = strdup(key);
c->cname = strdup(cname);
+ c->group = strdup(group);
c->channel = channel;
} else {
/* update */
@@ -778,6 +786,7 @@ chan_apply_cb(Widget widget, XtPointer clientdata, XtPointer call_data)
if (0 != strlen(key))
c->key = strdup(key);
c->cname = strdup(cname);
+ c->group = strdup(group);
c->channel = channel;
XtRemoveAllCallbacks(c->button, XmNactivateCallback);
add_cmd_callback(c->button, XmNactivateCallback,
@@ -833,6 +842,11 @@ create_prop(void)
NULL);
XtAddEventHandler(prop_key, KeyPressMask, False, chan_key_eh, NULL);
+ label = XtVaCreateManagedWidget("groupL", xmLabelWidgetClass, rowcol,
+ NULL);
+ prop_group = XtVaCreateManagedWidget("group", xmTextWidgetClass, rowcol,
+ NULL);
+
label = XtVaCreateManagedWidget("channelL", xmLabelWidgetClass, rowcol,
NULL);
prop_channel = XtVaCreateManagedWidget("channel",xmComboBoxWidgetClass,
@@ -1092,8 +1106,16 @@ menu_cols_cb(Widget widget, XtPointer clientdata, XtPointer call_data)
void
channel_menu(void)
{
+ struct {
+ char *name;
+ Widget menu1;
+ Widget menu2;
+ } *sub = NULL;
+ int subs = 0;
+
+ Widget menu1,menu2;
char ctrl[16],key[32],accel[64];
- int i;
+ int i,j;
if (0 == st_menu2) {
st_menu2 = XmCreatePopupMenu(tv,"stationsM",NULL,0);
@@ -1118,15 +1140,46 @@ channel_menu(void)
} else {
accel[0] = 0;
}
- add_cmd_menuitem("station", i, st_menu1,
+
+ menu1 = st_menu1;
+ menu2 = st_menu2;
+ if (0 != strcmp(channels[i]->group,"main")) {
+ for (j = 0; j < subs; j++)
+ if (0 == strcmp(channels[i]->group,sub[j].name))
+ break;
+ if (j == subs) {
+ subs++;
+ sub = realloc(sub, subs * sizeof(*sub));
+ sub[j].name = channels[i]->group;
+ sub[j].menu1 = XmCreatePulldownMenu(st_menu1,
+ channels[i]->group,
+ NULL,0);
+ sub[j].menu2 = XmCreatePulldownMenu(st_menu2,
+ channels[i]->group,
+ NULL,0);
+ XtVaCreateManagedWidget(channels[i]->group,
+ xmCascadeButtonWidgetClass, st_menu1,
+ XmNsubMenuId, sub[j].menu1,
+ NULL);
+ XtVaCreateManagedWidget(channels[i]->group,
+ xmCascadeButtonWidgetClass, st_menu2,
+ XmNsubMenuId, sub[j].menu2,
+ NULL);
+ }
+ menu1 = sub[j].menu1;
+ menu2 = sub[j].menu2;
+ }
+
+ add_cmd_menuitem("station", i, menu1,
channels[i]->name, channels[i]->key, accel, FALSE,
"setstation",channels[i]->name,NULL);
- add_cmd_menuitem("station", i, st_menu2,
+ add_cmd_menuitem("station", i, menu2,
channels[i]->name, channels[i]->key, accel, FALSE,
"setstation",channels[i]->name,NULL);
if (NULL == channels[i]->button)
chan_makebutton(channels[i]);
}
+ free(sub);
calc_frequencies();
}
@@ -3262,14 +3315,12 @@ main(int argc, char *argv[])
create_onscreen(xmLabelWidgetClass);
create_vtx();
create_strwin();
- create_control();
- create_prop();
- create_pref();
- create_levels();
- create_filter_prop();
stderr_init();
/* read config file + related settings */
+ if (debug)
+ fprintf(stderr,"main: init frequency tables ...\n");
+ freq_init();
if (args.readconfig) {
if (debug)
fprintf(stderr,"main: read config file ...\n");
@@ -3282,6 +3333,13 @@ main(int argc, char *argv[])
if (NULL != (attr = ng_mix_init(mixerdev,mixerctl)))
add_attrs(attr);
}
+
+ create_control();
+ create_prop();
+ create_pref();
+ create_levels();
+ create_filter_prop();
+
init_movie_menus();
create_scale();
create_attr_widgets();
@@ -3347,7 +3405,8 @@ main(int argc, char *argv[])
channel_menu();
xt_handle_pending(dpy);
- 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");
set_property(0,NULL,NULL);
diff --git a/x11/rootv.c b/x11/rootv.c
index 6311067..b440883 100644
--- a/x11/rootv.c
+++ b/x11/rootv.c
@@ -86,7 +86,8 @@ static void station_list(FILE *fp)
char filename[100];
char **list;
- sprintf(filename,"%s/%s",getenv("HOME"),".xawtv");
+ sprintf(filename,"%.*s/%s",(int)sizeof(filename)-8,
+ getenv("HOME"),".xawtv");
cfg_parse_file(CONFIGFILE);
cfg_parse_file(filename);
diff --git a/x11/v4lctl.c b/x11/v4lctl.c
index 8100363..4a7bece 100644
--- a/x11/v4lctl.c
+++ b/x11/v4lctl.c
@@ -98,6 +98,7 @@ int main(int argc, char *argv[])
#endif
if (NULL == drv)
grabber_init();
+ freq_init();
read_config(NULL,NULL,NULL);
attr_init();
diff --git a/x11/videodev2-new.h b/x11/videodev2-new.h
deleted file mode 100644
index 1806b7d..0000000
--- a/x11/videodev2-new.h
+++ /dev/null
@@ -1,862 +0,0 @@
-#ifndef __LINUX_VIDEODEV2_H
-#define __LINUX_VIDEODEV2_H
-/*
- * Video for Linux Two
- *
- * Header file for v4l or V4L2 drivers and applications, for
- * Linux kernels 2.2.x or 2.4.x.
- *
- * See http://www.thedirks.org/v4l2/ for API specs and other
- * v4l2 documentation.
- *
- * Author: Bill Dirks <bdirks@pacbell.net>
- * Justin Schoeman
- * et al.
- */
-
-/*
- * M I S C E L L A N E O U S
- */
-
-/* Four-character-code (FOURCC) */
-#define v4l2_fourcc(a,b,c,d)\
- (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
-
-/*
- * E N U M S
- */
-enum v4l2_field {
- V4L2_FIELD_ANY = 0, /* driver can choose from none,
- top, bottom, interlaced
- depending on whatever it thinks
- is approximate ... */
- V4L2_FIELD_NONE = 1, /* this device has no fields ... */
- V4L2_FIELD_TOP = 2, /* top field only */
- V4L2_FIELD_BOTTOM = 3, /* bottom field only */
- V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */
- V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one
- buffer, top-bottom order */
- V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */
- V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into
- separate buffers */
-};
-#define V4L2_FIELD_HAS_TOP(field) \
- ((field) == V4L2_FIELD_TOP ||\
- (field) == V4L2_FIELD_INTERLACED ||\
- (field) == V4L2_FIELD_SEQ_TB ||\
- (field) == V4L2_FIELD_SEQ_BT)
-#define V4L2_FIELD_HAS_BOTTOM(field) \
- ((field) == V4L2_FIELD_BOTTOM ||\
- (field) == V4L2_FIELD_INTERLACED ||\
- (field) == V4L2_FIELD_SEQ_TB ||\
- (field) == V4L2_FIELD_SEQ_BT)
-#define V4L2_FIELD_HAS_BOTH(field) \
- ((field) == V4L2_FIELD_INTERLACED ||\
- (field) == V4L2_FIELD_SEQ_TB ||\
- (field) == V4L2_FIELD_SEQ_BT)
-
-enum v4l2_buf_type {
- V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
- V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
- V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
- V4L2_BUF_TYPE_VBI_CAPTURE = 4,
- V4L2_BUF_TYPE_VBI_OUTPUT = 5,
- V4L2_BUF_TYPE_PRIVATE = 0x80,
-};
-
-enum v4l2_ctrl_type {
- V4L2_CTRL_TYPE_INTEGER = 1,
- V4L2_CTRL_TYPE_BOOLEAN = 2,
- V4L2_CTRL_TYPE_MENU = 3,
- V4L2_CTRL_TYPE_BUTTON = 4,
-};
-
-enum v4l2_tuner_type {
- V4L2_TUNER_RADIO = 1,
- V4L2_TUNER_ANALOG_TV = 2,
-};
-
-enum v4l2_memory {
- V4L2_MEMORY_MMAP = 1,
- V4L2_MEMORY_USERPTR = 2,
- V4L2_MEMORY_OVERLAY = 3,
-};
-
-/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
-enum v4l2_colorspace {
- /* ITU-R 601 -- broadcast NTSC/PAL */
- V4L2_COLORSPACE_SMPTE170M = 1,
-
- /* 1125-Line (US) HDTV */
- V4L2_COLORSPACE_SMPTE240M = 2,
-
- /* HD and modern captures. */
- V4L2_COLORSPACE_REC709 = 3,
-
- /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
- V4L2_COLORSPACE_BT878 = 4,
-
- /* These should be useful. Assume 601 extents. */
- V4L2_COLORSPACE_470_SYSTEM_M = 5,
- V4L2_COLORSPACE_470_SYSTEM_BG = 6,
-
- /* I know there will be cameras that send this. So, this is
- * unspecified chromaticities and full 0-255 on each of the
- * Y'CbCr components
- */
- V4L2_COLORSPACE_JPEG = 7,
-
- /* For RGB colourspaces, this is probably a good start. */
- V4L2_COLORSPACE_SRGB = 8,
-};
-
-struct v4l2_rect {
- __s32 left;
- __s32 top;
- __u32 width;
- __u32 height;
-};
-
-struct v4l2_fract {
- __u32 numerator;
- __u32 denominator;
-};
-
-/*
- * D R I V E R C A P A B I L I T I E S
- */
-struct v4l2_capability
-{
- __u8 name[32]; /* Descriptive, and unique */
- __u32 version; /* use KERNEL_VERSION() macro here */
- __u32 capabilities; /* Device capabilities */
- __u32 flags; /* Feature flags, see below */
- __u32 reserved[4];
-};
-
-/* Values for 'capabilities' field */
-#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */
-#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */
-#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */
-#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a VBI capture device */
-#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a VBI output device */
-#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
-
-#define V4L2_CAP_TUNER 0x00010000 /* Has a tuner */
-#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
-
-#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
-#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
-#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
-
-/*
- * V I D E O I M A G E F O R M A T
- */
-
-struct v4l2_pix_format
-{
- __u32 width;
- __u32 height;
- __u32 pixelformat;
- enum v4l2_field field;
- __u32 bytesperline; /* for padding, zero if unused */
- __u32 sizeimage;
- enum v4l2_colorspace colorspace;
- __u32 priv; /* private data, depends on pixelformat */
-};
-
-/* Pixel format FOURCC depth Description */
-#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */
-#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */
-#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */
-#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R','G','B','Q') /* 16 RGB-5-5-5 BE */
-#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R','G','B','R') /* 16 RGB-5-6-5 BE */
-#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B','G','R','3') /* 24 BGR-8-8-8 */
-#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R','G','B','3') /* 24 RGB-8-8-8 */
-#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B','G','R','4') /* 32 BGR-8-8-8-8 */
-#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R','G','B','4') /* 32 RGB-8-8-8-8 */
-#define V4L2_PIX_FMT_GREY v4l2_fourcc('G','R','E','Y') /* 8 Greyscale */
-#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y','V','U','9') /* 9 YVU 4:1:0 */
-#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y','V','1','2') /* 12 YVU 4:2:0 */
-#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y','U','Y','V') /* 16 YUV 4:2:2 */
-#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U','Y','V','Y') /* 16 YUV 4:2:2 */
-#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */
-#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */
-#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */
-
-/* two planes -- one Y, one Cr + Cb interleaved */
-#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N','V','1','2') /* 12 Y/CbCr 4:2:0 */
-#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N','V','2','1') /* 12 Y/CrCb 4:2:0 */
-
-/* The following formats are not defined in the V4L2 specification */
-#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y','U','V','9') /* 9 YUV 4:1:0 */
-#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */
-#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */
-#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */
-
-/* compressed formats */
-#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */
-#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */
-#define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* digital video */
-
-/* Vendor-specific formats */
-#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compres */
-
-/*
- * F O R M A T E N U M E R A T I O N
- */
-struct v4l2_fmtdesc
-{
- __u32 index; /* Format number */
- enum v4l2_buf_type type; /* buffer type */
- __u32 flags;
- __u8 description[32]; /* Description string */
- __u32 pixelformat; /* Format fourcc */
- __u32 reserved[4];
-};
-
-#define V4L2_FMT_FLAG_COMPRESSED 0x0001
-
-
-/*
- * T I M E C O D E
- */
-struct v4l2_timecode
-{
- __u32 type;
- __u32 flags;
- __u8 frames;
- __u8 seconds;
- __u8 minutes;
- __u8 hours;
- __u8 userbits[4];
-};
-
-/* Type */
-#define V4L2_TC_TYPE_24FPS 1
-#define V4L2_TC_TYPE_25FPS 2
-#define V4L2_TC_TYPE_30FPS 3
-#define V4L2_TC_TYPE_50FPS 4
-#define V4L2_TC_TYPE_60FPS 5
-
-/* Flags */
-#define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */
-#define V4L2_TC_FLAG_COLORFRAME 0x0002
-#define V4L2_TC_USERBITS_field 0x000C
-#define V4L2_TC_USERBITS_USERDEFINED 0x0000
-#define V4L2_TC_USERBITS_8BITCHARS 0x0008
-/* The above is based on SMPTE timecodes */
-
-
-/*
- * C O M P R E S S I O N P A R A M E T E R S
- */
-#if 0
-/* ### generic compression settings don't work, there is too much
- * ### codec-specific stuff. Maybe reuse that for MPEG codec settings
- * ### later ... */
-struct v4l2_compression
-{
- __u32 quality;
- __u32 keyframerate;
- __u32 pframerate;
- __u32 reserved[5];
-};
-#endif
-
-struct v4l2_jpegcompression
-{
- int quality;
-
- int APPn; /* Number of APP segment to be written,
- * must be 0..15 */
- int APP_len; /* Length of data in JPEG APPn segment */
- char APP_data[60]; /* Data in the JPEG APPn segment. */
-
- int COM_len; /* Length of data in JPEG COM segment */
- char COM_data[60]; /* Data in JPEG COM segment */
-
- __u32 jpeg_markers; /* Which markers should go into the JPEG
- * output. Unless you exactly know what
- * you do, leave them untouched.
- * Inluding less markers will make the
- * resulting code smaller, but there will
- * be fewer aplications which can read it.
- * The presence of the APP and COM marker
- * is influenced by APP_len and COM_len
- * ONLY, not by this property! */
-
-#define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */
-#define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */
-#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
-#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
-#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
- * allways use APP0 */
-};
-
-
-/*
- * M E M O R Y - M A P P I N G B U F F E R S
- */
-struct v4l2_requestbuffers
-{
- __u32 count;
- enum v4l2_buf_type type;
- enum v4l2_memory memory;
- __u32 reserved[2];
-};
-
-struct v4l2_buffer
-{
- __u32 index;
- enum v4l2_buf_type type;
- __u32 bytesused;
- __u32 flags;
- enum v4l2_field field;
- struct timeval timestamp;
- struct v4l2_timecode timecode;
- __u32 sequence;
-
- /* memory location */
- enum v4l2_memory memory;
- union {
- __u32 offset;
- unsigned long userptr;
- } m;
- __u32 length;
-
- __u32 reserved[2];
-};
-
-/* Flags for 'flags' field */
-#define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */
-#define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */
-#define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */
-#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
-#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
-#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
-#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
-
-/*
- * O V E R L A Y P R E V I E W
- */
-struct v4l2_framebuffer
-{
- __u32 capability;
- __u32 flags;
-/* FIXME: in theory we should pass something like PCI device + memory
- * region + offset instead of some physical address */
- void* base;
- struct v4l2_pix_format fmt;
-};
-/* Flags for the 'capability' field. Read only */
-#define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
-#define V4L2_FBUF_CAP_CHROMAKEY 0x0002
-#define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004
-#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
-/* Flags for the 'flags' field. */
-#define V4L2_FBUF_FLAG_PRIMARY 0x0001
-#define V4L2_FBUF_FLAG_OVERLAY 0x0002
-#define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
-
-struct v4l2_clip
-{
- struct v4l2_rect c;
- struct v4l2_clip *next;
-};
-
-struct v4l2_window
-{
- struct v4l2_rect w;
- enum v4l2_field field;
- __u32 chromakey;
- struct v4l2_clip *clips;
- __u32 clipcount;
- void *bitmap;
-};
-
-
-/*
- * C A P T U R E P A R A M E T E R S
- */
-struct v4l2_captureparm
-{
- __u32 capability; /* Supported modes */
- __u32 capturemode; /* Current mode */
- struct v4l2_fract timeperframe; /* Time per frame in .1us units */
- __u32 extendedmode; /* Driver-specific extensions */
- __u32 readbuffers; /* # of buffers for read */
- __u32 reserved[4];
-};
-/* Flags for 'capability' and 'capturemode' fields */
-#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
-#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */
-
-struct v4l2_outputparm
-{
- __u32 capability; /* Supported modes */
- __u32 outputmode; /* Current mode */
- struct v4l2_fract timeperframe; /* Time per frame in seconds */
- __u32 extendedmode; /* Driver-specific extensions */
- __u32 writebuffers; /* # of buffers for write */
- __u32 reserved[4];
-};
-
-/*
- * I N P U T I M A G E C R O P P I N G
- */
-
-struct v4l2_cropcap {
- enum v4l2_buf_type type;
- struct v4l2_rect bounds;
- struct v4l2_rect defrect;
- struct v4l2_fract pixelaspect;
-};
-
-struct v4l2_crop {
- enum v4l2_buf_type type;
- struct v4l2_rect c;
-};
-
-/*
- * A N A L O G V I D E O S T A N D A R D
- */
-
-typedef __u64 v4l2_std_id;
-
-/* one bit for each */
-#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
-#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
-#define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
-#define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
-#define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
-#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
-#define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
-#define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
-
-#define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
-#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
-#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
-#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
-
-#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
-#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
-
-#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
-#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
-#define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
-#define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
-#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
-#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
-#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
-
-/* ATSC/HDTV */
-#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
-#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
-
-/* some common needed stuff */
-#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
- V4L2_STD_PAL_B1 |\
- V4L2_STD_PAL_G)
-#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
- V4L2_STD_PAL_D1 |\
- V4L2_STD_PAL_K)
-#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
- V4L2_STD_PAL_DK |\
- V4L2_STD_PAL_H |\
- V4L2_STD_PAL_I)
-#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
- V4L2_STD_NTSC_M_JP)
-#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
- V4L2_STD_SECAM_D |\
- V4L2_STD_SECAM_G |\
- V4L2_STD_SECAM_H |\
- V4L2_STD_SECAM_K |\
- V4L2_STD_SECAM_K1 |\
- V4L2_STD_SECAM_L)
-
-#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
- V4L2_STD_PAL_60 |\
- V4L2_STD_NTSC)
-#define V4L2_STD_625_50 (V4L2_STD_PAL |\
- V4L2_STD_PAL_N |\
- V4L2_STD_PAL_Nc |\
- V4L2_STD_SECAM)
-
-#define V4L2_STD_UNKNOWN 0
-#define V4L2_STD_ALL (V4L2_STD_525_60 |\
- V4L2_STD_625_50)
-
-struct v4l2_standard
-{
- __u32 index;
- v4l2_std_id id;
- __u8 name[24];
- struct v4l2_fract frameperiod; /* Frames, not fields */
- __u32 framelines;
- __u32 reserved[4];
-};
-
-
-/*
- * V I D E O I N P U T S
- */
-struct v4l2_input
-{
- __u32 index; /* Which input */
- __u8 name[32]; /* Label */
- __u32 type; /* Type of input */
- __u32 audioset; /* Associated audios (bitfield) */
- __u32 tuner; /* Associated tuner */
- v4l2_std_id std;
- __u32 status;
- __u32 reserved[4];
-};
-/* Values for the 'type' field */
-#define V4L2_INPUT_TYPE_TUNER 1
-#define V4L2_INPUT_TYPE_CAMERA 2
-
-/* field 'status' - general */
-#define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */
-#define V4L2_IN_ST_NO_SIGNAL 0x00000002
-#define V4L2_IN_ST_NO_COLOR 0x00000004
-
-/* field 'status' - analog */
-#define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */
-#define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */
-
-/* field 'status' - digital */
-#define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */
-#define V4L2_IN_ST_NO_EQU 0x00020000 /* No equalizer lock */
-#define V4L2_IN_ST_NO_CARRIER 0x00040000 /* Carrier recovery failed */
-
-/* field 'status' - VCR and set-top box */
-#define V4L2_IN_ST_MACROVISION 0x01000000 /* Macrovision detected */
-#define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */
-#define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */
-
-/*
- * V I D E O O U T P U T S
- */
-struct v4l2_output
-{
- __u32 index; /* Which output */
- __u8 name[32]; /* Label */
- __u32 type; /* Type of output */
- __u32 audioset; /* Associated audios (bitfield) */
- __u32 modulator; /* Associated modulator */
- v4l2_std_id std;
- __u32 reserved[4];
-};
-/* Values for the 'type' field */
-#define V4L2_OUTPUT_TYPE_MODULATOR 1
-#define V4L2_OUTPUT_TYPE_ANALOG 2
-#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
-
-/*
- * C O N T R O L S
- */
-struct v4l2_control
-{
- __u32 id;
- __s32 value;
-};
-
-/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
-struct v4l2_queryctrl
-{
- __u32 id;
- enum v4l2_ctrl_type type;
- __u8 name[32]; /* Whatever */
- __s32 minimum; /* Note signedness */
- __s32 maximum;
- __s32 step;
- __s32 default_value;
- __u32 flags;
- __u32 reserved[2];
-};
-
-/* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
-struct v4l2_querymenu
-{
- __u32 id;
- __u32 index;
- __u8 name[32]; /* Whatever */
- __u32 reserved;
-};
-
-/* Control flags */
-#define V4L2_CTRL_FLAG_DISABLED 0x0001
-#define V4L2_CTRL_FLAG_GRABBED 0x0002
-
-/* Control IDs defined by V4L2 */
-#define V4L2_CID_BASE 0x00980900
-/* IDs reserved for driver specific controls */
-#define V4L2_CID_PRIVATE_BASE 0x08000000
-
-#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
-#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
-#define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
-#define V4L2_CID_HUE (V4L2_CID_BASE+3)
-#define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
-#define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6)
-#define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7)
-#define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
-#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
-#define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10)
-#define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11)
-#define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
-#define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
-#define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14)
-#define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15)
-#define V4L2_CID_GAMMA (V4L2_CID_BASE+16)
-#define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* ? Not sure */
-#define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
-#define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
-#define V4L2_CID_GAIN (V4L2_CID_BASE+19)
-#define V4L2_CID_HFLIP (V4L2_CID_BASE+20)
-#define V4L2_CID_VFLIP (V4L2_CID_BASE+21)
-#define V4L2_CID_HCENTER (V4L2_CID_BASE+22)
-#define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
-#define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */
-
-/*
- * T U N I N G
- */
-struct v4l2_tuner
-{
- __u32 index;
- __u8 name[32];
- enum v4l2_tuner_type type;
- __u32 capability;
- __u32 rangelow;
- __u32 rangehigh;
- __u32 rxsubchans;
- __u32 audmode;
- __u32 signal;
- __u32 afc;
- __u32 reserved[4];
-};
-
-struct v4l2_modulator
-{
- __u32 index;
- __u8 name[32];
- __u32 capability;
- __u32 rangelow;
- __u32 rangehigh;
- __u32 txsubchans;
- __u32 reserved[4];
-};
-
-/* Flags for the 'capability' field */
-#define V4L2_TUNER_CAP_LOW 0x0001
-#define V4L2_TUNER_CAP_NORM 0x0002
-#define V4L2_TUNER_CAP_STEREO 0x0010
-#define V4L2_TUNER_CAP_LANG2 0x0020
-#define V4L2_TUNER_CAP_SAP 0x0020
-#define V4L2_TUNER_CAP_LANG1 0x0040
-
-/* Flags for the 'rxsubchans' field */
-#define V4L2_TUNER_SUB_MONO 0x0001
-#define V4L2_TUNER_SUB_STEREO 0x0002
-#define V4L2_TUNER_SUB_LANG2 0x0004
-#define V4L2_TUNER_SUB_SAP 0x0004
-#define V4L2_TUNER_SUB_LANG1 0x0008
-
-/* Values for the 'audmode' field */
-#define V4L2_TUNER_MODE_MONO 0x0000
-#define V4L2_TUNER_MODE_STEREO 0x0001
-#define V4L2_TUNER_MODE_LANG2 0x0002
-#define V4L2_TUNER_MODE_SAP 0x0002
-#define V4L2_TUNER_MODE_LANG1 0x0003
-
-struct v4l2_frequency
-{
- __u32 tuner;
- enum v4l2_tuner_type type;
- __u32 frequency;
- __u32 reserved[8];
-};
-
-/*
- * A U D I O
- */
-struct v4l2_audio
-{
- __u32 index;
- __u8 name[32];
- __u32 capability;
- __u32 mode;
- __u32 reserved[2];
-};
-/* Flags for the 'capability' field */
-#define V4L2_AUDCAP_EFFECTS 0x0020
-#define V4L2_AUDCAP_LOUDNESS 0x0040
-#define V4L2_AUDCAP_AVL 0x0080
-
-/* Flags for the 'mode' field */
-#define V4L2_AUDMODE_LOUDNESS 0x00002
-#define V4L2_AUDMODE_AVL 0x00004
-#define V4L2_AUDMODE_STEREO_field 0x0FF00
-#define V4L2_AUDMODE_STEREO_LINEAR 0x00100
-#define V4L2_AUDMODE_STEREO_PSEUDO 0x00200
-#define V4L2_AUDMODE_STEREO_SPATIAL30 0x00300
-#define V4L2_AUDMODE_STEREO_SPATIAL50 0x00400
-
-struct v4l2_audioout
-{
- __u32 index;
- __u8 name[32];
- __u32 capability;
- __u32 mode;
- __u32 reserved[2];
-};
-
-/*
- * D A T A S E R V I C E S ( V B I )
- *
- * Data services API by Michael Schimek
- */
-
-struct v4l2_vbi_format
-{
- __u32 sampling_rate; /* in 1 Hz */
- __u32 offset;
- __u32 samples_per_line;
- __u32 sample_format; /* V4L2_PIX_FMT_* */
- __s32 start[2];
- __u32 count[2];
- __u32 flags; /* V4L2_VBI_* */
- __u32 reserved[2]; /* must be zero */
-};
-
-/* VBI flags */
-#define V4L2_VBI_UNSYNC (1<< 0)
-#define V4L2_VBI_INTERLACED (1<< 1)
-
-
-/*
- * A G G R E G A T E S T R U C T U R E S
- */
-
-/* Stream data format
- */
-struct v4l2_format
-{
- enum v4l2_buf_type type;
- union
- {
- struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE
- struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY
- struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE
- __u8 raw_data[200]; // user-defined
- } fmt;
-};
-
-
-/* Stream type-dependent parameters
- */
-struct v4l2_streamparm
-{
- enum v4l2_buf_type type;
- union
- {
- struct v4l2_captureparm capture;
- struct v4l2_outputparm output;
- __u8 raw_data[200]; /* user-defined */
- } parm;
-};
-
-
-
-/*
- * I O C T L C O D E S F O R V I D E O D E V I C E S
- *
- */
-#define VIDIOC_QUERYCAP _IOR ('V', 0, struct v4l2_capability)
-#define VIDIOC_RESERVED _IO ('V', 1)
-#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc)
-#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format)
-#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format)
-#if 0
-#define VIDIOC_G_COMP _IOR ('V', 6, struct v4l2_compression)
-#define VIDIOC_S_COMP _IOW ('V', 7, struct v4l2_compression)
-#endif
-#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers)
-#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer)
-#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer)
-#define VIDIOC_S_FBUF _IOW ('V', 11, struct v4l2_framebuffer)
-#define VIDIOC_OVERLAY _IOWR ('V', 14, int)
-#define VIDIOC_QBUF _IOWR ('V', 15, struct v4l2_buffer)
-#define VIDIOC_DQBUF _IOWR ('V', 17, struct v4l2_buffer)
-#define VIDIOC_STREAMON _IOW ('V', 18, int)
-#define VIDIOC_STREAMOFF _IOW ('V', 19, int)
-#define VIDIOC_G_PARM _IOWR ('V', 21, struct v4l2_streamparm)
-#define VIDIOC_S_PARM _IOW ('V', 22, struct v4l2_streamparm)
-#define VIDIOC_G_STD _IOR ('V', 23, v4l2_std_id)
-#define VIDIOC_S_STD _IOW ('V', 24, v4l2_std_id)
-#define VIDIOC_ENUMSTD _IOWR ('V', 25, struct v4l2_standard)
-#define VIDIOC_ENUMINPUT _IOWR ('V', 26, struct v4l2_input)
-#define VIDIOC_G_CTRL _IOWR ('V', 27, struct v4l2_control)
-#define VIDIOC_S_CTRL _IOW ('V', 28, struct v4l2_control)
-#define VIDIOC_G_TUNER _IOWR ('V', 29, struct v4l2_tuner)
-#define VIDIOC_S_TUNER _IOW ('V', 30, struct v4l2_tuner)
-#define VIDIOC_G_AUDIO _IOWR ('V', 33, struct v4l2_audio)
-#define VIDIOC_S_AUDIO _IOW ('V', 34, struct v4l2_audio)
-#define VIDIOC_QUERYCTRL _IOWR ('V', 36, struct v4l2_queryctrl)
-#define VIDIOC_QUERYMENU _IOWR ('V', 37, struct v4l2_querymenu)
-#define VIDIOC_G_INPUT _IOR ('V', 38, int)
-#define VIDIOC_S_INPUT _IOWR ('V', 39, int)
-#define VIDIOC_G_OUTPUT _IOR ('V', 46, int)
-#define VIDIOC_S_OUTPUT _IOWR ('V', 47, int)
-#define VIDIOC_ENUMOUTPUT _IOWR ('V', 48, struct v4l2_output)
-#define VIDIOC_G_AUDOUT _IOWR ('V', 49, struct v4l2_audioout)
-#define VIDIOC_S_AUDOUT _IOW ('V', 50, struct v4l2_audioout)
-#define VIDIOC_G_MODULATOR _IOWR ('V', 54, struct v4l2_modulator)
-#define VIDIOC_S_MODULATOR _IOW ('V', 55, struct v4l2_modulator)
-#define VIDIOC_G_FREQUENCY _IOWR ('V', 56, struct v4l2_frequency)
-#define VIDIOC_S_FREQUENCY _IOW ('V', 57, struct v4l2_frequency)
-#define VIDIOC_CROPCAP _IOR ('V', 58, struct v4l2_cropcap)
-#define VIDIOC_G_CROP _IOWR ('V', 59, struct v4l2_crop)
-#define VIDIOC_S_CROP _IOW ('V', 60, struct v4l2_crop)
-#define VIDIOC_G_JPEGCOMP _IOR ('V', 61, struct v4l2_jpegcompression)
-#define VIDIOC_S_JPEGCOMP _IOW ('V', 62, struct v4l2_jpegcompression)
-#define VIDIOC_QUERYSTD _IOR ('V', 63, v4l2_std_id)
-#define VIDIOC_TRY_FMT _IOWR ('V', 63, struct v4l2_format)
-
-#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
-
-
-#ifdef __KERNEL__
-/*
- *
- * V 4 L 2 D R I V E R H E L P E R A P I
- *
- * Some commonly needed functions for drivers (v4l2-common.o module)
- */
-#include <linux/fs.h>
-
-/* Video standard functions */
-extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);
-extern int v4l2_video_std_construct(struct v4l2_standard *vs,
- int id, char *name);
-
-/* Compatibility layer interface */
-typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg);
-int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
- int cmd, void *arg, v4l2_kioctl driver_ioctl);
-
-/* names for fancy debug output */
-extern char *v4l2_field_names[];
-extern char *v4l2_type_names[];
-
-#endif /* __KERNEL__ */
-#endif /* __LINUX_VIDEODEV2_H */
-
-/*
- * Local variables:
- * c-basic-offset: 8
- * End:
- */
diff --git a/x11/xawtv.c b/x11/xawtv.c
index f4cf72b..d840ca5 100644
--- a/x11/xawtv.c
+++ b/x11/xawtv.c
@@ -1675,6 +1675,9 @@ main(int argc, char *argv[])
create_launchwin();
/* read config file + related settings */
+ if (debug)
+ fprintf(stderr,"main: init frequency tables ...\n");
+ freq_init();
if (args.readconfig) {
if (debug)
fprintf(stderr,"main: read config file ...\n");
@@ -1753,7 +1756,8 @@ main(int argc, char *argv[])
channel_menu();
xt_handle_pending(dpy);
- 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");
set_property(0,NULL,NULL);
diff --git a/xawtv.spec b/xawtv.spec
index 815aa6e..f1cfaae 100644
--- a/xawtv.spec
+++ b/xawtv.spec
@@ -1,7 +1,7 @@
Name: xawtv
Group: Applications/Multimedia
Autoreqprov: on
-Version: 3.78
+Version: 3.79
Release: 0
License: GPL
Summary: v4l applications

Privacy Policy