Commit f76400cc authored by massiot's avatar massiot

* en50221.c: Remove slow-cam option ; remove limitations on the numbers of

   CA system IDs and programs.


git-svn-id: svn://svn.videolan.org/dvblast/trunk@148 55d3f8b6-4a41-4d2d-a900-313d1436a5b8
parent cc443db4
...@@ -62,7 +62,6 @@ int b_tone = 0; ...@@ -62,7 +62,6 @@ int b_tone = 0;
int i_bandwidth = 8; int i_bandwidth = 8;
char *psz_modulation = NULL; char *psz_modulation = NULL;
int b_budget_mode = 0; int b_budget_mode = 0;
int b_slow_cam = 0;
int b_output_udp = 0; int b_output_udp = 0;
int b_enable_epg = 0; int b_enable_epg = 0;
int b_unique_tsid = 0; int b_unique_tsid = 0;
...@@ -318,7 +317,7 @@ static void DisplayVersion() ...@@ -318,7 +317,7 @@ static void DisplayVersion()
*****************************************************************************/ *****************************************************************************/
void usage() void usage()
{ {
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 mcast>:<port>|-A <ASI adapter>] [-F <fec inner>] [-R <rolloff>] [-s <symbol rate>] [-v <0|13|18>] [-p] [-b <bandwidth>] [-m <modulation] [-u] [-W] [-U] [-L <latency>] [-E <retention>] [-d <dest IP:port>] [-e] [-T]" ); 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 mcast>:<port>|-A <ASI adapter>] [-F <fec inner>] [-R <rolloff>] [-s <symbol rate>] [-v <0|13|18>] [-p] [-b <bandwidth>] [-m <modulation] [-u] [-U] [-L <latency>] [-E <retention>] [-d <dest IP:port>] [-e] [-T]" );
msg_Raw( NULL, "Input:" ); msg_Raw( NULL, "Input:" );
msg_Raw( NULL, " -a --adapter <adapter>" ); msg_Raw( NULL, " -a --adapter <adapter>" );
...@@ -342,7 +341,6 @@ void usage() ...@@ -342,7 +341,6 @@ void usage()
msg_Raw( NULL, " -T --unique-ts-id generate unique TS ID for each program" ); msg_Raw( NULL, " -T --unique-ts-id generate unique TS ID for each program" );
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 --slow-cam add extra delays for slow CAMs" );
msg_Raw( NULL, "Output:" ); msg_Raw( NULL, "Output:" );
msg_Raw( NULL, " -c --config-file <config file>" ); msg_Raw( NULL, " -c --config-file <config file>" );
...@@ -396,7 +394,6 @@ int main( int i_argc, char **pp_argv ) ...@@ -396,7 +394,6 @@ int main( int i_argc, char **pp_argv )
{ "bandwidth", required_argument, NULL, 'b' }, { "bandwidth", required_argument, NULL, 'b' },
{ "modulation", required_argument, NULL, 'm' }, { "modulation", required_argument, NULL, 'm' },
{ "budget-mode", no_argument, NULL, 'u' }, { "budget-mode", no_argument, NULL, 'u' },
{ "slow-cam", 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' },
...@@ -411,7 +408,7 @@ int main( int i_argc, char **pp_argv ) ...@@ -411,7 +408,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:m:uWUTL:E:d:D:A:lehV", 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:m:uUTL:E:d:D:A:lehV", long_options, NULL)) != -1 )
{ {
switch ( c ) switch ( c )
{ {
...@@ -522,10 +519,6 @@ int main( int i_argc, char **pp_argv ) ...@@ -522,10 +519,6 @@ int main( int i_argc, char **pp_argv )
b_budget_mode = 1; b_budget_mode = 1;
break; break;
case 'W':
b_slow_cam = 1;
break;
case 'U': case 'U':
b_output_udp = 1; b_output_udp = 1;
break; break;
......
...@@ -125,7 +125,6 @@ extern int b_tone; ...@@ -125,7 +125,6 @@ extern int b_tone;
extern int i_bandwidth; extern int i_bandwidth;
extern char *psz_modulation; extern char *psz_modulation;
extern int b_budget_mode; extern int b_budget_mode;
extern int b_slow_cam;
extern int b_output_udp; extern int b_output_udp;
extern int b_enable_epg; extern int b_enable_epg;
extern int b_unique_tsid; extern int b_unique_tsid;
......
...@@ -67,8 +67,7 @@ ...@@ -67,8 +67,7 @@
*****************************************************************************/ *****************************************************************************/
#undef DEBUG_TPDU #undef DEBUG_TPDU
#define CAM_INIT_TIMEOUT 15000000 /* 15 s */ #define CAM_INIT_TIMEOUT 15000000 /* 15 s */
#define HLCI_WAIT_CAM_READY 0 #undef HLCI_WAIT_CAM_READY
#define CAM_PROG_MAX MAX_PROGRAMS
#define CAPMT_WAIT 100 /* ms */ #define CAPMT_WAIT 100 /* ms */
typedef struct en50221_msg_t typedef struct en50221_msg_t
...@@ -1048,11 +1047,10 @@ static void ApplicationInformationOpen( access_t * p_access, int i_session_id ) ...@@ -1048,11 +1047,10 @@ static void ApplicationInformationOpen( access_t * p_access, int i_session_id )
* Conditional Access * Conditional Access
*/ */
#define MAX_CASYSTEM_IDS 64
typedef struct typedef struct
{ {
uint16_t pi_system_ids[MAX_CASYSTEM_IDS + 1]; int i_nb_system_ids;
uint16_t *pi_system_ids;
int i_selected_programs; int i_selected_programs;
int b_high_level; int b_high_level;
...@@ -1060,11 +1058,11 @@ typedef struct ...@@ -1060,11 +1058,11 @@ typedef struct
static bool CheckSystemID( system_ids_t *p_ids, uint16_t i_id ) static bool CheckSystemID( system_ids_t *p_ids, uint16_t i_id )
{ {
int i = 0; int i;
if( !p_ids ) return false; if( p_ids == NULL ) return false;
if( p_ids->b_high_level ) return true; if( p_ids->b_high_level ) return true;
while ( p_ids->pi_system_ids[i] ) for ( i = 0; i < p_ids->i_nb_system_ids; i++ )
{ {
if ( p_ids->pi_system_ids[i] == i_id ) if ( p_ids->pi_system_ids[i] == i_id )
return true; return true;
...@@ -1300,12 +1298,6 @@ static void CAPMTAdd( access_t * p_access, int i_session_id, ...@@ -1300,12 +1298,6 @@ static void CAPMTAdd( access_t * p_access, int i_session_id,
uint8_t *p_capmt; uint8_t *p_capmt;
int i_capmt_size; int i_capmt_size;
if( p_ids->i_selected_programs >= CAM_PROG_MAX )
{
msg_Warn( p_access, "Not adding CAPMT for SID %d, too many programs",
p_pmt->i_program_number );
return;
}
p_ids->i_selected_programs++; p_ids->i_selected_programs++;
if( p_ids->i_selected_programs == 1 ) if( p_ids->i_selected_programs == 1 )
{ {
...@@ -1313,12 +1305,6 @@ static void CAPMTAdd( access_t * p_access, int i_session_id, ...@@ -1313,12 +1305,6 @@ static void CAPMTAdd( access_t * p_access, int i_session_id,
return; return;
} }
#if 0
/* FIXME: how do we implement it with async IO ? */
if( b_slow_cam )
msleep( CAPMT_WAIT * 1000 );
#endif
msg_Dbg( p_access, "adding CAPMT for SID %d on session %d", msg_Dbg( p_access, "adding CAPMT for SID %d on session %d",
p_pmt->i_program_number, i_session_id ); p_pmt->i_program_number, i_session_id );
...@@ -1401,13 +1387,18 @@ static void ConditionalAccessHandle( access_t * p_access, int i_session_id, ...@@ -1401,13 +1387,18 @@ static void ConditionalAccessHandle( access_t * p_access, int i_session_id,
uint8_t *d = APDUGetLength( p_apdu, &l ); uint8_t *d = APDUGetLength( p_apdu, &l );
msg_Dbg( p_access, "CA system IDs supported by the application :" ); msg_Dbg( p_access, "CA system IDs supported by the application :" );
for ( i = 0; i < l / 2; i++ ) if ( p_ids->i_nb_system_ids )
free( p_ids->pi_system_ids );
p_ids->i_nb_system_ids = l / 2;
p_ids->pi_system_ids = malloc( p_ids->i_nb_system_ids
* sizeof(uint16_t) );
for ( i = 0; i < p_ids->i_nb_system_ids; i++ )
{ {
p_ids->pi_system_ids[i] = ((uint16_t)d[0] << 8) | d[1]; p_ids->pi_system_ids[i] = ((uint16_t)d[0] << 8) | d[1];
d += 2; d += 2;
msg_Dbg( p_access, "- 0x%x", p_ids->pi_system_ids[i] ); msg_Dbg( p_access, "- 0x%x", p_ids->pi_system_ids[i] );
} }
p_ids->pi_system_ids[i] = 0;
demux_ResendCAPMTs(); demux_ResendCAPMTs();
break; break;
...@@ -2109,7 +2100,7 @@ void en50221_Reset( void ) ...@@ -2109,7 +2100,7 @@ void en50221_Reset( void )
return; return;
} }
#if HLCI_WAIT_CAM_READY #ifdef HLCI_WAIT_CAM_READY
while( ca_msg.msg[8] == 0xff && ca_msg.msg[9] == 0xff ) while( ca_msg.msg[8] == 0xff && ca_msg.msg[9] == 0xff )
{ {
msleep(1); msleep(1);
......
...@@ -69,7 +69,6 @@ typedef struct en50221_mmi_object_t ...@@ -69,7 +69,6 @@ typedef struct en50221_mmi_object_t
#define MAX_CI_SLOTS 16 #define MAX_CI_SLOTS 16
#define MAX_SESSIONS 32 #define MAX_SESSIONS 32
#define MAX_PROGRAMS 24
extern int i_ca_handle; extern int i_ca_handle;
extern int i_ca_type; extern int i_ca_type;
......
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