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
98184467
Commit
98184467
authored
Jan 07, 2012
by
Michael Krufky
Committed by
Jean-Paul Saman
May 30, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix broken interfaces in ETT parser
Signed-off-by:
Michael Krufky
<
mkrufky@linuxtv.org
>
parent
5d461d8a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
28 deletions
+73
-28
src/tables/atsc_ett.c
src/tables/atsc_ett.c
+60
-24
src/tables/atsc_ett.h
src/tables/atsc_ett.h
+13
-4
No files found.
src/tables/atsc_ett.c
View file @
98184467
...
@@ -26,8 +26,10 @@ Decode PSIP Extended Text Table.
...
@@ -26,8 +26,10 @@ Decode PSIP Extended Text Table.
#include <string.h>
#include <string.h>
#include "dvbpsi.h"
#include "dvbpsi.h"
#include "dvbpsi_private.h"
#include "psi.h"
#include "psi.h"
#include "descriptor.h"
#include "descriptor.h"
#include "demux.h"
#include "atsc_ett.h"
#include "atsc_ett.h"
/*****************************************************************************
/*****************************************************************************
...
@@ -60,7 +62,8 @@ typedef struct dvbpsi_atsc_ett_decoder_s
...
@@ -60,7 +62,8 @@ typedef struct dvbpsi_atsc_ett_decoder_s
*****************************************************************************
*****************************************************************************
* Callback for the PSI decoder.
* Callback for the PSI decoder.
*****************************************************************************/
*****************************************************************************/
void
dvbpsi_atsc_GatherETTSections
(
dvbpsi_decoder_t
*
p_decoder
,
void
dvbpsi_atsc_GatherETTSections
(
dvbpsi_decoder_t
*
p_psi_decoder
,
void
*
p_private_decoder
,
dvbpsi_psi_section_t
*
p_section
);
dvbpsi_psi_section_t
*
p_section
);
/*****************************************************************************
/*****************************************************************************
* dvbpsi_atsc_DecodeETTSection
* dvbpsi_atsc_DecodeETTSection
...
@@ -75,37 +78,52 @@ void dvbpsi_atsc_DecodeETTSection(dvbpsi_atsc_ett_t* p_ett,
...
@@ -75,37 +78,52 @@ void dvbpsi_atsc_DecodeETTSection(dvbpsi_atsc_ett_t* p_ett,
*****************************************************************************
*****************************************************************************
* Initialize a ETT decoder and return a handle on it.
* Initialize a ETT decoder and return a handle on it.
*****************************************************************************/
*****************************************************************************/
dvbpsi_handle
dvbpsi_atsc_AttachETT
(
dvbpsi_atsc_ett_callback
pf_callback
,
void
*
p_cb_data
)
int
dvbpsi_atsc_AttachETT
(
dvbpsi_decoder_t
*
p_psi_decoder
,
uint8_t
i_table_id
,
uint16_t
i_extension
,
dvbpsi_atsc_ett_callback
pf_callback
,
void
*
p_cb_data
)
{
{
dvbpsi_handle
h_dvbpsi
=
(
dvbpsi_decoder_t
*
)
malloc
(
sizeof
(
dvbpsi_decoder_t
));
dvbpsi_demux_t
*
p_demux
=
(
dvbpsi_demux_t
*
)
p_psi_decoder
->
p_private_decoder
;
dvbpsi_demux_subdec_t
*
p_subdec
;
dvbpsi_atsc_ett_decoder_t
*
p_ett_decoder
;
dvbpsi_atsc_ett_decoder_t
*
p_ett_decoder
;
if
(
h_dvbpsi
==
NULL
)
if
(
dvbpsi_demuxGetSubDec
(
p_demux
,
i_table_id
,
i_extension
))
return
NULL
;
{
DVBPSI_ERROR_ARG
(
"ETT decoder"
,
"Already a decoder for (table_id == 0x%02x extension == 0x%04x)"
,
i_table_id
,
i_extension
);
return
1
;
}
p_subdec
=
(
dvbpsi_demux_subdec_t
*
)
malloc
(
sizeof
(
dvbpsi_demux_subdec_t
));
if
(
p_subdec
==
NULL
)
{
return
1
;
}
p_ett_decoder
=
(
dvbpsi_atsc_ett_decoder_t
*
)
malloc
(
sizeof
(
dvbpsi_atsc_ett_decoder_t
));
p_ett_decoder
=
(
dvbpsi_atsc_ett_decoder_t
*
)
malloc
(
sizeof
(
dvbpsi_atsc_ett_decoder_t
));
if
(
p_ett_decoder
==
NULL
)
if
(
p_ett_decoder
==
NULL
)
{
{
free
(
h_dvbpsi
);
free
(
p_subdec
);
return
NULL
;
return
1
;
}
}
/* PSI decoder configuration */
/* PSI decoder configuration */
h_dvbpsi
->
pf_callback
=
&
dvbpsi_atsc_GatherETTSections
;
p_subdec
->
pf_callback
=
&
dvbpsi_atsc_GatherETTSections
;
h_dvbpsi
->
p_private_decoder
=
p_ett_decoder
;
p_subdec
->
p_cb_data
=
p_ett_decoder
;
h_dvbpsi
->
i_section_max_size
=
4096
;
p_subdec
->
i_id
=
((
uint32_t
)
i_table_id
<<
16
)
|
i_extension
;
/* PSI decoder initial state */
p_subdec
->
pf_detach
=
dvbpsi_atsc_DetachETT
;
h_dvbpsi
->
i_continuity_counter
=
31
;
h_dvbpsi
->
b_discontinuity
=
1
;
/* Attach the subtable decoder to the demux */
h_dvbpsi
->
p_current_section
=
NULL
;
p_subdec
->
p_next
=
p_demux
->
p_first_subdec
;
p_demux
->
p_first_subdec
=
p_subdec
;
/* ETT decoder information */
/* ETT decoder information */
p_ett_decoder
->
pf_callback
=
pf_callback
;
p_ett_decoder
->
pf_callback
=
pf_callback
;
p_ett_decoder
->
p_cb_data
=
p_cb_data
;
p_ett_decoder
->
p_cb_data
=
p_cb_data
;
p_ett_decoder
->
p_etm_versions
=
NULL
;
p_ett_decoder
->
p_etm_versions
=
NULL
;
return
h_dvbpsi
;
return
0
;
}
}
...
@@ -114,10 +132,23 @@ dvbpsi_handle dvbpsi_atsc_AttachETT(dvbpsi_atsc_ett_callback pf_callback, void*
...
@@ -114,10 +132,23 @@ dvbpsi_handle dvbpsi_atsc_AttachETT(dvbpsi_atsc_ett_callback pf_callback, void*
*****************************************************************************
*****************************************************************************
* Close a ETT decoder. The handle isn't valid any more.
* Close a ETT decoder. The handle isn't valid any more.
*****************************************************************************/
*****************************************************************************/
void
dvbpsi_atsc_DetachETT
(
dvbpsi_
handle
h_dvbpsi
)
void
dvbpsi_atsc_DetachETT
(
dvbpsi_
demux_t
*
p_demux
,
uint8_t
i_table_id
,
uint16_t
i_extension
)
{
{
dvbpsi_atsc_ett_decoder_t
*
p_ett_decoder
dvbpsi_demux_subdec_t
*
p_subdec
;
=
(
dvbpsi_atsc_ett_decoder_t
*
)
h_dvbpsi
->
p_private_decoder
;
dvbpsi_demux_subdec_t
**
pp_prev_subdec
;
dvbpsi_atsc_ett_decoder_t
*
p_ett_decoder
;
p_subdec
=
dvbpsi_demuxGetSubDec
(
p_demux
,
i_table_id
,
i_extension
);
if
(
p_demux
==
NULL
)
{
DVBPSI_ERROR_ARG
(
"ETT Decoder"
,
"No such ETT decoder (table_id == 0x%02x,"
"extension == 0x%04x)"
,
i_table_id
,
i_extension
);
return
;
}
p_ett_decoder
=
(
dvbpsi_atsc_ett_decoder_t
*
)
p_subdec
->
p_cb_data
;
dvbpsi_atsc_ett_etm_version_t
*
p_etm_version
,
*
p_next
;
dvbpsi_atsc_ett_etm_version_t
*
p_etm_version
,
*
p_next
;
for
(
p_etm_version
=
p_ett_decoder
->
p_etm_versions
;
p_etm_version
;
p_etm_version
=
p_next
)
for
(
p_etm_version
=
p_ett_decoder
->
p_etm_versions
;
p_etm_version
;
p_etm_version
=
p_next
)
{
{
...
@@ -125,10 +156,14 @@ void dvbpsi_atsc_DetachETT(dvbpsi_handle h_dvbpsi)
...
@@ -125,10 +156,14 @@ void dvbpsi_atsc_DetachETT(dvbpsi_handle h_dvbpsi)
free
(
p_etm_version
);
free
(
p_etm_version
);
}
}
free
(
h_dvbpsi
->
p_private_decoder
);
free
(
p_subdec
->
p_cb_data
);
if
(
h_dvbpsi
->
p_current_section
)
dvbpsi_DeletePSISections
(
h_dvbpsi
->
p_current_section
);
pp_prev_subdec
=
&
p_demux
->
p_first_subdec
;
free
(
h_dvbpsi
);
while
(
*
pp_prev_subdec
!=
p_subdec
)
pp_prev_subdec
=
&
(
*
pp_prev_subdec
)
->
p_next
;
*
pp_prev_subdec
=
p_subdec
->
p_next
;
free
(
p_subdec
);
}
}
...
@@ -178,11 +213,12 @@ void dvbpsi_atsc_EmptyETT(dvbpsi_atsc_ett_t *p_ett)
...
@@ -178,11 +213,12 @@ void dvbpsi_atsc_EmptyETT(dvbpsi_atsc_ett_t *p_ett)
*****************************************************************************
*****************************************************************************
* Callback for the PSI decoder.
* Callback for the PSI decoder.
*****************************************************************************/
*****************************************************************************/
void
dvbpsi_atsc_GatherETTSections
(
dvbpsi_decoder_t
*
p_decoder
,
void
dvbpsi_atsc_GatherETTSections
(
dvbpsi_decoder_t
*
p_psi_decoder
,
void
*
p_private_decoder
,
dvbpsi_psi_section_t
*
p_section
)
dvbpsi_psi_section_t
*
p_section
)
{
{
dvbpsi_atsc_ett_decoder_t
*
p_ett_decoder
dvbpsi_atsc_ett_decoder_t
*
p_ett_decoder
=
(
dvbpsi_atsc_ett_decoder_t
*
)
p_
decoder
->
p_
private_decoder
;
=
(
dvbpsi_atsc_ett_decoder_t
*
)
p_private_decoder
;
if
(
p_section
->
i_table_id
==
0xCC
)
if
(
p_section
->
i_table_id
==
0xCC
)
{
{
...
...
src/tables/atsc_ett.h
View file @
98184467
...
@@ -23,6 +23,9 @@ Decode PSIP Extended Text Table.
...
@@ -23,6 +23,9 @@ Decode PSIP Extended Text Table.
#ifndef _ATSC_ETT_H
#ifndef _ATSC_ETT_H
#define _ATSC_ETT_H
#define _ATSC_ETT_H
#ifdef __cplusplus
extern
"C"
{
#endif
/*****************************************************************************
/*****************************************************************************
* dvbpsi_atsc_ett_t
* dvbpsi_atsc_ett_t
...
@@ -68,11 +71,13 @@ typedef void (* dvbpsi_atsc_ett_callback)(void* p_cb_data, dvbpsi_atsc_ett_t* p_
...
@@ -68,11 +71,13 @@ typedef void (* dvbpsi_atsc_ett_callback)(void* p_cb_data, dvbpsi_atsc_ett_t* p_
dvbpsi_atsc_ett_callback pf_callback, void* p_cb_data)
dvbpsi_atsc_ett_callback pf_callback, void* p_cb_data)
*
*
* \brief Creation and initialization of a ETT decoder.
* \brief Creation and initialization of a ETT decoder.
* \param i_extension Table ID extension, normally 0x0000.
* \param pf_callback function to call back on new ETT.
* \param pf_callback function to call back on new ETT.
* \param p_cb_data private data given in argument to the callback.
* \param p_cb_data private data given in argument to the callback.
* \return 0 if everything went ok.
* \return 0 if everything went ok.
*/
*/
dvbpsi_handle
dvbpsi_atsc_AttachETT
(
dvbpsi_atsc_ett_callback
pf_callback
,
void
*
p_cb_data
);
int
dvbpsi_atsc_AttachETT
(
dvbpsi_decoder_t
*
p_psi_decoder
,
uint8_t
i_table_id
,
uint16_t
i_extension
,
dvbpsi_atsc_ett_callback
pf_callback
,
void
*
p_cb_data
);
/*****************************************************************************
/*****************************************************************************
...
@@ -84,11 +89,11 @@ dvbpsi_handle dvbpsi_atsc_AttachETT(dvbpsi_atsc_ett_callback pf_callback, void*
...
@@ -84,11 +89,11 @@ dvbpsi_handle dvbpsi_atsc_AttachETT(dvbpsi_atsc_ett_callback pf_callback, void*
* \brief Destroy a ETT decoder.
* \brief Destroy a ETT decoder.
* \param p_demux Subtable demultiplexor to which the decoder is attached.
* \param p_demux Subtable demultiplexor to which the decoder is attached.
* \param i_table_id Table ID, 0xCD.
* \param i_table_id Table ID, 0xCD.
* \param i_extension Table extension, ignored as this should always be 0.
* \param i_extension Table ID extension, normally 0x0000.
* (Required to match prototype for demux)
* \return nothing.
* \return nothing.
*/
*/
void
dvbpsi_atsc_DetachETT
(
dvbpsi_handle
h_dvbpsi
);
void
dvbpsi_atsc_DetachETT
(
dvbpsi_demux_t
*
p_demux
,
uint8_t
i_table_id
,
uint16_t
i_extension
);
/*****************************************************************************
/*****************************************************************************
...
@@ -148,4 +153,8 @@ void dvbpsi_atsc_EmptyETT(dvbpsi_atsc_ett_t *p_ett);
...
@@ -148,4 +153,8 @@ void dvbpsi_atsc_EmptyETT(dvbpsi_atsc_ett_t *p_ett);
free(p_ett); \
free(p_ett); \
} while(0);
} while(0);
#ifdef __cplusplus
};
#endif
#endif
#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