Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
603a87c7
Commit
603a87c7
authored
Apr 27, 2011
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used decoder_NewSubpictureText to render CC.
parent
093db7f8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
31 deletions
+12
-31
modules/codec/Modules.am
modules/codec/Modules.am
+1
-1
modules/codec/cc.c
modules/codec/cc.c
+11
-30
No files found.
modules/codec/Modules.am
View file @
603a87c7
...
@@ -28,7 +28,7 @@ SOURCES_sdl_image = sdl_image.c
...
@@ -28,7 +28,7 @@ SOURCES_sdl_image = sdl_image.c
SOURCES_zvbi = zvbi.c
SOURCES_zvbi = zvbi.c
SOURCES_cdg = cdg.c
SOURCES_cdg = cdg.c
SOURCES_fluidsynth = fluidsynth.c
SOURCES_fluidsynth = fluidsynth.c
SOURCES_cc = cc.c cc.h
SOURCES_cc = cc.c cc.h
substext.h
SOURCES_kate = kate.c
SOURCES_kate = kate.c
SOURCES_schroedinger = schroedinger.c
SOURCES_schroedinger = schroedinger.c
SOURCES_libass = libass.c
SOURCES_libass = libass.c
...
...
modules/codec/cc.c
View file @
603a87c7
...
@@ -51,6 +51,8 @@
...
@@ -51,6 +51,8 @@
#include <assert.h>
#include <assert.h>
#include "substext.h"
/*****************************************************************************
/*****************************************************************************
* Module descriptor.
* Module descriptor.
*****************************************************************************/
*****************************************************************************/
...
@@ -312,7 +314,6 @@ static subpicture_t *Subtitle( decoder_t *p_dec, char *psz_subtitle, char *psz_h
...
@@ -312,7 +314,6 @@ static subpicture_t *Subtitle( decoder_t *p_dec, char *psz_subtitle, char *psz_h
{
{
//decoder_sys_t *p_sys = p_dec->p_sys;
//decoder_sys_t *p_sys = p_dec->p_sys;
subpicture_t
*
p_spu
=
NULL
;
subpicture_t
*
p_spu
=
NULL
;
video_format_t
fmt
;
/* We cannot display a subpicture with no date */
/* We cannot display a subpicture with no date */
if
(
i_pts
<=
VLC_TS_INVALID
)
if
(
i_pts
<=
VLC_TS_INVALID
)
...
@@ -326,44 +327,24 @@ static subpicture_t *Subtitle( decoder_t *p_dec, char *psz_subtitle, char *psz_h
...
@@ -326,44 +327,24 @@ static subpicture_t *Subtitle( decoder_t *p_dec, char *psz_subtitle, char *psz_h
EnsureUTF8
(
psz_html
);
EnsureUTF8
(
psz_html
);
/* Create the subpicture unit */
/* Create the subpicture unit */
p_spu
=
decoder_NewSubpicture
(
p_dec
,
NULL
);
p_spu
=
decoder_NewSubpicture
Text
(
p_dec
);
if
(
!
p_spu
)
if
(
!
p_spu
)
{
{
msg_Warn
(
p_dec
,
"can't get spu buffer"
);
free
(
psz_subtitle
);
free
(
psz_html
);
return
NULL
;
}
/* Create a new subpicture region */
memset
(
&
fmt
,
0
,
sizeof
(
video_format_t
)
);
fmt
.
i_chroma
=
VLC_CODEC_TEXT
;
fmt
.
i_width
=
fmt
.
i_height
=
0
;
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
p_spu
->
p_region
=
subpicture_region_New
(
&
fmt
);
if
(
!
p_spu
->
p_region
)
{
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
free
(
psz_subtitle
);
free
(
psz_subtitle
);
free
(
psz_html
);
free
(
psz_html
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
return
NULL
;
return
NULL
;
}
}
/* Decode and format the subpicture unit */
/* Normal text subs, easy markup */
p_spu
->
p_region
->
i_align
=
SUBPICTURE_ALIGN_BOTTOM
;
// | SUBPICTURE_ALIGN_LEFT;// | p_sys->i_align;
p_spu
->
p_region
->
i_x
=
0
;
//p_sys->i_align ? 20 : 0;
p_spu
->
p_region
->
i_y
=
10
;
p_spu
->
p_region
->
psz_text
=
psz_subtitle
;
p_spu
->
p_region
->
psz_html
=
psz_html
;
p_spu
->
i_start
=
i_pts
;
p_spu
->
i_start
=
i_pts
;
p_spu
->
i_stop
=
i_pts
+
10000000
;
/* 10s max */
p_spu
->
i_stop
=
i_pts
+
10000000
;
/* 10s max */
p_spu
->
b_ephemer
=
true
;
p_spu
->
b_ephemer
=
true
;
p_spu
->
b_absolute
=
false
;
p_spu
->
b_absolute
=
false
;
subpicture_updater_sys_t
*
p_spu_sys
=
p_spu
->
updater
.
p_sys
;
p_spu_sys
->
align
=
SUBPICTURE_ALIGN_BOTTOM
;
p_spu_sys
->
text
=
psz_subtitle
;
p_spu_sys
->
html
=
psz_html
;
return
p_spu
;
return
p_spu
;
}
}
...
...
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