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
0602ad23
Commit
0602ad23
authored
Dec 18, 2007
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove trailing whitespace and updated comments.
parent
b14bc0fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
30 deletions
+26
-30
src/descriptors/dr_56.c
src/descriptors/dr_56.c
+22
-25
src/descriptors/dr_56.h
src/descriptors/dr_56.h
+4
-5
No files found.
src/descriptors/dr_56.c
View file @
0602ad23
...
...
@@ -21,7 +21,6 @@
*
*****************************************************************************/
#include "config.h"
#include <stdio.h>
...
...
@@ -40,18 +39,17 @@
#include "dr_56.h"
/*****************************************************************************
* dvbpsi_DecodeTeletextDr
*****************************************************************************/
dvbpsi_teletext_dr_t
*
dvbpsi_DecodeTeletextDr
(
dvbpsi_descriptor_t
*
p_descriptor
)
{
int
i_pages_number
,
i
;
int
i_pages_number
,
i
;
dvbpsi_teletext_dr_t
*
p_decoded
;
/* Check the tag */
if
(
p_descriptor
->
i_tag
!=
0x56
&&
p_descriptor
->
i_tag
!=
0x46
)
if
(
(
p_descriptor
->
i_tag
!=
0x56
)
&&
(
p_descriptor
->
i_tag
!=
0x46
)
)
{
DVBPSI_ERROR_ARG
(
"dr_46/56 decoder"
,
"bad tag (0x%x)"
,
p_descriptor
->
i_tag
);
return
NULL
;
...
...
@@ -64,45 +62,45 @@ dvbpsi_teletext_dr_t * dvbpsi_DecodeTeletextDr(
/* Decode data and check the length */
if
(
p_descriptor
->
i_length
<
3
)
{
DVBPSI_ERROR_ARG
(
"dr_56 decoder"
,
"bad length (%d)"
,
DVBPSI_ERROR_ARG
(
"dr_
46/dr_
56 decoder"
,
"bad length (%d)"
,
p_descriptor
->
i_length
);
return
NULL
;
}
if
(
p_descriptor
->
i_length
%
5
)
{
DVBPSI_ERROR_ARG
(
"dr_56 decoder"
,
"length not multiple of 5(%d)"
,
DVBPSI_ERROR_ARG
(
"dr_
46/dr_
56 decoder"
,
"length not multiple of 5(%d)"
,
p_descriptor
->
i_length
);
return
NULL
;
}
i_pages_number
=
p_descriptor
->
i_length
/
5
;
/* Allocate memory */
p_decoded
=
(
dvbpsi_teletext_dr_t
*
)
malloc
(
sizeof
(
dvbpsi_teletext_dr_t
));
if
(
!
p_decoded
)
{
DVBPSI_ERROR
(
"dr_56 decoder"
,
"out of memory"
);
DVBPSI_ERROR
(
"dr_
46/dr_
56 decoder"
,
"out of memory"
);
return
NULL
;
}
p_decoded
->
i_pages_number
=
i_pages_number
;
for
(
i
=
0
;
i
<
i_pages_number
;
i
++
)
{
memcpy
(
p_decoded
->
p_pages
[
i
].
i_iso6392_language_code
,
p_descriptor
->
p_data
+
5
*
i
,
3
);
p_decoded
->
p_pages
[
i
].
i_teletext_type
=
p_decoded
->
p_pages
[
i
].
i_teletext_type
=
((
uint8_t
)(
p_descriptor
->
p_data
[
5
*
i
+
3
])
>>
3
);
p_decoded
->
p_pages
[
i
].
i_teletext_magazine_number
=
p_decoded
->
p_pages
[
i
].
i_teletext_magazine_number
=
((
uint16_t
)(
p_descriptor
->
p_data
[
5
*
i
+
3
])
&
0x07
);
p_decoded
->
p_pages
[
i
].
i_teletext_page_number
=
p_descriptor
->
p_data
[
5
*
i
+
4
];
}
p_descriptor
->
p_decoded
=
(
void
*
)
p_decoded
;
return
p_decoded
;
...
...
@@ -117,28 +115,28 @@ dvbpsi_descriptor_t * dvbpsi_GenTeletextDr(
int
b_duplicate
)
{
int
i
;
/* Create the descriptor */
dvbpsi_descriptor_t
*
p_descriptor
=
dvbpsi_NewDescriptor
(
0x56
,
p_decoded
->
i_pages_number
*
8
,
NULL
);
if
(
p_descriptor
)
{
/* Encode data */
for
(
i
=
0
;
i
<
p_decoded
->
i_pages_number
;
i
++
)
{
{
memcpy
(
p_descriptor
->
p_data
+
8
*
i
,
p_decoded
->
p_pages
[
i
].
i_iso6392_language_code
,
3
);
p_descriptor
->
p_data
[
8
*
i
+
3
]
=
(
uint8_t
)
(
(
(
uint8_t
)
p_decoded
->
p_pages
[
i
].
i_teletext_type
<<
3
)
|
(
uint8_t
)
(
(
(
uint8_t
)
p_decoded
->
p_pages
[
i
].
i_teletext_type
<<
3
)
|
(
(
uint8_t
)
p_decoded
->
p_pages
[
i
].
i_teletext_magazine_number
&
0x07
)
);
p_descriptor
->
p_data
[
8
*
i
+
4
]
=
p_descriptor
->
p_data
[
8
*
i
+
4
]
=
p_decoded
->
p_pages
[
i
].
i_teletext_page_number
;
}
if
(
b_duplicate
)
{
/* Duplicate decoded data */
...
...
@@ -146,11 +144,10 @@ dvbpsi_descriptor_t * dvbpsi_GenTeletextDr(
(
dvbpsi_teletext_dr_t
*
)
malloc
(
sizeof
(
dvbpsi_teletext_dr_t
));
if
(
p_dup_decoded
)
memcpy
(
p_dup_decoded
,
p_decoded
,
sizeof
(
dvbpsi_teletext_dr_t
));
p_descriptor
->
p_decoded
=
(
void
*
)
p_dup_decoded
;
}
}
return
p_descriptor
;
}
src/descriptors/dr_56.h
View file @
0602ad23
...
...
@@ -26,9 +26,9 @@
* \author Derk-Jan Hartman <hartman at videolan dot org>
* \brief EBU Teletext descriptor parsing.
*
* DVB EBU Teletext descriptor parsing, according to ETSI EN 300 468
*
section 6.2.41
.
*
* DVB EBU Teletext descriptor parsing, according to ETSI EN 300 468
*
version 1.7.1 section 6.2.42 and 6.2.47
.
*
* NOTE: this descriptor is known by tag value 0x56 AND 0x46
*/
...
...
@@ -71,7 +71,7 @@ typedef struct dvbpsi_teletextpage_s
* \brief "teletext" descriptor structure.
*
* This structure is used to store a decoded "teletext"
* descriptor. (ETSI EN 300 468
section 6.2.41
).
* descriptor. (ETSI EN 300 468
version 1.7.1 section 6.2.42 and 6.2.47
).
*/
/*!
* \typedef struct dvbpsi_teletext_dr_s dvbpsi_teletext_dr_t
...
...
@@ -125,4 +125,3 @@ dvbpsi_descriptor_t * dvbpsi_GenTeletextDr(
#else
#error "Multiple inclusions of dr_56.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