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
3f98a0ff
Commit
3f98a0ff
authored
May 03, 2015
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Text codecs: move to text_segment list
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
6b45f45e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
16 deletions
+18
-16
modules/codec/arib/substext.h
modules/codec/arib/substext.h
+2
-1
modules/codec/dvbsub.c
modules/codec/dvbsub.c
+4
-4
modules/codec/kate.c
modules/codec/kate.c
+2
-2
modules/codec/stl.c
modules/codec/stl.c
+2
-2
modules/codec/substext.h
modules/codec/substext.h
+1
-1
modules/codec/subsusf.c
modules/codec/subsusf.c
+2
-2
modules/codec/t140.c
modules/codec/t140.c
+4
-3
modules/codec/telx.c
modules/codec/telx.c
+1
-1
No files found.
modules/codec/arib/substext.h
View file @
3f98a0ff
...
...
@@ -97,7 +97,8 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
return
;
}
r
->
psz_text
=
p_region
->
psz_text
?
strdup
(
p_region
->
psz_text
)
:
NULL
;
if
(
p_region
->
psz_text
)
r
->
p_text
=
text_segment_New
(
p_region
->
psz_text
);
r
->
psz_html
=
p_region
->
psz_html
?
strdup
(
p_region
->
psz_html
)
:
NULL
;
r
->
i_align
=
SUBPICTURE_ALIGN_LEFT
|
SUBPICTURE_ALIGN_TOP
;
...
...
modules/codec/dvbsub.c
View file @
3f98a0ff
...
...
@@ -1644,7 +1644,7 @@ static subpicture_t *render( decoder_t *p_dec )
fmt
.
i_x_offset
=
fmt
.
i_y_offset
=
0
;
p_spu_region
=
subpicture_region_New
(
&
fmt
);
p_spu_region
->
p
sz_text
=
strdup
(
p_object_def
->
psz_text
);
p_spu_region
->
p
_text
=
text_segment_New
(
p_object_def
->
psz_text
);
p_spu_region
->
i_x
=
i_base_x
+
p_regiondef
->
i_x
+
p_object_def
->
i_x
;
p_spu_region
->
i_y
=
i_base_y
+
p_regiondef
->
i_y
+
p_object_def
->
i_y
;
p_spu_region
->
i_align
=
p_sys
->
i_spu_position
;
...
...
@@ -2303,14 +2303,14 @@ static void encode_object( encoder_t *p_enc, bs_t *s, subpicture_t *p_subpic )
{
int
i_size
,
i
;
if
(
!
p_region
->
p
sz
_text
)
continue
;
if
(
!
p_region
->
p_text
)
continue
;
i_size
=
__MIN
(
strlen
(
p_region
->
psz_text
),
256
);
i_size
=
__MIN
(
strlen
(
p_region
->
p
_text
->
p
sz_text
),
256
);
bs_write
(
s
,
8
,
i_size
);
/* number of characters in string */
for
(
i
=
0
;
i
<
i_size
;
i
++
)
{
bs_write
(
s
,
16
,
p_region
->
psz_text
[
i
]
);
bs_write
(
s
,
16
,
p_region
->
p
_text
->
p
sz_text
[
i
]
);
}
/* Update segment length */
...
...
modules/codec/kate.c
View file @
3f98a0ff
...
...
@@ -702,7 +702,7 @@ static void SetupText( decoder_t *p_dec, subpicture_t *p_spu, const kate_event *
switch
(
ev
->
text_markup_type
)
{
case
kate_markup_none
:
p_spu
->
p_region
->
p
sz_text
=
strdup
(
ev
->
text
);
/* no leak, this actually gets killed by the core */
p_spu
->
p_region
->
p
_text
=
text_segment_New
(
ev
->
text
);
/* no leak, this actually gets killed by the core */
break
;
case
kate_markup_simple
:
if
(
p_sys
->
b_formatted
)
...
...
@@ -722,7 +722,7 @@ static void SetupText( decoder_t *p_dec, subpicture_t *p_spu, const kate_event *
char
*
copy
=
strdup
(
ev
->
text
);
size_t
len0
=
strlen
(
copy
)
+
1
;
kate_text_remove_markup
(
ev
->
text_encoding
,
copy
,
&
len0
);
p_spu
->
p_region
->
p
sz_text
=
copy
;
p_spu
->
p_region
->
p
_text
=
text_segment_New
(
copy
)
;
}
break
;
}
...
...
modules/codec/stl.c
View file @
3f98a0ff
...
...
@@ -143,9 +143,9 @@ static subpicture_t *Decode(decoder_t *dec, block_t **block)
video_format_Clean
(
&
fmt
);
if
(
sub
->
p_region
)
{
sub
->
p_region
->
p
sz_text
=
ParseText
(
payload
,
sub
->
p_region
->
p
_text
=
text_segment_New
(
ParseText
(
payload
,
payload_size
,
cct_nums
[
dec
->
p_sys
->
cct
-
CCT_BEGIN
].
str
);
cct_nums
[
dec
->
p_sys
->
cct
-
CCT_BEGIN
].
str
)
)
;
sub
->
p_region
->
i_align
=
SUBPICTURE_ALIGN_BOTTOM
;
}
...
...
modules/codec/substext.h
View file @
3f98a0ff
...
...
@@ -206,7 +206,7 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
if
(
!
r
)
return
;
r
->
p
sz_text
=
sys
->
text
?
strdup
(
sys
->
text
)
:
NULL
;
r
->
p
_text
=
sys
->
text
?
text_segment_New
(
sys
->
text
)
:
NULL
;
if
(
sys
->
p_htmlsegments
)
r
->
psz_html
=
SegmentsToHtml
(
sys
->
p_htmlsegments
,
(
float
)
fmt_dst
->
i_height
/
fmt_src
->
i_height
);
...
...
modules/codec/subsusf.c
View file @
3f98a0ff
...
...
@@ -843,7 +843,7 @@ static subpicture_region_t *ParseUSFString( decoder_t *p_dec,
if
(
p_text_region
)
{
p_text_region
->
p
sz_text
=
CreatePlainText
(
p_text_region
->
psz_html
);
p_text_region
->
p
_text
=
text_segment_New
(
CreatePlainText
(
p_text_region
->
psz_html
)
);
if
(
!
var_CreateGetBool
(
p_dec
,
"subsdec-formatted"
)
)
{
...
...
@@ -941,7 +941,7 @@ static subpicture_region_t *ParseUSFString( decoder_t *p_dec,
SetupPositions
(
p_image_region
,
psz_subtitle
);
p_image_region
->
p_next
=
NULL
;
p_image_region
->
p
sz_text
=
NULL
;
p_image_region
->
p
_text
=
NULL
;
p_image_region
->
psz_html
=
NULL
;
}
...
...
modules/codec/t140.c
View file @
3f98a0ff
...
...
@@ -94,13 +94,14 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_spu )
p_region
=
p_spu
->
p_region
;
if
(
(
p_region
==
NULL
)
||
(
p_region
->
fmt
.
i_chroma
!=
VLC_CODEC_TEXT
)
||
(
p_region
->
psz_text
==
NULL
)
)
||
(
p_region
->
p_text
==
NULL
)
||
(
p_region
->
p_text
->
psz_text
==
NULL
)
)
return
NULL
;
/* This should already be UTF-8 encoded, so not much effort... */
len
=
strlen
(
p_region
->
psz_text
);
len
=
strlen
(
p_region
->
p
_text
->
p
sz_text
);
p_block
=
block_Alloc
(
len
);
memcpy
(
p_block
->
p_buffer
,
p_region
->
psz_text
,
len
);
memcpy
(
p_block
->
p_buffer
,
p_region
->
p
_text
->
p
sz_text
,
len
);
p_block
->
i_pts
=
p_block
->
i_dts
=
p_spu
->
i_start
;
if
(
!
p_spu
->
b_ephemer
&&
(
p_spu
->
i_stop
>
p_spu
->
i_start
)
)
...
...
modules/codec/telx.c
View file @
3f98a0ff
...
...
@@ -707,7 +707,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
p_spu
->
p_region
->
i_align
=
SUBPICTURE_ALIGN_BOTTOM
|
p_sys
->
i_align
;
p_spu
->
p_region
->
i_x
=
p_sys
->
i_align
?
20
:
0
;
p_spu
->
p_region
->
i_y
=
10
;
p_spu
->
p_region
->
p
sz_text
=
strdup
(
psz_text
);
p_spu
->
p_region
->
p
_text
=
text_segment_New
(
psz_text
);
p_spu
->
i_start
=
p_block
->
i_pts
;
p_spu
->
i_stop
=
p_block
->
i_pts
+
p_block
->
i_length
;
...
...
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