Browse Source

Add --output-{nit,eit,tdt}-pass to enable pass through in output filtering mode.

Georgi Chorbadzhiyski 12 years ago
parent
commit
6e51e597e3
6 changed files with 56 additions and 7 deletions
  1. 4
    1
      ChangeLog
  2. 5
    2
      README
  3. 3
    0
      data.h
  4. 6
    0
      tables.c
  5. 9
    0
      tsdecrypt.1
  6. 29
    4
      tsdecrypt.c

+ 4
- 1
ChangeLog View File

@@ -3,10 +3,13 @@ xxxx-xx-xx : Version next
3 3
  * Remove --camd-pkt-delay (-y) option. This workaround is no longer needed.
4 4
  * Fix payload offset detection, a bug which broke packets that have
5 5
    adaptation with whole packet size (libtsfuncs).
6
- * Add --input-service option, to choose service id (program) in MPTS input.
6
+ * Add --input-service (-M) option, to choose service id (program) in MPTS input.
7 7
  * When the input is MPTS and output filtering is enabled, rewrite output
8 8
    PAT to include only the single program that is decoded.
9 9
  * Parse SDT and display provider and service name.
10
+ * Add --output-nit-pass (-y) to enable NIT pass through.
11
+ * Add --output-eit-pass (-w) to enable EIT (EPG) pass through.
12
+ * Add --output-tdt-pass (-x) to enable TDT/TOT pass through.
10 13
 
11 14
 2011-11-18 : Version 4.0
12 15
  * Set CAMD sockets NODELAY to avoid OSCAM errors when many packets are sent.

+ 5
- 2
README View File

@@ -46,6 +46,9 @@ Output options:
46 46
  -o --output-intf <addr>    | Set multicast output interface. Default: 0.0.0.0
47 47
  -t --output-ttl <ttl>      | Set multicast ttl. Default: 1
48 48
  -p --output-filter         | Enable or disable output filter. Default: enabled
49
+ -y --output-nit-pass       | Pass through NIT.
50
+ -w --output-eit-pass       | Pass through EIT (EPG).
51
+ -x --output-tdt-pass       | Pass through TDT/TOT.
49 52
 
50 53
 CA options:
51 54
  -c --ca-system <ca_sys>    | Process input EMM/ECM from <ca_sys>.
@@ -55,7 +58,7 @@ CA options:
55 58
  -C --caid <caid>           | Set CAID. Default: Taken from --ca-system.
56 59
 
57 60
 CAMD server options:
58
- -s --camd-server <addr>    | Set CAMD server ip address and port (1.2.3.4:2233).
61
+ -s --camd-server <addr>    | Set CAMD server ip_address:port (1.2.3.4:2233).
59 62
  -U --camd-user <user>      | Set CAMD server user. Default: user
60 63
  -P --camd-pass <pass>      | Set CAMD server password. Default: pass
61 64
 
@@ -73,7 +76,7 @@ ECM options:
73 76
  -H --ecm-report-time <sec> | Report each <sec> how much ECMs and CWs have been
74 77
                             .   processed/skipped. Set <sec> to 0 to disable
75 78
                             .   the reports. Default: 60 sec
76
- -G --ecm-irdeto-type <int> | Process IRDETO ECMs with type X /0..3/. Default: 0
79
+ -G --ecm-irdeto-type <int> | Process IRDETO ECMs with type X /0-3/. Default: 0
77 80
  -K --ecm-no-log            | Disable ECM and code words logging.
78 81
  -J --cw-warn-time <sec>    | Warn if no valid code word has been received.
79 82
                             .   Set <sec> to 0 to disable. Default: 20 sec

+ 3
- 0
data.h View File

@@ -161,6 +161,9 @@ struct ts {
161 161
 	int					emm_send;
162 162
 	int					emm_only;
163 163
 	int					pid_filter;
164
+	int					eit_passthrough;
165
+	int					tdt_passthrough;
166
+	int					nit_passthrough;
164 167
 
165 168
 	uint8_t				irdeto_ecm;
166 169
 	int					ecm_cw_log;

+ 6
- 0
tables.c View File

@@ -133,6 +133,12 @@ void process_pmt(struct ts *ts, uint16_t pid, uint8_t *ts_packet) {
133 133
 	pidmap_clear(&ts->pidmap);
134 134
 	pidmap_set(&ts->pidmap, 0x0000); // PAT
135 135
 	pidmap_set(&ts->pidmap, 0x0011); // SDT
136
+	if (ts->nit_passthrough)
137
+		pidmap_set(&ts->pidmap, 0x0010); // NIT
138
+	if (ts->eit_passthrough)
139
+		pidmap_set(&ts->pidmap, 0x0012); // EIT
140
+	if (ts->tdt_passthrough)
141
+		pidmap_set(&ts->pidmap, 0x0014); // TDT/TOT
136 142
 	pidmap_set(&ts->pidmap, ts->pmt->ts_header.pid); // PMT PID
137 143
 	pidmap_set(&ts->pidmap, ts->pmt->PCR_pid); // PCR
138 144
 	for (i=0;i<ts->pmt->streams_num;i++) {

+ 9
- 0
tsdecrypt.1 View File

@@ -96,6 +96,15 @@ Enable output filtering. When output filter is enabled only PAT/PMT/SDT
96 96
 and data packets are left in the output. Everything else not mentioned
97 97
 in PMT like NIT, EIT, TDT tables and unknown pids is removed.
98 98
 .TP
99
+\fB\-y\fR, \fB\-\-output\-nit\-pass\fR
100
+Pass throught NIT packets when output filtering is enabled.
101
+.TP
102
+\fB\-w\fR, \fB\-\-output\-eit\-pass\fR
103
+Pass throught EIT (EPG) packets when output filtering is enabled.
104
+.TP
105
+\fB\-x\fR, \fB\-\-output\-tdt\-pass\fR
106
+Pass throught TDT/TOT packets when output filtering is enabled.
107
+.TP
99 108
 .SH CA OPTIONS
100 109
 .PP
101 110
 .TP

+ 29
- 4
tsdecrypt.c View File

@@ -103,7 +103,7 @@ void run_benchmark(void) {
103 103
 	puts("* Done *");
104 104
 }
105 105
 
106
-// Unused short options: ABFQTWYagjkmnqruvwxy0123456789
106
+// Unused short options: ABFQTWYagjkmnqruv0123456789
107 107
 static const struct option long_options[] = {
108 108
 	{ "ident",				required_argument, NULL, 'i' },
109 109
 	{ "daemon",				required_argument, NULL, 'd' },
@@ -121,6 +121,9 @@ static const struct option long_options[] = {
121 121
 	{ "output-intf",		required_argument, NULL, 'o' },
122 122
 	{ "output-ttl",			required_argument, NULL, 't' },
123 123
 	{ "output-filter",		no_argument,       NULL, 'p' },
124
+	{ "output-nit-pass",	no_argument,       NULL, 'y' },
125
+	{ "output-eit-pass",	no_argument,       NULL, 'w' },
126
+	{ "output-tdt-pass",	no_argument,       NULL, 'x' },
124 127
 
125 128
 	{ "ca-system",			required_argument, NULL, 'c' },
126 129
 	{ "caid",				required_argument, NULL, 'C' },
@@ -179,6 +182,9 @@ static void show_help(struct ts *ts) {
179 182
 	printf(" -o --output-intf <addr>    | Set multicast output interface. Default: %s\n", inet_ntoa(ts->output.intf));
180 183
 	printf(" -t --output-ttl <ttl>      | Set multicast ttl. Default: %d\n", ts->output.ttl);
181 184
 	printf(" -p --output-filter         | Enable or disable output filter. Default: %s\n", ts->pid_filter ? "enabled" : "disabled");
185
+	printf(" -y --output-nit-pass       | Pass through NIT.\n");
186
+	printf(" -w --output-eit-pass       | Pass through EIT (EPG).\n");
187
+	printf(" -x --output-tdt-pass       | Pass through TDT/TOT.\n");
182 188
 	printf("\n");
183 189
 	printf("CA options:\n");
184 190
 	printf(" -c --ca-system <ca_sys>    | Process input EMM/ECM from <ca_sys>.\n");
@@ -250,7 +256,7 @@ static int parse_io_param(struct io *io, char *opt, int open_flags, mode_t open_
250 256
 
251 257
 static void parse_options(struct ts *ts, int argc, char **argv) {
252 258
 	int j, i, ca_err = 0, server_err = 1, input_addr_err = 0, output_addr_err = 0, output_intf_err = 0, ident_err = 0;
253
-	while ( (j = getopt_long(argc, argv, "i:d:N:Sl:L:I:RzM:O:o:t:pc:C:s:U:P:eZ:Ef:X:H:G:KJ:D:bhV", long_options, NULL)) != -1 ) {
259
+	while ( (j = getopt_long(argc, argv, "i:d:N:Sl:L:I:RzM:O:o:t:pwxyc:C:s:U:P:eZ:Ef:X:H:G:KJ:D:bhV", long_options, NULL)) != -1 ) {
254 260
 		char *p = NULL;
255 261
 		switch (j) {
256 262
 			case 'i':
@@ -309,7 +315,15 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
309 315
 			case 'p':
310 316
 				ts->pid_filter = !ts->pid_filter;
311 317
 				break;
312
-
318
+			case 'y':
319
+				ts->nit_passthrough = !ts->nit_passthrough;
320
+				break;
321
+			case 'w':
322
+				ts->eit_passthrough = !ts->eit_passthrough;
323
+				break;
324
+			case 'x':
325
+				ts->tdt_passthrough = !ts->tdt_passthrough;
326
+				break;
313 327
 			case 'c':
314 328
 				if (strcasecmp("IRDETO", optarg) == 0)
315 329
 					ts->req_CA_sys = CA_IRDETO;
@@ -472,7 +486,18 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
472 486
 		} else if (ts->output.type == FILE_IO) {
473 487
 			ts_LOGf("Output file: %s\n", ts->output.fd == 1 ? "STDOUT" : ts->output.fname);
474 488
 		}
475
-		ts_LOGf("PID filter : %s\n", ts->pid_filter ? "enabled" : "disabled");
489
+		ts_LOGf("Out filter : %s (%s)\n",
490
+			ts->pid_filter ? "enabled" : "disabled",
491
+			ts->pid_filter ? "output only service related PIDs" : "output everything"
492
+		);
493
+		if (ts->pid_filter) {
494
+			if (ts->nit_passthrough)
495
+				ts_LOGf("Out filter : Pass through NIT.\n");
496
+			if (ts->eit_passthrough)
497
+				ts_LOGf("Out filter : Pass through EIT (EPG).\n");
498
+			if (ts->tdt_passthrough)
499
+				ts_LOGf("Out filter : Pass through TDT/TOT.\n");
500
+		}
476 501
 	}
477 502
 	ts_LOGf("Server addr: tcp://%s:%u/\n", inet_ntoa(ts->camd35.server_addr), ts->camd35.server_port);
478 503
 	ts_LOGf("Server user: %s\n", ts->camd35.user);

Loading…
Cancel
Save