comparison recpt1/recpt1.h @ 1:29f3b2bbbd67

- rename test.c to recpt1.c - divide definitions into recpt1.h
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 16 Feb 2009 15:55:46 +0900
parents
children 8ac7c59fefc9
comparison
equal deleted inserted replaced
0:67e8eca28a80 1:29f3b2bbbd67
1 #ifndef _RECPT1_H_
2 #define _RECPT1_H_
3
4 char *bsdev[2] = {
5 "/dev/pt1video1",
6 "/dev/pt1video0"
7 };
8 char *isdb_t_dev[2] = {
9 "/dev/pt1video2",
10 "/dev/pt1video3"
11 };
12
13 #define CHTYPE_SATELLITE 0 // 衛星デジタル放送
14 #define CHTYPE_GROUND 1 // 地上デジタル放送
15 #define MAX_QUEUE 8192
16
17 #define MAX_READ_SIZE (1024 * 16)
18 #define WRITE_SIZE (1024 * 1024 * 2)
19 #define TRUE 1
20 #define FALSE 0
21
22 typedef struct _BUFSZ{
23 int size ;
24 u_char buffer[MAX_READ_SIZE];
25 }BUFSZ;
26
27 typedef struct _QUEUE_T{
28 unsigned int in; // 次に入れるインデックス
29 unsigned int out; // 次に出すインデックス
30 unsigned int size; // キューのサイズ
31 unsigned int no_full; // 満タンになると 0 になる
32 unsigned int no_empty; // 空っぽになると 0 になる
33 pthread_mutex_t mutex;
34 pthread_cond_t cond_full; // データが満タンのときに待つための cond
35 pthread_cond_t cond_empty; // データが空のときに待つための cond
36 BUFSZ *buffer[1]; // バッファポインタ
37 }QUEUE_T;
38
39 int wfd; // ファイル書き込み用
40 int f_exit = FALSE ;
41
42 typedef struct _ISDB_T_FREQ_CONV_TABLE {
43 int set_freq ; // 実際にioctl()を行う値
44 int type ; // チャンネルタイプ
45 int add_freq ; // 追加する周波数(BS/CSの場合はスロット番号)
46 char *parm_freq ; // パラメータで受ける値
47 }ISDB_T_FREQ_CONV_TABLE;
48
49 // 変換テーブル(ISDB-T用)
50 #define MAX_CHANNEL_SELECT 123
51 // 実際にioctl()を行う値の部分はREADMEを参照の事。
52 // BS/CSの設定値およびスロット番号は
53 // http://www5e.biglobe.ne.jp/~kazu_f/digital-sat/index.htmlより取得。
54 //
55
56 ISDB_T_FREQ_CONV_TABLE isdb_t_conv_table[MAX_CHANNEL_SELECT] = {
57 { 0, CHTYPE_SATELLITE, 0, "151"}, // 151ch:BS朝日
58 { 0, CHTYPE_SATELLITE, 1, "161"}, // 161ch:BS-i
59 { 1, CHTYPE_SATELLITE, 1, "171"}, // 171ch:BSジャパン
60 { 4, CHTYPE_SATELLITE, 0, "211"}, // 211ch:BS11デジタル
61 { 4, CHTYPE_SATELLITE, 2, "222"}, // 222ch:TwellV
62 { 6, CHTYPE_SATELLITE, 0, "141"}, // 141ch:BS日テレ
63 { 6, CHTYPE_SATELLITE, 1, "181"}, // 181ch:BSフジ
64 { 7, CHTYPE_SATELLITE, 0, "101"}, // 101ch:NHK衛星第1放送(BS1)
65 { 7, CHTYPE_SATELLITE, 0, "102"}, // 102ch:NHK衛星第2放送(BS2)
66 { 7, CHTYPE_SATELLITE, 1, "103"}, // 103ch:NHKハイビジョン(BShi)
67 { 0, CHTYPE_GROUND, 0, "1"}, { 1, CHTYPE_GROUND, 0, "2"},
68 { 2, CHTYPE_GROUND, 0, "3"}, { 3, CHTYPE_GROUND, 0, "C13"},
69 { 4, CHTYPE_GROUND, 0, "C14"}, { 5, CHTYPE_GROUND, 0, "C15"},
70 { 6, CHTYPE_GROUND, 0, "C16"}, { 7, CHTYPE_GROUND, 0, "C17"},
71 { 8, CHTYPE_GROUND, 0, "C18"}, { 9, CHTYPE_GROUND, 0, "C19"},
72 { 10, CHTYPE_GROUND, 0, "C20"}, { 11, CHTYPE_GROUND, 0, "C21"},
73 { 12, CHTYPE_GROUND, 0, "C22"}, { 13, CHTYPE_GROUND, 0, "4"},
74 { 14, CHTYPE_GROUND, 0, "5"}, { 15, CHTYPE_GROUND, 0, "6"},
75 { 16, CHTYPE_GROUND, 0, "7"}, { 17, CHTYPE_GROUND, 0, "8"},
76 { 18, CHTYPE_GROUND, 0, "9"}, { 19, CHTYPE_GROUND, 0, "10"},
77 { 20, CHTYPE_GROUND, 0, "11"}, { 21, CHTYPE_GROUND, 0, "12"},
78 { 22, CHTYPE_GROUND, 0, "C23"}, { 23, CHTYPE_GROUND, 0, "C24"},
79 { 24, CHTYPE_GROUND, 0, "C25"}, { 25, CHTYPE_GROUND, 0, "C26"},
80 { 26, CHTYPE_GROUND, 0, "C27"}, { 27, CHTYPE_GROUND, 0, "C28"},
81 { 28, CHTYPE_GROUND, 0, "C29"}, { 29, CHTYPE_GROUND, 0, "C30"},
82 { 30, CHTYPE_GROUND, 0, "C31"}, { 31, CHTYPE_GROUND, 0, "C32"},
83 { 32, CHTYPE_GROUND, 0, "C33"}, { 33, CHTYPE_GROUND, 0, "C34"},
84 { 34, CHTYPE_GROUND, 0, "C35"}, { 35, CHTYPE_GROUND, 0, "C36"},
85 { 36, CHTYPE_GROUND, 0, "C37"}, { 37, CHTYPE_GROUND, 0, "C38"},
86 { 38, CHTYPE_GROUND, 0, "C39"}, { 39, CHTYPE_GROUND, 0, "C40"},
87 { 40, CHTYPE_GROUND, 0, "C41"}, { 41, CHTYPE_GROUND, 0, "C42"},
88 { 42, CHTYPE_GROUND, 0, "C43"}, { 43, CHTYPE_GROUND, 0, "C44"},
89 { 44, CHTYPE_GROUND, 0, "C45"}, { 45, CHTYPE_GROUND, 0, "C46"},
90 { 46, CHTYPE_GROUND, 0, "C47"}, { 47, CHTYPE_GROUND, 0, "C48"},
91 { 48, CHTYPE_GROUND, 0, "C49"}, { 49, CHTYPE_GROUND, 0, "C50"},
92 { 50, CHTYPE_GROUND, 0, "C51"}, { 51, CHTYPE_GROUND, 0, "C52"},
93 { 52, CHTYPE_GROUND, 0, "C53"}, { 53, CHTYPE_GROUND, 0, "C54"},
94 { 54, CHTYPE_GROUND, 0, "C55"}, { 55, CHTYPE_GROUND, 0, "C56"},
95 { 56, CHTYPE_GROUND, 0, "C57"}, { 57, CHTYPE_GROUND, 0, "C58"},
96 { 58, CHTYPE_GROUND, 0, "C59"}, { 59, CHTYPE_GROUND, 0, "C60"},
97 { 60, CHTYPE_GROUND, 0, "C61"}, { 61, CHTYPE_GROUND, 0, "C62"},
98 { 62, CHTYPE_GROUND, 0, "C63"}, { 63, CHTYPE_GROUND, 0, "13"},
99 { 64, CHTYPE_GROUND, 0, "14"}, { 65, CHTYPE_GROUND, 0, "15"},
100 { 66, CHTYPE_GROUND, 0, "16"}, { 67, CHTYPE_GROUND, 0, "17"},
101 { 68, CHTYPE_GROUND, 0, "18"}, { 69, CHTYPE_GROUND, 0, "19"},
102 { 70, CHTYPE_GROUND, 0, "20"}, { 71, CHTYPE_GROUND, 0, "21"},
103 { 72, CHTYPE_GROUND, 0, "22"}, { 73, CHTYPE_GROUND, 0, "23"},
104 { 74, CHTYPE_GROUND, 0, "24"}, { 75, CHTYPE_GROUND, 0, "25"},
105 { 76, CHTYPE_GROUND, 0, "26"}, { 77, CHTYPE_GROUND, 0, "27"},
106 { 78, CHTYPE_GROUND, 0, "28"}, { 79, CHTYPE_GROUND, 0, "29"},
107 { 80, CHTYPE_GROUND, 0, "30"}, { 81, CHTYPE_GROUND, 0, "31"},
108 { 82, CHTYPE_GROUND, 0, "32"}, { 83, CHTYPE_GROUND, 0, "33"},
109 { 84, CHTYPE_GROUND, 0, "34"}, { 85, CHTYPE_GROUND, 0, "35"},
110 { 86, CHTYPE_GROUND, 0, "36"}, { 87, CHTYPE_GROUND, 0, "37"},
111 { 88, CHTYPE_GROUND, 0, "38"}, { 89, CHTYPE_GROUND, 0, "39"},
112 { 90, CHTYPE_GROUND, 0, "40"}, { 91, CHTYPE_GROUND, 0, "41"},
113 { 92, CHTYPE_GROUND, 0, "42"}, { 93, CHTYPE_GROUND, 0, "43"},
114 { 94, CHTYPE_GROUND, 0, "44"}, { 95, CHTYPE_GROUND, 0, "45"},
115 { 96, CHTYPE_GROUND, 0, "46"}, { 97, CHTYPE_GROUND, 0, "47"},
116 { 98, CHTYPE_GROUND, 0, "48"}, { 99, CHTYPE_GROUND, 0, "49"},
117 { 100, CHTYPE_GROUND, 0, "50"}, { 101, CHTYPE_GROUND, 0, "51"},
118 { 102, CHTYPE_GROUND, 0, "52"}, { 103, CHTYPE_GROUND, 0, "53"},
119 { 104, CHTYPE_GROUND, 0, "54"}, { 105, CHTYPE_GROUND, 0, "55"},
120 { 106, CHTYPE_GROUND, 0, "56"}, { 107, CHTYPE_GROUND, 0, "57"},
121 { 108, CHTYPE_GROUND, 0, "58"}, { 109, CHTYPE_GROUND, 0, "59"},
122 { 110, CHTYPE_GROUND, 0, "60"}, { 111, CHTYPE_GROUND, 0, "61"},
123 { 112, CHTYPE_GROUND, 0, "62"}
124 };
125
126 #endif