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
47a71f07
Commit
47a71f07
authored
Jun 10, 2011
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed unused "scale" object variable in text renderer.
parent
54348a25
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
44 deletions
+16
-44
modules/misc/text_renderer/freetype.c
modules/misc/text_renderer/freetype.c
+10
-26
modules/misc/text_renderer/quartztext.c
modules/misc/text_renderer/quartztext.c
+6
-15
src/video_output/vout_subpictures.c
src/video_output/vout_subpictures.c
+0
-3
No files found.
modules/misc/text_renderer/freetype.c
View file @
47a71f07
...
...
@@ -324,18 +324,15 @@ static int LoadFontsFromAttachments( filter_t *p_filter )
static
int
GetFontSize
(
filter_t
*
p_filter
)
{
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
vlc_value_t
val
;
int
i_size
=
0
;
if
(
p_sys
->
i_default_font_size
)
{
if
(
VLC_SUCCESS
==
var_Get
(
p_filter
,
"scale"
,
&
val
))
i_size
=
p_sys
->
i_default_font_size
*
val
.
i_int
/
1000
;
else
i_size
=
p_sys
->
i_default_font_size
;
}
else
{
vlc_value_t
val
;
var_Get
(
p_filter
,
"freetype-rel-fontsize"
,
&
val
);
if
(
val
.
i_int
>
0
)
{
...
...
@@ -347,9 +344,6 @@ static int GetFontSize( filter_t *p_filter )
if
(
i_size
<=
0
)
{
msg_Warn
(
p_filter
,
"invalid fontsize, using 12"
);
if
(
VLC_SUCCESS
==
var_Get
(
p_filter
,
"scale"
,
&
val
))
i_size
=
12
*
val
.
i_int
/
1000
;
else
i_size
=
12
;
}
return
i_size
;
...
...
@@ -1361,7 +1355,7 @@ static const struct {
};
static
int
HandleFontAttributes
(
xml_reader_t
*
p_xml_reader
,
font_stack_t
**
p_fonts
,
int
i_scale
)
font_stack_t
**
p_fonts
)
{
int
rv
;
char
*
psz_fontname
=
NULL
;
...
...
@@ -1380,7 +1374,7 @@ static int HandleFontAttributes( xml_reader_t *p_xml_reader,
&
i_karaoke_bg_color
))
{
psz_fontname
=
strdup
(
psz_fontname
);
i_font_size
=
i_font_size
*
1000
/
i_scale
;
i_font_size
=
i_font_size
;
}
i_font_alpha
=
(
i_font_color
>>
24
)
&
0xff
;
i_font_color
&=
0x00ffffff
;
...
...
@@ -1436,7 +1430,7 @@ static int HandleFontAttributes( xml_reader_t *p_xml_reader,
}
rv
=
PushFont
(
p_fonts
,
psz_fontname
,
i_font_size
*
i_scale
/
1000
,
i_font_size
,
(
i_font_color
&
0xffffff
)
|
((
i_font_alpha
&
0xff
)
<<
24
),
i_karaoke_bg_color
);
...
...
@@ -1878,22 +1872,17 @@ static int ProcessNodes( filter_t *p_filter,
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
uint32_t
*
psz_text_orig
=
psz_text
;
font_stack_t
*
p_fonts
=
NULL
;
vlc_value_t
val
;
int
i_scale
=
1000
;
bool
b_italic
=
false
;
bool
b_bold
=
false
;
bool
b_uline
=
false
;
bool
b_through
=
false
;
if
(
VLC_SUCCESS
==
var_Get
(
p_filter
,
"scale"
,
&
val
))
i_scale
=
val
.
i_int
;
if
(
p_font_style
)
{
rv
=
PushFont
(
&
p_fonts
,
p_font_style
->
psz_fontname
,
p_font_style
->
i_font_size
*
i_scale
/
1000
,
p_font_style
->
i_font_size
,
(
p_font_style
->
i_font_color
&
0xffffff
)
|
((
p_font_style
->
i_font_alpha
&
0xff
)
<<
24
),
(
p_font_style
->
i_karaoke_background_color
&
0xffffff
)
|
...
...
@@ -1945,7 +1934,7 @@ static int ProcessNodes( filter_t *p_filter,
case
XML_READER_STARTELEM
:
if
(
!
strcasecmp
(
"font"
,
node
)
)
rv
=
HandleFontAttributes
(
p_xml_reader
,
&
p_fonts
,
i_scale
);
rv
=
HandleFontAttributes
(
p_xml_reader
,
&
p_fonts
);
else
if
(
!
strcasecmp
(
"b"
,
node
)
)
b_bold
=
true
;
else
if
(
!
strcasecmp
(
"i"
,
node
)
)
...
...
@@ -2589,15 +2578,10 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
IconvText
(
p_filter
,
p_region_in
->
psz_text
,
&
i_iconv_length
,
psz_text
);
i_text_length
=
i_iconv_length
;
int
i_scale
=
1000
;
vlc_value_t
val
;
if
(
VLC_SUCCESS
==
var_Get
(
p_filter
,
"scale"
,
&
val
)
)
i_scale
=
val
.
i_int
;
text_style_t
*
p_style
;
if
(
p_region_in
->
p_style
)
p_style
=
CreateStyle
(
p_region_in
->
p_style
->
psz_fontname
,
p_region_in
->
p_style
->
i_font_size
*
i_scale
/
1000
,
p_region_in
->
p_style
->
i_font_size
,
(
p_region_in
->
p_style
->
i_font_color
&
0xffffff
)
|
((
p_region_in
->
p_style
->
i_font_alpha
&
0xff
)
<<
24
),
0x00ffffff
,
...
...
@@ -2607,7 +2591,7 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
p_region_in
->
p_style
->
i_style_flags
&
STYLE_STRIKEOUT
);
else
p_style
=
CreateStyle
(
p_sys
->
psz_fontfamily
,
p_sys
->
i_font_size
*
i_scale
/
1000
,
p_sys
->
i_font_size
,
(
p_sys
->
i_font_color
&
0xffffff
)
|
(((
255
-
p_sys
->
i_font_opacity
)
&
0xff
)
<<
24
),
0x00ffffff
,
...
...
modules/misc/text_renderer/quartztext.c
View file @
47a71f07
...
...
@@ -316,7 +316,6 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
uint32_t
i_font_color
;
bool
b_bold
,
b_uline
,
b_italic
;
vlc_value_t
val
;
int
i_scale
=
1000
;
b_bold
=
b_uline
=
b_italic
=
FALSE
;
p_sys
->
i_font_size
=
GetFontSize
(
p_filter
);
...
...
@@ -326,14 +325,11 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
psz_string
=
p_region_in
->
psz_text
;
if
(
!
psz_string
||
!*
psz_string
)
return
VLC_EGENERIC
;
if
(
VLC_SUCCESS
==
var_Get
(
p_filter
,
"scale"
,
&
val
))
i_scale
=
val
.
i_int
;
if
(
p_region_in
->
p_style
)
{
i_font_color
=
__MAX
(
__MIN
(
p_region_in
->
p_style
->
i_font_color
,
0xFFFFFF
),
0
);
i_font_alpha
=
__MAX
(
__MIN
(
p_region_in
->
p_style
->
i_font_alpha
,
255
),
0
);
i_font_size
=
__MAX
(
__MIN
(
p_region_in
->
p_style
->
i_font_size
,
255
),
0
)
*
i_scale
/
1000
;
i_font_size
=
__MAX
(
__MIN
(
p_region_in
->
p_style
->
i_font_size
,
255
),
0
);
if
(
p_region_in
->
p_style
->
i_style_flags
)
{
if
(
p_region_in
->
p_style
->
i_style_flags
&
STYLE_BOLD
)
...
...
@@ -476,7 +472,7 @@ static int PeekFont( font_stack_t **p_font, char **psz_name, int *i_size,
}
static
int
HandleFontAttributes
(
xml_reader_t
*
p_xml_reader
,
font_stack_t
**
p_fonts
,
int
i_scale
)
font_stack_t
**
p_fonts
)
{
int
rv
;
char
*
psz_fontname
=
NULL
;
...
...
@@ -493,7 +489,7 @@ static int HandleFontAttributes( xml_reader_t *p_xml_reader,
&
i_font_color
))
{
psz_fontname
=
strdup
(
psz_fontname
);
i_font_size
=
i_font_size
*
1000
/
i_scale
;
i_font_size
=
i_font_size
;
}
i_font_alpha
=
(
i_font_color
>>
24
)
&
0xff
;
i_font_color
&=
0x00ffffff
;
...
...
@@ -534,7 +530,7 @@ static int HandleFontAttributes( xml_reader_t *p_xml_reader,
}
rv
=
PushFont
(
p_fonts
,
psz_fontname
,
i_font_size
*
i_scale
/
1000
,
i_font_size
,
(
i_font_color
&
0xffffff
)
|
((
i_font_alpha
&
0xff
)
<<
24
)
);
free
(
psz_fontname
);
...
...
@@ -650,8 +646,6 @@ static int ProcessNodes( filter_t *p_filter,
int
rv
=
VLC_SUCCESS
;
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
font_stack_t
*
p_fonts
=
NULL
;
vlc_value_t
val
;
int
i_scale
=
1000
;
int
type
;
const
char
*
node
;
...
...
@@ -660,14 +654,11 @@ static int ProcessNodes( filter_t *p_filter,
bool
b_bold
=
false
;
bool
b_uline
=
false
;
if
(
VLC_SUCCESS
==
var_Get
(
p_filter
,
"scale"
,
&
val
))
i_scale
=
val
.
i_int
;
if
(
p_font_style
)
{
rv
=
PushFont
(
&
p_fonts
,
p_font_style
->
psz_fontname
,
p_font_style
->
i_font_size
*
i_scale
/
1000
,
p_font_style
->
i_font_size
,
(
p_font_style
->
i_font_color
&
0xffffff
)
|
((
p_font_style
->
i_font_alpha
&
0xff
)
<<
24
)
);
...
...
@@ -705,7 +696,7 @@ static int ProcessNodes( filter_t *p_filter,
break
;
case
XML_READER_STARTELEM
:
if
(
!
strcasecmp
(
"font"
,
node
)
)
rv
=
HandleFontAttributes
(
p_xml_reader
,
&
p_fonts
,
i_scale
);
rv
=
HandleFontAttributes
(
p_xml_reader
,
&
p_fonts
);
else
if
(
!
strcasecmp
(
"b"
,
node
)
)
b_bold
=
true
;
else
if
(
!
strcasecmp
(
"i"
,
node
)
)
...
...
src/video_output/vout_subpictures.c
View file @
47a71f07
...
...
@@ -223,7 +223,6 @@ static filter_t *SpuRenderCreateAndLoadText(spu_t *spu)
/* Create a few variables used for enhanced text rendering */
var_Create
(
text
,
"spu-elapsed"
,
VLC_VAR_TIME
);
var_Create
(
text
,
"text-rerender"
,
VLC_VAR_BOOL
);
var_Create
(
text
,
"scale"
,
VLC_VAR_INTEGER
);
return
text
;
}
...
...
@@ -1031,8 +1030,6 @@ static subpicture_t *SpuRenderSubpictures(spu_t *spu,
sys
->
text
->
fmt_out
.
video
.
i_height
=
sys
->
text
->
fmt_out
.
video
.
i_visible_height
=
subpic
->
i_original_picture_height
;
var_SetInteger
(
sys
->
text
,
"scale"
,
SCALE_UNIT
);
}
/* Render all regions
...
...
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