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
1ac4cd61
Commit
1ac4cd61
authored
Nov 10, 2011
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/tables/nit.*: Make dvbpsi_NewNIT() and dvbpsi_DeleteNIT() functions.
parent
a2893188
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
18 deletions
+34
-18
src/tables/nit.c
src/tables/nit.c
+27
-1
src/tables/nit.h
src/tables/nit.h
+7
-17
No files found.
src/tables/nit.c
View file @
1ac4cd61
...
@@ -151,7 +151,7 @@ void dvbpsi_DetachNIT(dvbpsi_t * p_dvbpsi, uint8_t i_table_id,
...
@@ -151,7 +151,7 @@ void dvbpsi_DetachNIT(dvbpsi_t * p_dvbpsi, uint8_t i_table_id,
p_subdec
=
NULL
;
p_subdec
=
NULL
;
}
}
/****************************************************************************
*
/****************************************************************************
* dvbpsi_InitNIT
* dvbpsi_InitNIT
*****************************************************************************
*****************************************************************************
* Initialize a pre-allocated dvbpsi_nit_t structure.
* Initialize a pre-allocated dvbpsi_nit_t structure.
...
@@ -166,6 +166,20 @@ void dvbpsi_InitNIT(dvbpsi_nit_t* p_nit, uint16_t i_network_id,
...
@@ -166,6 +166,20 @@ void dvbpsi_InitNIT(dvbpsi_nit_t* p_nit, uint16_t i_network_id,
p_nit
->
p_first_ts
=
NULL
;
p_nit
->
p_first_ts
=
NULL
;
}
}
/****************************************************************************
* dvbpsi_NewNIT
*****************************************************************************
* Allocate and initialize a dvbpsi_nit_t structure.
*****************************************************************************/
dvbpsi_nit_t
*
dvbpsi_NewNIT
(
uint16_t
i_network_id
,
uint8_t
i_version
,
bool
b_current_next
)
{
dvbpsi_nit_t
*
p_nit
=
(
dvbpsi_nit_t
*
)
malloc
(
sizeof
(
dvbpsi_nit_t
));
if
(
p_nit
!=
NULL
)
dvbpsi_InitNIT
(
p_nit
,
i_network_id
,
i_version
,
b_current_next
);
return
p_nit
;
}
/*****************************************************************************
/*****************************************************************************
* dvbpsi_EmptyNIT
* dvbpsi_EmptyNIT
*****************************************************************************
*****************************************************************************
...
@@ -189,6 +203,18 @@ void dvbpsi_EmptyNIT(dvbpsi_nit_t* p_nit)
...
@@ -189,6 +203,18 @@ void dvbpsi_EmptyNIT(dvbpsi_nit_t* p_nit)
p_nit
->
p_first_ts
=
NULL
;
p_nit
->
p_first_ts
=
NULL
;
}
}
/****************************************************************************
* dvbpsi_DeleteNIT
*****************************************************************************
* Clean and delete a dvbpsi_nit_t structure.
*****************************************************************************/
void
dvbpsi_DeleteNIT
(
dvbpsi_nit_t
*
p_nit
)
{
if
(
p_nit
)
dvbpsi_EmptyNIT
(
p_nit
);
free
(
p_nit
);
}
/*****************************************************************************
/*****************************************************************************
* dvbpsi_NITAddDescriptor
* dvbpsi_NITAddDescriptor
*****************************************************************************
*****************************************************************************
...
...
src/tables/nit.h
View file @
1ac4cd61
...
@@ -153,22 +153,16 @@ void dvbpsi_InitNIT(dvbpsi_nit_t* p_nit, uint16_t i_network_id,
...
@@ -153,22 +153,16 @@ void dvbpsi_InitNIT(dvbpsi_nit_t* p_nit, uint16_t i_network_id,
uint8_t
i_version
,
bool
b_current_next
);
uint8_t
i_version
,
bool
b_current_next
);
/*!
/*!
* \
def dvbpsi_NewNIT(p_nit, i_network_id
,
* \
fn dvbpsi_nit_t *dvbpsi_NewNIT(uint16_t i_ts_id, uint8_t i_version
,
i_version, b_current_next)
* bool b_current_next);
* \brief Allocate and initialize a new dvbpsi_nit_t structure.
* \brief Allocate and initialize a new dvbpsi_nit_t structure.
* \param p_nit pointer to the NIT structure
* \param i_network_id network id
* \param i_network_id network id
* \param i_version NIT version
* \param i_version NIT version
* \param b_current_next current next indicator
* \param b_current_next current next indicator
* \return
nothing.
* \return
p_nit pointer to the NIT structure
*/
*/
#define dvbpsi_NewNIT(p_nit, i_network_id, \
dvbpsi_nit_t
*
dvbpsi_NewNIT
(
uint16_t
i_network_id
,
uint8_t
i_version
,
i_version, b_current_next) \
bool
b_current_next
);
do { \
p_nit = (dvbpsi_nit_t*)malloc(sizeof(dvbpsi_nit_t)); \
if(p_nit != NULL) \
dvbpsi_InitNIT(p_nit, i_network_id, i_version, b_current_next); \
} while(0);
/*****************************************************************************
/*****************************************************************************
* dvbpsi_EmptyNIT/dvbpsi_DeleteNIT
* dvbpsi_EmptyNIT/dvbpsi_DeleteNIT
...
@@ -182,16 +176,12 @@ do { \
...
@@ -182,16 +176,12 @@ do { \
void
dvbpsi_EmptyNIT
(
dvbpsi_nit_t
*
p_nit
);
void
dvbpsi_EmptyNIT
(
dvbpsi_nit_t
*
p_nit
);
/*!
/*!
* \
def dvbpsi_DeleteNIT(
p_nit)
* \
fn dvbpsi_DeleteNIT(dvbpsi_nit_t *
p_nit)
* \brief Clean and free a dvbpsi_nit_t structure.
* \brief Clean and free a dvbpsi_nit_t structure.
* \param p_nit pointer to the NIT structure
* \param p_nit pointer to the NIT structure
* \return nothing.
* \return nothing.
*/
*/
#define dvbpsi_DeleteNIT(p_nit) \
void
dvbpsi_DeleteNIT
(
dvbpsi_nit_t
*
p_nit
);
do { \
dvbpsi_EmptyNIT(p_nit); \
free(p_nit); \
} while(0);
/*****************************************************************************
/*****************************************************************************
* dvbpsi_NITAddDescriptor
* dvbpsi_NITAddDescriptor
...
...
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