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
f55287c1
Commit
f55287c1
authored
Aug 26, 2011
by
Georgi Chorbadzhiyski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: Add per pid information and counters.
parent
8d659bd0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
demux.c
demux.c
+38
-0
dvblast.h
dvblast.h
+16
-0
No files found.
demux.c
View file @
f55287c1
...
...
@@ -67,6 +67,11 @@ typedef struct ts_pid_t
and should be outputed in all services */
bool
b_emm
;
/* PID info and stats */
mtime_t
i_bytes_ts
;
unsigned
long
i_packets_passed
;
ts_pid_info_t
info
;
/* biTStream PSI section gathering */
uint8_t
*
p_psi_buffer
;
uint16_t
i_psi_buffer_used
;
...
...
@@ -266,6 +271,24 @@ static void demux_Handle( block_t *p_ts )
return
;
}
if
(
i_pid
!=
PADDING_PID
)
p_pids
[
i_pid
].
info
.
i_scrambling
=
ts_get_scrambling
(
p_ts
->
p_ts
);
p_pids
[
i_pid
].
info
.
i_last_packet_ts
=
i_wallclock
;
p_pids
[
i_pid
].
info
.
i_packets
++
;
p_pids
[
i_pid
].
i_packets_passed
++
;
/* Calculate bytes_per_sec */
if
(
i_wallclock
>
p_pids
[
i_pid
].
i_bytes_ts
+
1000000
)
{
p_pids
[
i_pid
].
info
.
i_bytes_per_sec
=
p_pids
[
i_pid
].
i_packets_passed
*
TS_SIZE
;
p_pids
[
i_pid
].
i_packets_passed
=
0
;
p_pids
[
i_pid
].
i_bytes_ts
=
i_wallclock
;
}
if
(
p_pids
[
i_pid
].
info
.
i_first_packet_ts
==
0
)
p_pids
[
i_pid
].
info
.
i_first_packet_ts
=
i_wallclock
;
if
(
i_pid
!=
PADDING_PID
&&
p_pids
[
i_pid
].
i_last_cc
!=
-
1
&&
!
ts_check_duplicate
(
i_cc
,
p_pids
[
i_pid
].
i_last_cc
)
&&
ts_check_discontinuity
(
i_cc
,
p_pids
[
i_pid
].
i_last_cc
)
)
...
...
@@ -274,6 +297,8 @@ static void demux_Handle( block_t *p_ts )
uint16_t
i_sid
=
0
;
const
char
*
pid_desc
=
get_pid_desc
(
i_pid
,
&
i_sid
);
p_pids
[
i_pid
].
info
.
i_cc_errors
++
;
msg_Warn
(
NULL
,
"TS discontinuity on pid %4hu expected_cc %2u got %2u (%s, sid %d)"
,
i_pid
,
expected_cc
,
i_cc
,
pid_desc
,
i_sid
);
...
...
@@ -297,6 +322,8 @@ static void demux_Handle( block_t *p_ts )
uint16_t
i_sid
=
0
;
const
char
*
pid_desc
=
get_pid_desc
(
i_pid
,
&
i_sid
);
p_pids
[
i_pid
].
info
.
i_transport_errors
++
;
msg_Warn
(
NULL
,
"transport_error_indicator on pid %hu (%s, sid %u)"
,
i_pid
,
pid_desc
,
i_sid
);
switch
(
i_print_type
)
...
...
@@ -2801,3 +2828,14 @@ uint8_t *demux_get_packed_PMT( uint16_t i_sid, unsigned int *pi_pack_size ) {
}
return
NULL
;
}
inline
void
demux_get_PID_info
(
uint16_t
i_pid
,
uint8_t
*
p_data
)
{
ts_pid_info_t
*
p_info
=
(
ts_pid_info_t
*
)
p_data
;
*
p_info
=
p_pids
[
i_pid
].
info
;
}
inline
void
demux_get_PIDS_info
(
uint8_t
*
p_data
)
{
int
i_pid
;
for
(
i_pid
=
0
;
i_pid
<
MAX_PIDS
;
i_pid
++
)
demux_get_PID_info
(
i_pid
,
p_data
+
(
i_pid
*
sizeof
(
ts_pid_info_t
)
)
);
}
dvblast.h
View file @
f55287c1
...
...
@@ -132,6 +132,20 @@ typedef struct output_t
uint16_t
i_tsid
;
}
output_t
;
typedef
struct
ts_pid_info
{
mtime_t
i_first_packet_ts
;
/* Time of the first seen packet */
mtime_t
i_last_packet_ts
;
/* Time of the last seen packet */
unsigned
long
i_packets
;
/* How much packets have been seen */
unsigned
long
i_cc_errors
;
/* Countinuity counter errors */
unsigned
long
i_transport_errors
;
/* Transport errors */
unsigned
long
i_bytes_per_sec
;
/* How much bytes were process last second */
uint8_t
i_scrambling
;
/* Scrambling bits from the last ts packet */
/* 0 = Not scrambled
1 = Reserved for future use
2 = Scrambled with even key
3 = Scrambled with odd key */
}
ts_pid_info_t
;
extern
int
i_syslog
;
extern
int
i_verbose
;
extern
output_t
**
pp_outputs
;
...
...
@@ -244,6 +258,8 @@ uint8_t *demux_get_current_packed_CAT( unsigned int *pi_pack_size );
uint8_t
*
demux_get_current_packed_NIT
(
unsigned
int
*
pi_pack_size
);
uint8_t
*
demux_get_current_packed_SDT
(
unsigned
int
*
pi_pack_size
);
uint8_t
*
demux_get_packed_PMT
(
uint16_t
service_id
,
unsigned
int
*
pi_pack_size
);
void
demux_get_PID_info
(
uint16_t
i_pid
,
uint8_t
*
p_data
);
void
demux_get_PIDS_info
(
uint8_t
*
p_data
);
output_t
*
output_Create
(
const
output_config_t
*
p_config
);
int
output_Init
(
output_t
*
p_output
,
const
output_config_t
*
p_config
);
...
...
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