Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dvblast
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
dvblast
Commits
635d08ed
Commit
635d08ed
authored
Jun 24, 2010
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* en50221.c: Use asynchronous I/O for CAM operations.
parent
a26123f8
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
305 additions
and
277 deletions
+305
-277
dvb.c
dvb.c
+28
-20
dvblast.h
dvblast.h
+0
-1
en50221.c
en50221.c
+276
-256
en50221.h
en50221.h
+1
-0
No files found.
dvb.c
View file @
635d08ed
...
@@ -53,6 +53,7 @@
...
@@ -53,6 +53,7 @@
* Local declarations
* Local declarations
*****************************************************************************/
*****************************************************************************/
#define FRONTEND_LOCK_TIMEOUT 30000000
/* 30 s */
#define FRONTEND_LOCK_TIMEOUT 30000000
/* 30 s */
#define CA_POLL_PERIOD 100000
/* 100 ms */
#define MAX_READ_ONCE 50
#define MAX_READ_ONCE 50
#define DVR_BUFFER_SIZE 40*188*1024
/* bytes */
#define DVR_BUFFER_SIZE 40*188*1024
/* bytes */
...
@@ -61,7 +62,6 @@ static fe_status_t i_last_status;
...
@@ -61,7 +62,6 @@ static fe_status_t i_last_status;
static
mtime_t
i_frontend_timeout
;
static
mtime_t
i_frontend_timeout
;
static
mtime_t
i_ca_next_event
=
0
;
static
mtime_t
i_ca_next_event
=
0
;
static
block_t
*
p_freelist
=
NULL
;
static
block_t
*
p_freelist
=
NULL
;
mtime_t
i_ca_timeout
=
0
;
/*****************************************************************************
/*****************************************************************************
* Local prototypes
* Local prototypes
...
@@ -105,7 +105,7 @@ void dvb_Open( void )
...
@@ -105,7 +105,7 @@ void dvb_Open( void )
}
}
en50221_Init
();
en50221_Init
();
i_ca_next_event
=
mdate
()
+
i_ca_timeout
;
i_ca_next_event
=
mdate
()
+
CA_POLL_PERIOD
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -121,7 +121,7 @@ void dvb_Reset( void )
...
@@ -121,7 +121,7 @@ void dvb_Reset( void )
*****************************************************************************/
*****************************************************************************/
block_t
*
dvb_Read
(
void
)
block_t
*
dvb_Read
(
void
)
{
{
struct
pollfd
ufds
[
3
];
struct
pollfd
ufds
[
4
];
int
i_ret
,
i_nb_fd
=
2
;
int
i_ret
,
i_nb_fd
=
2
;
mtime_t
i_wallclock
;
mtime_t
i_wallclock
;
block_t
*
p_blocks
=
NULL
;
block_t
*
p_blocks
=
NULL
;
...
@@ -133,9 +133,15 @@ block_t *dvb_Read( void )
...
@@ -133,9 +133,15 @@ block_t *dvb_Read( void )
ufds
[
1
].
events
=
POLLERR
|
POLLPRI
;
ufds
[
1
].
events
=
POLLERR
|
POLLPRI
;
if
(
i_comm_fd
!=
-
1
)
if
(
i_comm_fd
!=
-
1
)
{
{
ufds
[
2
].
fd
=
i_comm_fd
;
ufds
[
i_nb_fd
].
fd
=
i_comm_fd
;
ufds
[
2
].
events
=
POLLIN
;
ufds
[
i_nb_fd
].
events
=
POLLIN
;
i_nb_fd
=
3
;
i_nb_fd
++
;
}
if
(
i_ca_handle
&&
i_ca_type
==
CA_CI_LINK
)
{
ufds
[
i_nb_fd
].
fd
=
i_ca_handle
;
ufds
[
i_nb_fd
].
events
=
POLLIN
;
i_nb_fd
++
;
}
}
i_ret
=
poll
(
ufds
,
i_nb_fd
,
100
);
i_ret
=
poll
(
ufds
,
i_nb_fd
,
100
);
...
@@ -151,12 +157,18 @@ block_t *dvb_Read( void )
...
@@ -151,12 +157,18 @@ block_t *dvb_Read( void )
p_blocks
=
DVRRead
();
p_blocks
=
DVRRead
();
i_wallclock
=
mdate
();
i_wallclock
=
mdate
();
if
(
i_ca_handle
&&
i_ca_type
==
CA_CI_LINK
if
(
i_ca_handle
&&
i_ca_type
==
CA_CI_LINK
)
&&
i_wallclock
>
i_ca_next_event
)
{
if
(
ufds
[
i_nb_fd
-
1
].
revents
)
{
en50221_Read
();
i_ca_next_event
=
i_wallclock
+
CA_POLL_PERIOD
;
}
else
if
(
i_wallclock
>
i_ca_next_event
)
{
{
en50221_Poll
();
en50221_Poll
();
i_wallclock
=
mdate
()
;
i_ca_next_event
=
i_wallclock
+
CA_POLL_PERIOD
;
i_ca_next_event
=
i_wallclock
+
i_ca_timeout
;
}
}
}
if
(
ufds
[
1
].
revents
)
if
(
ufds
[
1
].
revents
)
...
@@ -165,8 +177,6 @@ block_t *dvb_Read( void )
...
@@ -165,8 +177,6 @@ block_t *dvb_Read( void )
if
(
i_frontend_timeout
&&
i_wallclock
>
i_frontend_timeout
)
if
(
i_frontend_timeout
&&
i_wallclock
>
i_frontend_timeout
)
{
{
msg_Warn
(
NULL
,
"no lock, tuning again"
);
msg_Warn
(
NULL
,
"no lock, tuning again"
);
/* Do not reset the frontend because the previous parameters were
* correct, and some transponders take a long time to lock. */
FrontendSet
(
false
);
FrontendSet
(
false
);
}
}
...
@@ -716,7 +726,6 @@ static void FrontendSet( bool b_init )
...
@@ -716,7 +726,6 @@ static void FrontendSet( bool b_init )
}
}
if
(
b_init
)
if
(
b_init
)
{
FrontendInfo
(
info
);
FrontendInfo
(
info
);
/* Clear frontend commands */
/* Clear frontend commands */
...
@@ -725,7 +734,6 @@ static void FrontendSet( bool b_init )
...
@@ -725,7 +734,6 @@ static void FrontendSet( bool b_init )
msg_Err
(
NULL
,
"Unable to clear frontend"
);
msg_Err
(
NULL
,
"Unable to clear frontend"
);
exit
(
1
);
exit
(
1
);
}
}
}
switch
(
info
.
type
)
switch
(
info
.
type
)
{
{
...
...
dvblast.h
View file @
635d08ed
...
@@ -125,7 +125,6 @@ extern int b_output_udp;
...
@@ -125,7 +125,6 @@ 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
;
extern
volatile
int
b_hup_received
;
extern
volatile
int
b_hup_received
;
extern
mtime_t
i_ca_timeout
;
extern
int
i_comm_fd
;
extern
int
i_comm_fd
;
extern
uint16_t
i_src_port
;
extern
uint16_t
i_src_port
;
extern
in_addr_t
i_src_addr
;
extern
in_addr_t
i_src_addr
;
...
...
en50221.c
View file @
635d08ed
This diff is collapsed.
Click to expand it.
en50221.h
View file @
635d08ed
...
@@ -79,6 +79,7 @@ extern int i_ca_type;
...
@@ -79,6 +79,7 @@ extern int i_ca_type;
*****************************************************************************/
*****************************************************************************/
void
en50221_Init
(
void
);
void
en50221_Init
(
void
);
void
en50221_Reset
(
void
);
void
en50221_Reset
(
void
);
void
en50221_Read
(
void
);
void
en50221_Poll
(
void
);
void
en50221_Poll
(
void
);
void
en50221_AddPMT
(
dvbpsi_pmt_t
*
p_pmt
);
void
en50221_AddPMT
(
dvbpsi_pmt_t
*
p_pmt
);
void
en50221_UpdatePMT
(
dvbpsi_pmt_t
*
p_pmt
);
void
en50221_UpdatePMT
(
dvbpsi_pmt_t
*
p_pmt
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment