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
e86b8048
Commit
e86b8048
authored
Apr 26, 2011
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rendered text OSD at display size.
Text subtitles are not impacted by this commit.
parent
ed1d9723
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
9 deletions
+25
-9
src/video_output/video_text.c
src/video_output/video_text.c
+25
-9
No files found.
src/video_output/video_text.c
View file @
e86b8048
...
@@ -55,14 +55,18 @@ static void OSDTextUpdate(subpicture_t *subpic,
...
@@ -55,14 +55,18 @@ static void OSDTextUpdate(subpicture_t *subpic,
mtime_t
ts
)
mtime_t
ts
)
{
{
subpicture_updater_sys_t
*
sys
=
subpic
->
updater
.
p_sys
;
subpicture_updater_sys_t
*
sys
=
subpic
->
updater
.
p_sys
;
VLC_UNUSED
(
fmt_
dst
);
VLC_UNUSED
(
ts
);
VLC_UNUSED
(
fmt_
src
);
VLC_UNUSED
(
ts
);
subpic
->
i_original_picture_width
=
fmt_src
->
i_width
;
if
(
fmt_dst
->
i_sar_num
<=
0
||
fmt_dst
->
i_sar_den
<=
0
)
subpic
->
i_original_picture_height
=
fmt_src
->
i_height
;
return
;
subpic
->
b_absolute
=
false
;
subpic
->
i_original_picture_width
=
fmt_dst
->
i_width
*
fmt_dst
->
i_sar_num
/
fmt_dst
->
i_sar_den
;
subpic
->
i_original_picture_height
=
fmt_dst
->
i_height
;
video_format_t
fmt
;
video_format_t
fmt
;
video_format_Init
(
&
fmt
,
VLC_CODEC_TEXT
);
video_format_Init
(
&
fmt
,
VLC_CODEC_TEXT
);
fmt
.
i_sar_num
=
0
;
fmt
.
i_sar_num
=
1
;
fmt
.
i_sar_den
=
1
;
fmt
.
i_sar_den
=
1
;
subpicture_region_t
*
r
=
subpic
->
p_region
=
subpicture_region_New
(
&
fmt
);
subpicture_region_t
*
r
=
subpic
->
p_region
=
subpicture_region_New
(
&
fmt
);
...
@@ -70,11 +74,23 @@ static void OSDTextUpdate(subpicture_t *subpic,
...
@@ -70,11 +74,23 @@ static void OSDTextUpdate(subpicture_t *subpic,
return
;
return
;
r
->
psz_text
=
strdup
(
sys
->
text
);
r
->
psz_text
=
strdup
(
sys
->
text
);
r
->
i_align
=
sys
->
position
;
r
->
i_x
=
30
+
fmt_src
->
i_width
const
float
margin_ratio
=
0
.
04
;
-
fmt_src
->
i_visible_width
const
int
margin_h
=
margin_ratio
*
fmt_dst
->
i_visible_width
;
-
fmt_src
->
i_x_offset
;
const
int
margin_v
=
margin_ratio
*
fmt_dst
->
i_visible_height
;
r
->
i_y
=
20
+
fmt_src
->
i_y_offset
;
r
->
i_align
=
sys
->
position
;
r
->
i_x
=
0
;
if
(
r
->
i_align
&
SUBPICTURE_ALIGN_LEFT
)
r
->
i_x
+=
margin_h
+
fmt_dst
->
i_x_offset
;
else
if
(
r
->
i_align
&
SUBPICTURE_ALIGN_RIGHT
)
r
->
i_x
+=
margin_h
+
fmt_dst
->
i_width
-
(
fmt_dst
->
i_visible_width
+
fmt_dst
->
i_x_offset
);
r
->
i_y
=
0
;
if
(
r
->
i_align
&
SUBPICTURE_ALIGN_TOP
)
r
->
i_y
+=
margin_v
+
fmt_dst
->
i_y_offset
;
else
if
(
r
->
i_align
&
SUBPICTURE_ALIGN_BOTTOM
)
r
->
i_y
+=
margin_v
+
fmt_dst
->
i_height
-
(
fmt_dst
->
i_visible_height
+
fmt_dst
->
i_y_offset
);
}
}
static
void
OSDTextDestroy
(
subpicture_t
*
subpic
)
static
void
OSDTextDestroy
(
subpicture_t
*
subpic
)
...
...
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