Commit 1f6eb0ea authored by Christophe Massiot's avatar Christophe Massiot

* demux.c, dvblast.c: New --select-pmts parameter which sets a demux filter on...

* demux.c, dvblast.c: New --select-pmts parameter which sets a demux filter on all PMTs (intermediate between normal mode and budget mode).
parent c094d36f
...@@ -102,8 +102,8 @@ static void StartPID( output_t *p_output, uint16_t i_pid ); ...@@ -102,8 +102,8 @@ static void StartPID( output_t *p_output, uint16_t i_pid );
static void StopPID( output_t *p_output, uint16_t i_pid ); static void StopPID( output_t *p_output, uint16_t i_pid );
static void SelectPID( uint16_t i_sid, uint16_t i_pid ); static void SelectPID( uint16_t i_sid, uint16_t i_pid );
static void UnselectPID( uint16_t i_sid, uint16_t i_pid ); static void UnselectPID( uint16_t i_sid, uint16_t i_pid );
static void SelectPSI( uint16_t i_sid, uint16_t i_pid ); static void SelectPMT( uint16_t i_sid, uint16_t i_pid );
static void UnselectPSI( uint16_t i_sid, uint16_t i_pid ); static void UnselectPMT( uint16_t i_sid, uint16_t i_pid );
static void GetPIDS( uint16_t **ppi_wanted_pids, int *pi_nb_wanted_pids, static void GetPIDS( uint16_t **ppi_wanted_pids, int *pi_nb_wanted_pids,
uint16_t i_sid, uint16_t i_sid,
const uint16_t *pi_pids, int i_nb_pids ); const uint16_t *pi_pids, int i_nb_pids );
...@@ -655,22 +655,24 @@ static void UnselectPID( uint16_t i_sid, uint16_t i_pid ) ...@@ -655,22 +655,24 @@ static void UnselectPID( uint16_t i_sid, uint16_t i_pid )
} }
/***************************************************************************** /*****************************************************************************
* SelectPSI/UnselectPSI * SelectPMT/UnselectPMT
*****************************************************************************/ *****************************************************************************/
static void SelectPSI( uint16_t i_sid, uint16_t i_pid ) static void SelectPMT( uint16_t i_sid, uint16_t i_pid )
{ {
int i; int i;
p_pids[i_pid].i_psi_refcount++; p_pids[i_pid].i_psi_refcount++;
p_pids[i_pid].b_pes = false; p_pids[i_pid].b_pes = false;
for ( i = 0; i < i_nb_outputs; i++ ) if ( b_select_pmts )
SetPID( i_pid );
else for ( i = 0; i < i_nb_outputs; i++ )
if ( (pp_outputs[i]->config.i_config & OUTPUT_VALID) if ( (pp_outputs[i]->config.i_config & OUTPUT_VALID)
&& pp_outputs[i]->config.i_sid == i_sid ) && pp_outputs[i]->config.i_sid == i_sid )
SetPID( i_pid ); SetPID( i_pid );
} }
static void UnselectPSI( uint16_t i_sid, uint16_t i_pid ) static void UnselectPMT( uint16_t i_sid, uint16_t i_pid )
{ {
int i; int i;
...@@ -679,7 +681,9 @@ static void UnselectPSI( uint16_t i_sid, uint16_t i_pid ) ...@@ -679,7 +681,9 @@ static void UnselectPSI( uint16_t i_sid, uint16_t i_pid )
psi_assemble_reset( &p_pids[i_pid].p_psi_buffer, psi_assemble_reset( &p_pids[i_pid].p_psi_buffer,
&p_pids[i_pid].i_psi_buffer_used ); &p_pids[i_pid].i_psi_buffer_used );
for ( i = 0; i < i_nb_outputs; i++ ) if ( b_select_pmts )
UnsetPID( i_pid );
else for ( i = 0; i < i_nb_outputs; i++ )
if ( (pp_outputs[i]->config.i_config & OUTPUT_VALID) if ( (pp_outputs[i]->config.i_config & OUTPUT_VALID)
&& pp_outputs[i]->config.i_sid == i_sid ) && pp_outputs[i]->config.i_sid == i_sid )
UnsetPID( i_pid ); UnsetPID( i_pid );
...@@ -1443,7 +1447,7 @@ static void DeleteProgram( uint16_t i_sid, uint16_t i_pid ) ...@@ -1443,7 +1447,7 @@ static void DeleteProgram( uint16_t i_sid, uint16_t i_pid )
{ {
int i_pmt; int i_pmt;
UnselectPSI( i_sid, i_pid ); UnselectPMT( i_sid, i_pid );
for ( i_pmt = 0; i_pmt < i_nb_sids; i_pmt++ ) for ( i_pmt = 0; i_pmt < i_nb_sids; i_pmt++ )
{ {
...@@ -1652,7 +1656,7 @@ static void HandlePAT( mtime_t i_dts ) ...@@ -1652,7 +1656,7 @@ static void HandlePAT( mtime_t i_dts )
if ( p_old_program != NULL ) if ( p_old_program != NULL )
DeleteProgram( i_sid, patn_get_pid( p_old_program ) ); DeleteProgram( i_sid, patn_get_pid( p_old_program ) );
SelectPSI( i_sid, i_pid ); SelectPMT( i_sid, i_pid );
for ( i_pmt = 0; i_pmt < i_nb_sids; i_pmt++ ) for ( i_pmt = 0; i_pmt < i_nb_sids; i_pmt++ )
if ( pp_sids[i_pmt]->i_sid == 0 ) if ( pp_sids[i_pmt]->i_sid == 0 )
......
...@@ -78,6 +78,7 @@ mtime_t i_frontend_timeout_duration = DEFAULT_FRONTEND_TIMEOUT; ...@@ -78,6 +78,7 @@ mtime_t i_frontend_timeout_duration = DEFAULT_FRONTEND_TIMEOUT;
mtime_t i_quit_timeout = 0; mtime_t i_quit_timeout = 0;
mtime_t i_quit_timeout_duration = 0; mtime_t i_quit_timeout_duration = 0;
int b_budget_mode = 0; int b_budget_mode = 0;
int b_select_pmts = 0;
int b_random_tsid = 0; int b_random_tsid = 0;
uint16_t i_network_id = 0xffff; uint16_t i_network_id = 0xffff;
uint8_t *p_network_name; uint8_t *p_network_name;
...@@ -379,7 +380,7 @@ static void DisplayVersion() ...@@ -379,7 +380,7 @@ static void DisplayVersion()
void usage() void usage()
{ {
DisplayVersion(); DisplayVersion();
msg_Raw( NULL, "Usage: dvblast [-q] [-c <config file>] [-r <remote socket>] [-t <ttl>] [-o <SSRC IP>] [-i <RT priority>] [-a <adapter>] [-n <frontend number>] [-S <diseqc>] [-f <frequency>|-D [<src host>[:<src port>]@]<src mcast>[:<port>][/<opts>]*|-A <ASI adapter>] [-s <symbol rate>] [-v <0|13|18>] [-p] [-b <bandwidth>] [-I <inversion>] [-F <fec inner>] [-m <modulation] [-R <rolloff>] [-P <pilot>] [-K <fec lp>] [-G <guard interval>] [-H <hierarchy>] [-X <transmission>] [-O <lock timeout>] [-u] [-U] [-L <latency>] [-E <retention>] [-d <dest IP>[<:port>][/<opts>]*] [-C [-e] [-M <network name] [-N <network ID>]] [-T] [-j <system charset>] [-J <DVB charset>] [-Q <quit timeout>] [-x <text|xml>" ); msg_Raw( NULL, "Usage: dvblast [-q] [-c <config file>] [-r <remote socket>] [-t <ttl>] [-o <SSRC IP>] [-i <RT priority>] [-a <adapter>] [-n <frontend number>] [-S <diseqc>] [-f <frequency>|-D [<src host>[:<src port>]@]<src mcast>[:<port>][/<opts>]*|-A <ASI adapter>] [-s <symbol rate>] [-v <0|13|18>] [-p] [-b <bandwidth>] [-I <inversion>] [-F <fec inner>] [-m <modulation] [-R <rolloff>] [-P <pilot>] [-K <fec lp>] [-G <guard interval>] [-H <hierarchy>] [-X <transmission>] [-O <lock timeout>] [-u] [-w] [-U] [-L <latency>] [-E <retention>] [-d <dest IP>[<:port>][/<opts>]*] [-C [-e] [-M <network name] [-N <network ID>]] [-T] [-j <system charset>] [-J <DVB charset>] [-Q <quit timeout>] [-x <text|xml>" );
msg_Raw( NULL, "Input:" ); msg_Raw( NULL, "Input:" );
msg_Raw( NULL, " -a --adapter read packets from a Linux-DVB adapter (typically 0-n)" ); msg_Raw( NULL, " -a --adapter read packets from a Linux-DVB adapter (typically 0-n)" );
...@@ -408,6 +409,7 @@ void usage() ...@@ -408,6 +409,7 @@ void usage()
msg_Raw( NULL, " -S --diseqc satellite number for diseqc (0: no diseqc, 1-4, A or B)" ); msg_Raw( NULL, " -S --diseqc satellite number for diseqc (0: no diseqc, 1-4, A or B)" );
msg_Raw( NULL, " -u --budget-mode turn on budget mode (no hardware PID filtering)" ); msg_Raw( NULL, " -u --budget-mode turn on budget mode (no hardware PID filtering)" );
msg_Raw( NULL, " -v --voltage voltage to apply to the LNB (QPSK)" ); msg_Raw( NULL, " -v --voltage voltage to apply to the LNB (QPSK)" );
msg_Raw( NULL, " -w --select-pmts set a PID filter on all PMTs" );
msg_Raw( NULL, " -O --lock-timeout timeout for the lock operation (in ms)" ); msg_Raw( NULL, " -O --lock-timeout timeout for the lock operation (in ms)" );
msg_Raw( NULL, "Output:" ); msg_Raw( NULL, "Output:" );
...@@ -480,6 +482,7 @@ int main( int i_argc, char **pp_argv ) ...@@ -480,6 +482,7 @@ int main( int i_argc, char **pp_argv )
{ "transmission", required_argument, NULL, 'X' }, { "transmission", required_argument, NULL, 'X' },
{ "lock-timeout", required_argument, NULL, 'O' }, { "lock-timeout", required_argument, NULL, 'O' },
{ "budget-mode", no_argument, NULL, 'u' }, { "budget-mode", no_argument, NULL, 'u' },
{ "select-pmts", no_argument, NULL, 'w' },
{ "udp", no_argument, NULL, 'U' }, { "udp", no_argument, NULL, 'U' },
{ "unique-ts-id", no_argument, NULL, 'T' }, { "unique-ts-id", no_argument, NULL, 'T' },
{ "latency", required_argument, NULL, 'L' }, { "latency", required_argument, NULL, 'L' },
...@@ -502,7 +505,7 @@ int main( int i_argc, char **pp_argv ) ...@@ -502,7 +505,7 @@ int main( int i_argc, char **pp_argv )
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
}; };
while ( (c = getopt_long(i_argc, pp_argv, "q::c:r:t:o:i:a:n:f:F:R:s:S:v:pb:I:m:P:K:G:H:X:O:uUTL:E:d:D:A:lCeM:N:j:J:x:Q:hV", long_options, NULL)) != -1 ) while ( (c = getopt_long(i_argc, pp_argv, "q::c:r:t:o:i:a:n:f:F:R:s:S:v:pb:I:m:P:K:G:H:X:O:uwUTL:E:d:D:A:lCeM:N:j:J:x:Q:hV", long_options, NULL)) != -1 )
{ {
switch ( c ) switch ( c )
{ {
...@@ -642,6 +645,10 @@ int main( int i_argc, char **pp_argv ) ...@@ -642,6 +645,10 @@ int main( int i_argc, char **pp_argv )
b_budget_mode = 1; b_budget_mode = 1;
break; break;
case 'w':
b_select_pmts = 1;
break;
case 'U': case 'U':
b_udp_global = 1; b_udp_global = 1;
break; break;
......
...@@ -154,6 +154,7 @@ extern mtime_t i_frontend_timeout_duration; ...@@ -154,6 +154,7 @@ extern mtime_t i_frontend_timeout_duration;
extern mtime_t i_quit_timeout; extern mtime_t i_quit_timeout;
extern mtime_t i_quit_timeout_duration; extern mtime_t i_quit_timeout_duration;
extern int b_budget_mode; extern int b_budget_mode;
extern int b_select_pmts;
extern int b_random_tsid; extern int b_random_tsid;
extern uint16_t i_network_id; extern uint16_t i_network_id;
extern uint8_t *p_network_name; extern uint8_t *p_network_name;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment