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
81d3a7c9
Commit
81d3a7c9
authored
Jun 24, 2011
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/tables/pmt.*: Make dvbpsi_NewPMT() and dvbpsi_DeletePMT() functions.
parent
774d741b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
18 deletions
+37
-18
src/tables/pmt.c
src/tables/pmt.c
+29
-0
src/tables/pmt.h
src/tables/pmt.h
+8
-18
No files found.
src/tables/pmt.c
View file @
81d3a7c9
...
@@ -112,6 +112,8 @@ void dvbpsi_DetachPMT(dvbpsi_t *p_dvbpsi)
...
@@ -112,6 +112,8 @@ void dvbpsi_DetachPMT(dvbpsi_t *p_dvbpsi)
void
dvbpsi_InitPMT
(
dvbpsi_pmt_t
*
p_pmt
,
uint16_t
i_program_number
,
void
dvbpsi_InitPMT
(
dvbpsi_pmt_t
*
p_pmt
,
uint16_t
i_program_number
,
uint8_t
i_version
,
bool
b_current_next
,
uint16_t
i_pcr_pid
)
uint8_t
i_version
,
bool
b_current_next
,
uint16_t
i_pcr_pid
)
{
{
assert
(
p_pmt
);
p_pmt
->
i_program_number
=
i_program_number
;
p_pmt
->
i_program_number
=
i_program_number
;
p_pmt
->
i_version
=
i_version
;
p_pmt
->
i_version
=
i_version
;
p_pmt
->
b_current_next
=
b_current_next
;
p_pmt
->
b_current_next
=
b_current_next
;
...
@@ -120,6 +122,21 @@ void dvbpsi_InitPMT(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number,
...
@@ -120,6 +122,21 @@ void dvbpsi_InitPMT(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number,
p_pmt
->
p_first_es
=
NULL
;
p_pmt
->
p_first_es
=
NULL
;
}
}
/*****************************************************************************
* dvbpsi_NewPMT
*****************************************************************************
* Allocate and Initialize a new dvbpsi_pmt_t structure.
*****************************************************************************/
dvbpsi_pmt_t
*
dvbpsi_NewPMT
(
uint16_t
i_program_number
,
uint8_t
i_version
,
bool
b_current_next
,
uint16_t
i_pcr_pid
)
{
dvbpsi_pmt_t
*
p_pmt
=
(
dvbpsi_pmt_t
*
)
malloc
(
sizeof
(
dvbpsi_pmt_t
));
if
(
p_pmt
!=
NULL
)
dvbpsi_InitPMT
(
p_pmt
,
i_program_number
,
i_version
,
b_current_next
,
i_pcr_pid
);
return
p_pmt
;
}
/*****************************************************************************
/*****************************************************************************
* dvbpsi_EmptyPMT
* dvbpsi_EmptyPMT
*****************************************************************************
*****************************************************************************
...
@@ -143,6 +160,18 @@ void dvbpsi_EmptyPMT(dvbpsi_pmt_t* p_pmt)
...
@@ -143,6 +160,18 @@ void dvbpsi_EmptyPMT(dvbpsi_pmt_t* p_pmt)
p_pmt
->
p_first_es
=
NULL
;
p_pmt
->
p_first_es
=
NULL
;
}
}
/*****************************************************************************
* dvbpsi_DeletePMT
*****************************************************************************
* Clean a dvbpsi_pmt_t structure.
*****************************************************************************/
void
dvbpsi_DeletePMT
(
dvbpsi_pmt_t
*
p_pmt
)
{
if
(
p_pmt
)
dvbpsi_EmptyPMT
(
p_pmt
);
free
(
p_pmt
);
}
/*****************************************************************************
/*****************************************************************************
* dvbpsi_PMTAddDescriptor
* dvbpsi_PMTAddDescriptor
*****************************************************************************
*****************************************************************************
...
...
src/tables/pmt.h
View file @
81d3a7c9
...
@@ -153,24 +153,18 @@ void dvbpsi_InitPMT(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number,
...
@@ -153,24 +153,18 @@ void dvbpsi_InitPMT(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number,
uint8_t
i_version
,
bool
b_current_next
,
uint16_t
i_pcr_pid
);
uint8_t
i_version
,
bool
b_current_next
,
uint16_t
i_pcr_pid
);
/*!
/*!
* \def dvbpsi_NewPMT(p_pmt, i_program_number,
* \fn dvbpsi_pmt_t* dvbpsi_NewPMT(uint16_t i_program_number,
i_version, b_current_next, i_pcr_pid)
uint8_t i_version, bool b_current_next,
uint16_t i_pcr_pid)
* \brief Allocate and initialize a new dvbpsi_pmt_t structure.
* \brief Allocate and initialize a new dvbpsi_pmt_t structure.
* \param p_pmt pointer to the PMT structure
* \param i_program_number program number
* \param i_program_number program number
* \param i_version PMT version
* \param i_version PMT version
* \param b_current_next current next indicator
* \param b_current_next current next indicator
* \param i_pcr_pid PCR_PID
* \param i_pcr_pid PCR_PID
* \return
nothing.
* \return
p_pmt pointer to the PMT structure
*/
*/
#define dvbpsi_NewPMT(p_pmt, i_program_number, \
dvbpsi_pmt_t
*
dvbpsi_NewPMT
(
uint16_t
i_program_number
,
uint8_t
i_version
,
i_version, b_current_next, i_pcr_pid) \
bool
b_current_next
,
uint16_t
i_pcr_pid
);
do { \
p_pmt = (dvbpsi_pmt_t*)malloc(sizeof(dvbpsi_pmt_t)); \
if(p_pmt != NULL) \
dvbpsi_InitPMT(p_pmt, i_program_number, i_version, b_current_next, \
i_pcr_pid); \
} while(0);
/*****************************************************************************
/*****************************************************************************
* dvbpsi_EmptyPMT/dvbpsi_DeletePMT
* dvbpsi_EmptyPMT/dvbpsi_DeletePMT
...
@@ -184,16 +178,12 @@ do { \
...
@@ -184,16 +178,12 @@ do { \
void
dvbpsi_EmptyPMT
(
dvbpsi_pmt_t
*
p_pmt
);
void
dvbpsi_EmptyPMT
(
dvbpsi_pmt_t
*
p_pmt
);
/*!
/*!
* \
def dvbpsi_DeletePMT(
p_pmt)
* \
fn void dvbpsi_DeletePMT(dvbpsi_pmt_t*
p_pmt)
* \brief Clean and free a dvbpsi_pmt_t structure.
* \brief Clean and free a dvbpsi_pmt_t structure.
* \param p_pmt pointer to the PMT structure
* \param p_pmt pointer to the PMT structure
* \return nothing.
* \return nothing.
*/
*/
#define dvbpsi_DeletePMT(p_pmt) \
void
dvbpsi_DeletePMT
(
dvbpsi_pmt_t
*
p_pmt
);
do { \
dvbpsi_EmptyPMT(p_pmt); \
free(p_pmt); \
} while(0);
/*****************************************************************************
/*****************************************************************************
* dvbpsi_PMTAddDescriptor
* dvbpsi_PMTAddDescriptor
...
...
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