Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
vlc
Commits
99d4a4fd
Commit
99d4a4fd
authored
Nov 03, 2015
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract captions from DIRECTV
parent
24d5b1e1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
modules/codec/cc.h
modules/codec/cc.h
+10
-2
modules/packetizer/h264.c
modules/packetizer/h264.c
+11
-0
No files found.
modules/codec/cc.h
View file @
99d4a4fd
...
...
@@ -112,6 +112,8 @@ static inline void cc_Extract( cc_data_t *c, bool b_top_field_first, const uint8
{
/* CC from DVB/ATSC TS */
i_payload_type
=
CC_PAYLOAD_GA94
;
i_src
-=
5
;
p_src
+=
5
;
}
else
if
(
!
memcmp
(
p_cc_dvd
,
p_src
,
4
)
&&
i_src
>
4
+
1
)
{
...
...
@@ -128,6 +130,12 @@ static inline void cc_Extract( cc_data_t *c, bool b_top_field_first, const uint8
{
i_payload_type
=
CC_PAYLOAD_SCTE20
;
}
else
if
(
p_src
[
0
]
==
0x03
&&
p_src
[
1
]
==
i_src
-
2
)
/* DIRECTV */
{
i_payload_type
=
CC_PAYLOAD_GA94
;
i_src
-=
2
;
p_src
+=
2
;
}
else
{
#if 0
...
...
@@ -174,13 +182,13 @@ static inline void cc_Extract( cc_data_t *c, bool b_top_field_first, const uint8
* 0x00: field 1
* 0x01: field 2
*/
const
uint8_t
*
cc
=
&
p_src
[
5
];
const
uint8_t
*
cc
=
&
p_src
[
0
];
const
int
i_count_cc
=
cc
[
0
]
&
0x1f
;
int
i
;
if
(
!
(
cc
[
0
]
&
0x40
)
)
// process flag
return
;
if
(
i_src
<
5
+
1
+
1
+
i_count_cc
*
3
+
1
)
// broken packet
if
(
i_src
<
1
+
1
+
i_count_cc
*
3
+
1
)
// broken packet
return
;
if
(
i_count_cc
<=
0
)
// no cc present
return
;
...
...
modules/packetizer/h264.c
View file @
99d4a4fd
...
...
@@ -1058,6 +1058,13 @@ static void ParseSei( decoder_t *p_dec, block_t *p_frag )
0x00
,
0x31
,
/* US provider code */
0x47
,
0x41
,
0x39
,
0x34
/* user identifier */
};
static
const
uint8_t
p_DIRECTV_data_start_code
[]
=
{
0xb5
,
/* United States */
0x00
,
0x2f
,
/* US provider code */
0x03
/* Captions */
};
const
unsigned
i_t35
=
i_size
;
const
uint8_t
*
p_t35
=
&
pb_dec
[
i_used
];
...
...
@@ -1066,6 +1073,10 @@ static void ParseSei( decoder_t *p_dec, block_t *p_frag )
!
memcmp
(
p_t35
,
p_DVB1_data_start_code
,
sizeof
(
p_DVB1_data_start_code
)
)
)
{
cc_Extract
(
&
p_sys
->
cc_next
,
true
,
&
p_t35
[
3
],
i_t35
-
3
);
}
else
if
(
i_t35
>=
sizeof
(
p_DIRECTV_data_start_code
)
&&
!
memcmp
(
p_t35
,
p_DIRECTV_data_start_code
,
sizeof
(
p_DIRECTV_data_start_code
)
)
)
{
cc_Extract
(
&
p_sys
->
cc_next
,
true
,
&
p_t35
[
3
],
i_t35
-
3
);
}
}
...
...
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