Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libdvbpsi
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
libdvbpsi
Commits
1bb2efe0
Commit
1bb2efe0
authored
Oct 18, 2019
by
Olivier Braun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add time_signal handling
parent
eddc9b29
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
159 additions
and
15 deletions
+159
-15
src/tables/sis.c
src/tables/sis.c
+136
-15
src/tables/sis.h
src/tables/sis.h
+2
-0
src/tables/sis_private.h
src/tables/sis_private.h
+21
-0
No files found.
src/tables/sis.c
View file @
1bb2efe0
...
...
@@ -191,7 +191,24 @@ dvbpsi_sis_t* dvbpsi_sis_new(uint8_t i_table_id, uint16_t i_extension, uint8_t i
*****************************************************************************/
void
dvbpsi_sis_empty
(
dvbpsi_sis_t
*
p_sis
)
{
/* FIXME: free splice_command_sections */
switch
(
p_sis
->
i_splice_command_type
)
{
case
0x00
:
/* splice_null */
case
0x04
:
/* splice_schedule */
cmd_splice_schedule_cleanup
(
p_sis
->
p_splice_command
);
break
;
case
0x05
:
/* splice_insert */
cmd_splice_insert_cleanup
(
p_sis
->
p_splice_command
);
break
;
case
0x06
:
/* time_signal */
cmd_time_signal_cleanup
(
p_sis
->
p_splice_command
);
break
;
case
0x07
:
/* bandwidth_reservation */
break
;
default:
break
;
}
p_sis
->
p_splice_command
=
NULL
;
dvbpsi_DeleteDescriptors
(
p_sis
->
p_first_descriptor
);
p_sis
->
p_first_descriptor
=
NULL
;
...
...
@@ -312,7 +329,7 @@ static bool dvbpsi_AddSectionSIS(dvbpsi_t *p_dvbpsi, dvbpsi_sis_decoder_t *p_sis
/* Add to linked list of sections */
if
(
dvbpsi_decoder_psi_section_add
(
DVBPSI_DECODER
(
p_sis_decoder
),
p_section
))
dvbpsi_debug
(
p_dvbpsi
,
"S
DT
decoder"
,
"overwrite section number %d"
,
dvbpsi_debug
(
p_dvbpsi
,
"S
IS
decoder"
,
"overwrite section number %d"
,
p_section
->
i_number
);
return
true
;
...
...
@@ -402,7 +419,7 @@ void dvbpsi_sis_sections_gather(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t * p_sec
/* Decode the sections */
dvbpsi_sis_sections_decode
(
p_dvbpsi
,
p_sis_decoder
->
p_building_sis
,
p_sis_decoder
->
p_sections
);
/* signal the new S
DT
*/
/* signal the new S
IS
*/
p_sis_decoder
->
pf_sis_callback
(
p_sis_decoder
->
p_priv
,
p_sis_decoder
->
p_building_sis
);
/* Delete sections and Reinitialize the structures */
...
...
@@ -459,6 +476,27 @@ static void dvbpsi_sis_break_duration(uint8_t *p_data, dvbpsi_sis_break_duration
(
uint64_t
)
p_data
[
4
]);
}
/*****************************************************************************
* cmd_splice_insert_cleanup
*****************************************************************************
* Free resource for splice_insert command structure.
*****************************************************************************/
static
void
cmd_splice_insert_cleanup
(
dvbpsi_sis_cmd_splice_insert_t
*
p_cmd
)
{
if
(
p_cmd
)
{
dvbpsi_sis_component_splice_time_t
*
p_splice_time
=
p_cmd
->
p_splice_time
;
while
(
p_splice_time
!=
NULL
)
{
dvbpsi_sis_component_splice_time_t
*
p_next
=
p_splice_time
->
p_next
;
free
(
p_splice_time
);
p_splice_time
=
p_next
;
}
p_cmd
->
p_splice_time
=
NULL
;
free
(
p_cmd
);
}
}
/*****************************************************************************
* dvbpsi_sis_cmd_splice_insert_decode
*****************************************************************************
...
...
@@ -574,13 +612,18 @@ error:
*****************************************************************************/
static
void
cmd_splice_schedule_cleanup
(
dvbpsi_sis_cmd_splice_schedule_t
*
p_cmd
)
{
dvbpsi_sis_splice_event_t
*
p_event
=
p_cmd
->
p_splice_event
;
while
(
p_event
)
{
dvbpsi_sis_splice_event_t
*
p_next
=
p_event
->
p_next
;
if
(
p_event
->
p_component
)
{
dvbpsi_sis_component_t
*
p_time
=
p_event
->
p_component
;
while
(
p_time
)
{
dvbpsi_sis_component_t
*
p_tmp
=
p_time
->
p_next
;
if
(
p_cmd
)
{
dvbpsi_sis_splice_event_t
*
p_event
=
p_cmd
->
p_splice_event
;
while
(
p_event
)
{
dvbpsi_sis_splice_event_t
*
p_next
=
p_event
->
p_next
;
if
(
p_event
->
p_component
)
{
dvbpsi_sis_component_t
*
p_time
=
p_event
->
p_component
;
while
(
p_time
)
{
dvbpsi_sis_component_t
*
p_tmp
=
p_time
->
p_next
;
free
(
p_time
);
p_time
=
p_tmp
;
}
...
...
@@ -589,6 +632,7 @@ static void cmd_splice_schedule_cleanup(dvbpsi_sis_cmd_splice_schedule_t *p_cmd)
p_event
=
p_next
;
}
free
(
p_cmd
);
}
}
/*****************************************************************************
...
...
@@ -683,6 +727,76 @@ static dvbpsi_sis_cmd_splice_schedule_t *
return
p_cmd
;
}
/*****************************************************************************
* cmd_time_signal_cleanup
*****************************************************************************
* Free resource for time_signal command structure.
*****************************************************************************/
static
void
cmd_time_signal_cleanup
(
dvbpsi_sis_cmd_time_signal_t
*
p_cmd
)
{
if
(
p_cmd
)
{
dvbpsi_sis_splice_time_t
*
p_splice_time
=
p_cmd
->
p_splice_time
;
while
(
p_splice_time
!=
NULL
)
{
dvbpsi_sis_splice_time_t
*
p_next
=
p_splice_time
->
p_next
;
free
(
p_splice_time
);
p_splice_time
=
p_next
;
}
p_cmd
->
p_splice_time
=
NULL
;
free
(
p_cmd
);
}
}
/*****************************************************************************
* dvbpsi_sis_cmd_time_signal_decode
*****************************************************************************
* time_signal command decoder.
*****************************************************************************/
static
dvbpsi_sis_cmd_time_signal_t
*
dvbpsi_sis_cmd_time_signal_decode
(
uint8_t
*
p_data
,
uint16_t
i_length
)
{
dvbpsi_sis_cmd_time_signal_t
*
p_cmd
=
calloc
(
1
,
sizeof
(
dvbpsi_sis_cmd_time_signal_t
));
if
(
!
p_cmd
)
return
NULL
;
if
(
i_length
<
1
)
{
cmd_time_signal_cleanup
(
p_cmd
);
return
NULL
;
}
bool
b_time_specified
=
false
;
uint64_t
i_pts_time
;
if
((
p_data
[
0
]
&
0x80
)
==
0x80
)
{
if
(
i_length
<
5
)
{
cmd_time_signal_cleanup
(
p_cmd
);
return
NULL
;
}
b_time_specified
=
true
;
i_pts_time
=
((((
uint64_t
)
p_data
[
0
]
&
0x01
)
<<
32
)
|
((
uint64_t
)
p_data
[
1
]
<<
24
)
|
((
uint64_t
)
p_data
[
2
]
<<
16
)
|
((
uint64_t
)
p_data
[
3
]
<<
8
)
|
(
uint64_t
)
p_data
[
4
]);
}
p_cmd
->
p_splice_time
=
calloc
(
1
,
sizeof
(
dvbpsi_sis_splice_time_t
));
if
(
p_cmd
->
p_splice_time
==
NULL
)
{
cmd_time_signal_cleanup
(
p_cmd
);
return
NULL
;
}
p_cmd
->
p_splice_time
->
b_time_specified_flag
=
b_time_specified
;
p_cmd
->
p_splice_time
->
i_pts_time
=
i_pts_time
;
p_cmd
->
p_splice_time
->
p_next
=
NULL
;
return
p_cmd
;
}
/*****************************************************************************
* dvbpsi_sis_sections_decode
*****************************************************************************
...
...
@@ -745,6 +859,13 @@ void dvbpsi_sis_sections_decode(dvbpsi_t* p_dvbpsi, dvbpsi_sis_t* p_sis,
"splice insert command is invalid"
);
break
;
case
0x06
:
/* time_signal */
p_sis
->
p_splice_command
=
dvbpsi_sis_cmd_time_signal_decode
(
&
p_byte
[
14
],
p_sis
->
i_splice_command_length
);
if
(
!
p_sis
->
p_splice_command
)
dvbpsi_error
(
p_dvbpsi
,
"SIS decoder"
,
"time_signal command is invalid"
);
break
;
case
0x07
:
/* bandwidth_reservation */
break
;
default:
...
...
src/tables/sis.h
View file @
1bb2efe0
...
...
@@ -72,6 +72,8 @@ typedef struct dvbpsi_sis_s
uint64_t
i_pts_adjustment
;
/*!< PTS offset */
uint8_t
cw_index
;
/*!< CA control word */
uint16_t
i_tier
;
/*!< authorization tiers */
/* splice command */
uint16_t
i_splice_command_length
;
/*!< Length of splice command */
uint8_t
i_splice_command_type
;
/*!< Splice command type */
...
...
src/tables/sis_private.h
View file @
1bb2efe0
...
...
@@ -59,6 +59,27 @@ void dvbpsi_sis_sections_gather(dvbpsi_t* p_dvbpsi, dvbpsi_psi_section_t* p_sect
void
dvbpsi_sis_sections_decode
(
dvbpsi_t
*
p_dvbpsi
,
dvbpsi_sis_t
*
p_sis
,
dvbpsi_psi_section_t
*
p_section
);
/*****************************************************************************
* cmd_splice_schedule_cleanup
*****************************************************************************
* Free resource for splice_schedule command structure.
*****************************************************************************/
static
void
cmd_splice_schedule_cleanup
(
dvbpsi_sis_cmd_splice_schedule_t
*
p_cmd
);
/*****************************************************************************
* cmd_splice_insert_cleanup
*****************************************************************************
* Free resource for splice_insert command structure.
*****************************************************************************/
static
void
cmd_splice_insert_cleanup
(
dvbpsi_sis_cmd_splice_insert_t
*
p_cmd
);
/*****************************************************************************
* cmd_time_signal_cleanup
*****************************************************************************
* Free resource for time_signal command structure.
*****************************************************************************/
static
void
cmd_time_signal_cleanup
(
dvbpsi_sis_cmd_time_signal_t
*
p_cmd
);
#else
#error "Multiple inclusions of sis_private.h"
#endif
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