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
b8c1ac48
Commit
b8c1ac48
authored
May 11, 2003
by
Sigmund Augdal Helberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* osd_test.c: better size calculations. Use VLC_VAR_TIME for precise timing
(doesn't seem to work)
parent
84eeae30
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
29 deletions
+37
-29
modules/video_filter/osd_text.c
modules/video_filter/osd_text.c
+37
-29
No files found.
modules/video_filter/osd_text.c
View file @
b8c1ac48
...
...
@@ -2,7 +2,7 @@
* osd_text.c : Filter to put text on the video, using freetype2
*****************************************************************************
* Copyright (C) 2002, 2003 VideoLAN
* $Id: osd_text.c,v 1.
2 2003/04/08 07:22:10
sigmunau Exp $
* $Id: osd_text.c,v 1.
3 2003/05/11 08:42:59
sigmunau Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
...
...
@@ -472,11 +472,13 @@ static int SetMargin ( vlc_object_t *p_this, char const *psz_command,
}
else
if
(
!
strcmp
(
psz_command
,
"start-date"
)
)
{
p_vout
->
p_sys
->
i_start_date
=
newval
.
i_int
;
p_vout
->
p_sys
->
i_start_date
=
(
(
mtime_t
)
newval
.
time
.
i_high
<<
32
)
+
newval
.
time
.
i_low
;
}
else
if
(
!
strcmp
(
psz_command
,
"end-date"
)
)
{
p_vout
->
p_sys
->
i_end_date
=
newval
.
i_int
;
p_vout
->
p_sys
->
i_end_date
=
(
(
mtime_t
)
newval
.
time
.
i_high
<<
32
)
+
newval
.
time
.
i_low
;
}
else
if
(
!
strcmp
(
psz_command
,
"flags"
)
)
{
...
...
@@ -596,50 +598,56 @@ static int AddText ( vlc_object_t *p_this, char const *psz_command,
static
void
ComputeBoundingBox
(
string_info_t
*
p_string
)
{
unsigned
int
i
,
i2
;
int
pen_y
=
0
;
unsigned
int
i
;
int
i_pen_y
=
0
;
int
i_firstline_height
=
0
;
FT_Vector
result
;
FT_
Vector
line
;
FT_
BBox
line
;
FT_BBox
glyph_size
;
result
.
x
=
0
;
result
.
y
=
0
;
line
.
x
=
0
;
line
.
y
=
0
;
line
.
xMin
=
0
;
line
.
xMax
=
0
;
line
.
yMin
=
0
;
line
.
yMax
=
0
;
for
(
i
=
0
;
i
<
strlen
(
p_string
->
psz_text
);
i
++
)
{
if
(
p_string
->
psz_text
[
i
]
==
'\n'
)
{
i2
=
i
-
1
;
while
(
i2
>=
0
&&
p_string
->
psz_text
[
i2
]
)
result
.
x
=
__MAX
(
result
.
x
,
line
.
xMax
);
result
.
y
+=
line
.
yMax
-
line
.
yMin
;
if
(
!
i_firstline_height
)
{
p_string
->
p_glyph_pos
[
i2
].
y
+=
line
.
y
;
i2
--
;
i_firstline_height
=
result
.
y
;
}
result
.
x
=
__MAX
(
result
.
x
,
line
.
x
)
;
result
.
y
+=
line
.
y
;
line
.
y
=
0
;
line
.
x
=
0
;
pen_y
=
result
.
y
;
line
.
xMin
=
0
;
line
.
xMax
=
0
;
line
.
y
Min
=
0
;
line
.
yMa
x
=
0
;
i_pen_y
=
result
.
y
+
1
;
continue
;
}
p_string
->
p_glyph_pos
[
i
].
y
=
pen_y
;
p_string
->
p_glyph_pos
[
i
].
y
=
i_
pen_y
;
FT_Glyph_Get_CBox
(
p_string
->
pp_glyphs
[
i
],
ft_glyph_bbox_pixels
,
&
glyph_size
);
/* Do rest */
line
.
x
=
p_string
->
p_glyph_pos
[
i
].
x
+
glyph_size
.
xMax
-
glyph_size
.
xMin
;
line
.
y
=
__MAX
(
line
.
y
,
glyph_size
.
yMax
-
glyph_size
.
yMin
);
}
result
.
x
=
__MAX
(
result
.
x
,
line
.
x
);
result
.
y
+=
line
.
y
;
i2
=
i
-
1
;
while
(
i2
>=
0
&&
p_string
->
psz_text
[
i2
]
)
{
p_string
->
p_glyph_pos
[
i2
].
y
+=
line
.
y
;
i2
--
;
line
.
xMax
=
p_string
->
p_glyph_pos
[
i
].
x
+
glyph_size
.
xMax
-
glyph_size
.
xMin
;
line
.
yMax
=
__MAX
(
line
.
yMax
,
glyph_size
.
yMax
);
line
.
yMin
=
__MIN
(
line
.
yMin
,
glyph_size
.
yMin
);
}
result
.
x
=
__MAX
(
result
.
x
,
line
.
xMax
);
result
.
y
+=
line
.
yMax
-
line
.
yMin
;
p_string
->
i_height
=
result
.
y
;
p_string
->
i_width
=
result
.
x
;
if
(
!
i_firstline_height
)
{
i_firstline_height
=
result
.
y
;
}
for
(
i
=
0
;
i
<
strlen
(
p_string
->
psz_text
);
i
++
)
{
p_string
->
p_glyph_pos
[
i
].
y
+=
i_firstline_height
;
}
return
;
}
...
...
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