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
e8dfd3f1
Commit
e8dfd3f1
authored
Dec 10, 2015
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATSC VCT: Rename API's
parent
911ec44e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
38 deletions
+129
-38
examples/dvbinfo/libdvbpsi.c
examples/dvbinfo/libdvbpsi.c
+3
-3
src/tables/atsc_vct.c
src/tables/atsc_vct.c
+17
-17
src/tables/atsc_vct.h
src/tables/atsc_vct.h
+109
-18
No files found.
examples/dvbinfo/libdvbpsi.c
View file @
e8dfd3f1
...
...
@@ -694,7 +694,7 @@ static void handle_subtable(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_e
break
;
case
0xC8
:
case
0xC9
:
/* ATSC VCT */
if
(
!
dvbpsi_atsc_
AttachVCT
(
p_dvbpsi
,
i_table_id
,
i_extension
,
handle_atsc_VCT
,
p_data
))
if
(
!
dvbpsi_atsc_
vct_attach
(
p_dvbpsi
,
i_table_id
,
i_extension
,
handle_atsc_VCT
,
p_data
))
fprintf
(
stderr
,
"dvbinfo: Failed to attach ATSC VCT subdecoder
\n
"
);
break
;
case
0xCB
:
/* ATSC EIT */
...
...
@@ -2056,7 +2056,7 @@ static void handle_atsc_VCT(void* p_data, dvbpsi_atsc_vct_t *p_vct)
DumpAtscVCTChannels
(
p_vct
->
p_first_channel
);
DumpDescriptors
(
"
\t
| ]"
,
p_vct
->
p_first_descriptor
);
dvbpsi_atsc_
DeleteVCT
(
p_vct
);
dvbpsi_atsc_
vct_delete
(
p_vct
);
}
static
void
DumpATSCEITEventDescriptors
(
dvbpsi_atsc_eit_event_t
*
p_atsc_eit_event
)
...
...
@@ -2374,7 +2374,7 @@ static void DeleteTableDecoder(dvbpsi_t *p_dvbpsi, uint8_t i_table, uint16_t i_e
/* Handle ATSC PSI tables */
case
0xC7
:
dvbpsi_atsc_mgt_detach
(
p_dvbpsi
,
i_table
,
i_extension
);
break
;
/* ATSC MGT */
case
0xC8
:
/* ATSC VCT */
case
0xC9
:
dvbpsi_atsc_
DetachVCT
(
p_dvbpsi
,
i_table
,
i_extension
);
break
;
/* ATSC VCT */
case
0xC9
:
dvbpsi_atsc_
vct_detach
(
p_dvbpsi
,
i_table
,
i_extension
);
break
;
/* ATSC VCT */
case
0xCB
:
dvbpsi_atsc_eit_detach
(
p_dvbpsi
,
i_table
,
i_extension
);
break
;
/* ATSC EIT */
case
0xCC
:
dvbpsi_atsc_ett_detach
(
p_dvbpsi
,
i_table
,
i_extension
);
break
;
/* ATSC ETT */
case
0xCD
:
dvbpsi_atsc_stt_detach
(
p_dvbpsi
,
i_table
,
i_extension
);
break
;
/* ATSC STT */
...
...
src/tables/atsc_vct.c
View file @
e8dfd3f1
...
...
@@ -88,11 +88,11 @@ static void dvbpsi_atsc_DecodeVCTSections(dvbpsi_atsc_vct_t* p_vct,
dvbpsi_psi_section_t
*
p_section
);
/*****************************************************************************
* dvbpsi_atsc_
AttachVCT
* dvbpsi_atsc_
vct_attach
*****************************************************************************
* Initialize a VCT subtable decoder.
*****************************************************************************/
bool
dvbpsi_atsc_
AttachVCT
(
dvbpsi_t
*
p_dvbpsi
,
uint8_t
i_table_id
,
uint16_t
i_extension
,
bool
dvbpsi_atsc_
vct_attach
(
dvbpsi_t
*
p_dvbpsi
,
uint8_t
i_table_id
,
uint16_t
i_extension
,
dvbpsi_atsc_vct_callback
pf_vct_callback
,
void
*
p_cb_data
)
{
assert
(
p_dvbpsi
);
...
...
@@ -132,11 +132,11 @@ bool dvbpsi_atsc_AttachVCT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
}
/*****************************************************************************
* dvbpsi_atsc_
DetachVCT
* dvbpsi_atsc_
vct_detach
*****************************************************************************
* Close a VCT decoder.
*****************************************************************************/
void
dvbpsi_atsc_
DetachVCT
(
dvbpsi_t
*
p_dvbpsi
,
uint8_t
i_table_id
,
uint16_t
i_extension
)
void
dvbpsi_atsc_
vct_detach
(
dvbpsi_t
*
p_dvbpsi
,
uint8_t
i_table_id
,
uint16_t
i_extension
)
{
assert
(
p_dvbpsi
);
...
...
@@ -162,33 +162,33 @@ void dvbpsi_atsc_DetachVCT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
dvbpsi_atsc_vct_decoder_t
*
p_vct_decoder
=
(
dvbpsi_atsc_vct_decoder_t
*
)
p_dec
;
if
(
p_vct_decoder
->
p_building_vct
)
dvbpsi_atsc_
DeleteVCT
(
p_vct_decoder
->
p_building_vct
);
dvbpsi_atsc_
vct_delete
(
p_vct_decoder
->
p_building_vct
);
p_vct_decoder
->
p_building_vct
=
NULL
;
dvbpsi_decoder_delete
(
p_dec
);
p_dec
=
NULL
;
}
/*****************************************************************************
* dvbpsi_atsc_
NewVCT
* dvbpsi_atsc_
vct_new
*****************************************************************************
* Allocate a new dvbpsi_atsc_vct_t structure and initialize it.
*****************************************************************************/
dvbpsi_atsc_vct_t
*
dvbpsi_atsc_
NewVCT
(
uint8_t
i_table_id
,
uint16_t
i_extension
,
dvbpsi_atsc_vct_t
*
dvbpsi_atsc_
vct_new
(
uint8_t
i_table_id
,
uint16_t
i_extension
,
uint8_t
i_protocol
,
bool
b_cable_vct
,
uint8_t
i_version
,
bool
b_current_next
)
{
dvbpsi_atsc_vct_t
*
p_vct
=
(
dvbpsi_atsc_vct_t
*
)
malloc
(
sizeof
(
dvbpsi_atsc_vct_t
));
if
(
p_vct
!=
NULL
)
dvbpsi_atsc_
InitVCT
(
p_vct
,
i_table_id
,
i_extension
,
i_protocol
,
dvbpsi_atsc_
vct_init
(
p_vct
,
i_table_id
,
i_extension
,
i_protocol
,
b_cable_vct
,
i_version
,
b_current_next
);
return
p_vct
;
}
/*****************************************************************************
* dvbpsi_atsc_
InitVCT
* dvbpsi_atsc_
vct_init
*****************************************************************************
* Initialize a pre-allocated dvbpsi_atsc_vct_t structure.
*****************************************************************************/
void
dvbpsi_atsc_
InitVCT
(
dvbpsi_atsc_vct_t
*
p_vct
,
uint8_t
i_table_id
,
void
dvbpsi_atsc_
vct_init
(
dvbpsi_atsc_vct_t
*
p_vct
,
uint8_t
i_table_id
,
uint16_t
i_extension
,
uint8_t
i_protocol
,
bool
b_cable_vct
,
uint8_t
i_version
,
bool
b_current_next
)
{
...
...
@@ -205,11 +205,11 @@ void dvbpsi_atsc_InitVCT(dvbpsi_atsc_vct_t* p_vct, uint8_t i_table_id,
}
/*****************************************************************************
* dvbpsi_atsc_
EmptyVCT
* dvbpsi_atsc_
vct_empty
*****************************************************************************
* Clean a dvbpsi_atsc_vct_t structure.
*****************************************************************************/
void
dvbpsi_atsc_
EmptyVCT
(
dvbpsi_atsc_vct_t
*
p_vct
)
void
dvbpsi_atsc_
vct_empty
(
dvbpsi_atsc_vct_t
*
p_vct
)
{
dvbpsi_atsc_vct_channel_t
*
p_channel
=
p_vct
->
p_first_channel
;
dvbpsi_DeleteDescriptors
(
p_vct
->
p_first_descriptor
);
...
...
@@ -226,14 +226,14 @@ void dvbpsi_atsc_EmptyVCT(dvbpsi_atsc_vct_t* p_vct)
}
/*****************************************************************************
* dvbpsi_atsc_
DeleteVCT
* dvbpsi_atsc_
vct_delete
*****************************************************************************
* Empty and Delere a dvbpsi_atsc_vct_t structure.
*****************************************************************************/
void
dvbpsi_atsc_
DeleteVCT
(
dvbpsi_atsc_vct_t
*
p_vct
)
void
dvbpsi_atsc_
vct_delete
(
dvbpsi_atsc_vct_t
*
p_vct
)
{
if
(
p_vct
)
dvbpsi_atsc_
EmptyVCT
(
p_vct
);
dvbpsi_atsc_
vct_empty
(
p_vct
);
free
(
p_vct
);
}
...
...
@@ -365,7 +365,7 @@ static void dvbpsi_ReInitVCT(dvbpsi_atsc_vct_decoder_t *p_decoder, const bool b_
{
/* Free structures */
if
(
p_decoder
->
p_building_vct
)
dvbpsi_atsc_
DeleteVCT
(
p_decoder
->
p_building_vct
);
dvbpsi_atsc_
vct_delete
(
p_decoder
->
p_building_vct
);
}
p_decoder
->
p_building_vct
=
NULL
;
}
...
...
@@ -416,7 +416,7 @@ static bool dvbpsi_AddSectionVCT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_vct_decoder_t *
/* Initialize the structures if it's the first section received */
if
(
!
p_vct_decoder
->
p_building_vct
)
{
p_vct_decoder
->
p_building_vct
=
dvbpsi_atsc_
NewVCT
(
p_vct_decoder
->
p_building_vct
=
dvbpsi_atsc_
vct_new
(
p_section
->
i_table_id
,
p_section
->
i_extension
,
p_section
->
p_payload_start
[
0
],
p_section
->
i_table_id
==
0xC9
,
p_section
->
i_version
,
p_section
->
b_current_next
);
...
...
src/tables/atsc_vct.h
View file @
e8dfd3f1
...
...
@@ -112,10 +112,10 @@ typedef struct dvbpsi_atsc_vct_s
typedef
void
(
*
dvbpsi_atsc_vct_callback
)(
void
*
p_cb_data
,
dvbpsi_atsc_vct_t
*
p_new_vct
);
/*****************************************************************************
* dvbpsi_atsc_
AttachVCT
* dvbpsi_atsc_
vct_attach
*****************************************************************************/
/*!
* \fn bool dvbpsi_atsc_
AttachVCT
(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \fn bool dvbpsi_atsc_
vct_attach
(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_atsc_vct_callback pf_vct_callback,
void* p_cb_data)
* \brief Creation and initialization of a VCT decoder.
...
...
@@ -126,15 +126,33 @@ typedef void (* dvbpsi_atsc_vct_callback)(void* p_cb_data, dvbpsi_atsc_vct_t* p_
* \param p_cb_data private data given in argument to the callback.
* \return true if everything went ok, else false.
*/
bool
dvbpsi_atsc_
AttachVCT
(
dvbpsi_t
*
p_dvbpsi
,
uint8_t
i_table_id
,
bool
dvbpsi_atsc_
vct_attach
(
dvbpsi_t
*
p_dvbpsi
,
uint8_t
i_table_id
,
uint16_t
i_extension
,
dvbpsi_atsc_vct_callback
pf_vct_callback
,
void
*
p_cb_data
);
/*!
* \brief dvbpsi_atsc_AttachVCT is deprecated use @see dvbpsi_atsc_vct_attach() instead.
* \param p_dvbpsi dvbpsi handle to Subtable demultiplexor to which the decoder is attached.
* \param i_table_id Table ID, 0xC8 or 0xC9.
* \param i_extension Table ID extension, here TS ID.
* \param pf_vct_callback function to call back on new VCT.
* \param p_cb_data private data given in argument to the callback.
* \return true if everything went ok, else false.
*/
__attribute__
((
deprecated
,
unused
))
inline
bool
dvbpsi_atsc_AttachVCT
(
dvbpsi_t
*
p_dvbpsi
,
uint8_t
i_table_id
,
uint16_t
i_extension
,
dvbpsi_atsc_vct_callback
pf_vct_callback
,
void
*
p_cb_data
)
{
return
dvbpsi_atsc_vct_attach
(
p_dvbpsi
,
i_table_id
,
i_extension
,
pf_vct_callback
,
p_cb_data
);
}
/*****************************************************************************
* dvbpsi_
DetachVCT
* dvbpsi_
atsc_vct_detach
*****************************************************************************/
/*!
* \fn void dvbpsi_atsc_
DetachVCT
(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \fn void dvbpsi_atsc_
vct_detach
(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* uint16_t i_extension)
*
* \brief Destroy a VCT decoder.
...
...
@@ -143,13 +161,26 @@ bool dvbpsi_atsc_AttachVCT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \param i_extension Table ID extension, here TS ID.
* \return nothing.
*/
void
dvbpsi_atsc_DetachVCT
(
dvbpsi_t
*
p_dvbpsi
,
uint8_t
i_table_id
,
uint16_t
i_extension
);
void
dvbpsi_atsc_vct_detach
(
dvbpsi_t
*
p_dvbpsi
,
uint8_t
i_table_id
,
uint16_t
i_extension
);
/*!
* \brief dvbpsi_atsc_DetachVCT is deprecated use @see dvbpsi_atsc_vct_detach() instead.
* \param p_dvbpsi dvbpsi handle to Subtable demultiplexor to which the decoder is attached.
* \param i_table_id Table ID, 0xC8 or 0xC9.
* \param i_extension Table ID extension, here TS ID.
* \return nothing.
*/
__attribute__
((
deprecated
,
unused
))
inline
void
dvbpsi_atsc_DetachVCT
(
dvbpsi_t
*
p_dvbpsi
,
uint8_t
i_table_id
,
uint16_t
i_extension
)
{
dvbpsi_atsc_vct_detach
(
p_dvbpsi
,
i_table_id
,
i_extension
);
}
/*****************************************************************************
* dvbpsi_atsc_
InitVCT
* dvbpsi_atsc_
vct_init
*****************************************************************************/
/*!
* \fn void dvbpsi_atsc_
InitVCT
(dvbpsi_atsc_vct_t* p_vct, uint8_t i_table_id,
* \fn void dvbpsi_atsc_
vct_init
(dvbpsi_atsc_vct_t* p_vct, uint8_t i_table_id,
uint16_t i_extension, uint8_t i_protocol, bool b_cable_vct,
uint8_t i_version, bool b_current_next)
* \brief Initialize a user-allocated dvbpsi_atsc_vct_t structure.
...
...
@@ -162,15 +193,34 @@ void dvbpsi_atsc_DetachVCT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
* \param b_current_next current next indicator
* \return nothing.
*/
void
dvbpsi_atsc_
InitVCT
(
dvbpsi_atsc_vct_t
*
p_vct
,
uint8_t
i_table_id
,
void
dvbpsi_atsc_
vct_init
(
dvbpsi_atsc_vct_t
*
p_vct
,
uint8_t
i_table_id
,
uint16_t
i_extension
,
uint8_t
i_protocol
,
bool
b_cable_vct
,
uint8_t
i_version
,
bool
b_current_next
);
/*!
* \brief dvbpsi_atsc_InitVCT is deprecated use @see dvbpsi_atsc_vct_init() instead.
* \param i_table_id Table ID, 0xC8 or 0xC9.
* \param i_extension Table ID extension, here TS ID.
* \param i_protocol PSIP Protocol version.
* \param b_cable_vct Whether this is CVCT or a TVCT.
* \param i_version VCT version
* \param b_current_next current next indicator
* \return nothing.
*/
__attribute__
((
deprecated
,
unused
))
inline
void
dvbpsi_atsc_InitVCT
(
dvbpsi_atsc_vct_t
*
p_vct
,
uint8_t
i_table_id
,
uint16_t
i_extension
,
uint8_t
i_protocol
,
bool
b_cable_vct
,
uint8_t
i_version
,
bool
b_current_next
)
{
dvbpsi_atsc_vct_init
(
p_vct
,
i_table_id
,
i_extension
,
i_protocol
,
b_cable_vct
,
i_version
,
b_current_next
);
}
/*****************************************************************************
* dvbpsi_atsc_
NewVCT
* dvbpsi_atsc_
vct_new
*****************************************************************************/
/*!
* \fn dvbpsi_atsc_vct_t *dvbpsi_atsc_
NewVCT
(uint8_t i_table_id, uint16_t i_extension,
* \fn dvbpsi_atsc_vct_t *dvbpsi_atsc_
vct_new
(uint8_t i_table_id, uint16_t i_extension,
* uint8_t i_protocol, bool b_cable_vct, uint8_t i_version, bool b_current_next);
*
* \brief Allocate and initialize a new dvbpsi_vct_t structure.
...
...
@@ -182,32 +232,73 @@ void dvbpsi_atsc_InitVCT(dvbpsi_atsc_vct_t* p_vct, uint8_t i_table_id,
* \param b_current_next current next indicator
* \return p_vct pointer to the VCT structure
*/
dvbpsi_atsc_vct_t
*
dvbpsi_atsc_
NewVCT
(
uint8_t
i_table_id
,
uint16_t
i_extension
,
dvbpsi_atsc_vct_t
*
dvbpsi_atsc_
vct_new
(
uint8_t
i_table_id
,
uint16_t
i_extension
,
uint8_t
i_protocol
,
bool
b_cable_vct
,
uint8_t
i_version
,
bool
b_current_next
);
/*!
* \brief dvbpsi_atsc_NewVCT is deprecated use @see dvbpsi_atsc_vct_new() instead.
* \param i_table_id Table ID, 0xC8 or 0xC9.
* \param i_extension Table ID extension, here TS ID.
* \param i_protocol PSIP Protocol version.
* \param b_cable_vct Whether this is CVCT or a TVCT.
* \param i_version VCT version
* \param b_current_next current next indicator
* \return p_vct pointer to the VCT structure
*/
__attribute__
((
deprecated
,
unused
))
inline
dvbpsi_atsc_vct_t
*
dvbpsi_atsc_NewVCT
(
uint8_t
i_table_id
,
uint16_t
i_extension
,
uint8_t
i_protocol
,
bool
b_cable_vct
,
uint8_t
i_version
,
bool
b_current_next
)
{
return
dvbpsi_atsc_vct_new
(
i_table_id
,
i_extension
,
i_protocol
,
b_cable_vct
,
i_version
,
b_current_next
);
}
/*****************************************************************************
* dvbpsi_atsc_
EmptyVCT
* dvbpsi_atsc_
vct_empty
*****************************************************************************/
/*!
* \fn void dvbpsi_atsc_EmptyVCT(dvbpsi_atsc_vct_t* p_vct)
* \fn void dvbpsi_atsc_vct_empty(dvbpsi_atsc_vct_t* p_vct)
* \brief Clean a dvbpsi_vct_t structure.
* \param p_vct pointer to the VCT structure
* \return nothing.
*/
void
dvbpsi_atsc_vct_empty
(
dvbpsi_atsc_vct_t
*
p_vct
);
/*!
* \brief dvbpsi_atsc_EmptyVCT is deprecated use @see dvbpsi_atsc_vct_empty() instead.
* \brief Clean a dvbpsi_vct_t structure.
* \param p_vct pointer to the VCT structure
* \return nothing.
*/
void
dvbpsi_atsc_EmptyVCT
(
dvbpsi_atsc_vct_t
*
p_vct
);
__attribute__
((
deprecated
,
unused
))
inline
void
dvbpsi_atsc_EmptyVCT
(
dvbpsi_atsc_vct_t
*
p_vct
)
{
dvbpsi_atsc_vct_empty
(
p_vct
);
}
/*****************************************************************************
* dvbpsi_atsc_
DeleteVCT
* dvbpsi_atsc_
vct_delete
*****************************************************************************/
/*!
* \fn void dvbpsi_atsc_
DeleteVCT
(dvbpsi_atsc_vct_t *p_vct)
* \fn void dvbpsi_atsc_
vct_delete
(dvbpsi_atsc_vct_t *p_vct)
* \brief Clean and free a dvbpsi_vct_t structure.
* \param p_vct pointer to the VCT structure
* \return nothing.
*/
void
dvbpsi_atsc_
DeleteVCT
(
dvbpsi_atsc_vct_t
*
p_vct
);
void
dvbpsi_atsc_
vct_delete
(
dvbpsi_atsc_vct_t
*
p_vct
);
/*!
* \brief dvbpsi_atsc_DeleteVCT is deprecated use @see dvbpsi_atsc_vct_delete() instead.
* \brief Clean a dvbpsi_vct_t structure.
* \param p_vct pointer to the VCT structure
* \return nothing.
*/
__attribute__
((
deprecated
,
unused
))
inline
void
dvbpsi_atsc_DeleteVCT
(
dvbpsi_atsc_vct_t
*
p_vct
)
{
dvbpsi_atsc_vct_delete
(
p_vct
);
}
#ifdef __cplusplus
};
#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