Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
e062f9de
Commit
e062f9de
authored
Sep 14, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorder a bit subpicture render function.
There is no functional changes.
parent
25fb4646
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
51 deletions
+44
-51
src/video_output/vout_subpictures.c
src/video_output/vout_subpictures.c
+44
-51
No files found.
src/video_output/vout_subpictures.c
View file @
e062f9de
...
...
@@ -951,24 +951,16 @@ exit:
void
spu_RenderSubpictures
(
spu_t
*
p_spu
,
video_format_t
*
p_fmt
,
picture_t
*
p_pic_dst
,
subpicture_t
*
p_subpic
,
subpicture_t
*
p_subpic
_list
,
int
i_scale_width_orig
,
int
i_scale_height_orig
)
{
int
i_source_video_width
;
int
i_source_video_height
;
subpicture_t
*
p_subpic
_v
;
subpicture_t
*
p_subpic
;
/* Get lock */
vlc_mutex_lock
(
&
p_spu
->
subpicture_lock
);
for
(
p_subpic_v
=
p_subpic
;
p_subpic_v
!=
NULL
&&
p_subpic_v
->
i_status
!=
FREE_SUBPICTURE
;
p_subpic_v
=
p_subpic_v
->
p_next
)
{
if
(
p_subpic_v
->
pf_pre_render
)
p_subpic_v
->
pf_pre_render
(
p_fmt
,
p_spu
,
p_subpic_v
);
}
if
(
i_scale_width_orig
<=
0
)
i_scale_width_orig
=
1000
;
if
(
i_scale_height_orig
<=
0
)
...
...
@@ -978,14 +970,10 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
i_source_video_height
=
p_fmt
->
i_height
*
1000
/
i_scale_height_orig
;
/* Check i_status again to make sure spudec hasn't destroyed the subpic */
for
(
;
(
p_subpic
!=
NULL
)
&&
(
p_subpic
->
i_status
!=
FREE_SUBPICTURE
);
p_subpic
=
p_subpic
->
p_next
)
for
(
p_subpic
=
p_subpic_list
;
p_subpic
!=
NULL
&&
p_subpic
->
i_status
!=
FREE_SUBPICTURE
;
p_subpic
=
p_subpic
->
p_next
)
{
subpicture_region_t
*
p_region
;
int
pi_scale_width
[
SCALE_SIZE
];
int
pi_scale_height
[
SCALE_SIZE
];
int
pi_subpic_x
[
SCALE_SIZE
];
int
k
;
/* If the source video and subtitles stream agree on the size of
* the video then disregard all further references to the subtitle
* stream.
...
...
@@ -998,8 +986,9 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
p_subpic
->
i_original_picture_width
=
0
;
}
for
(
k
=
0
;
k
<
SCALE_SIZE
;
k
++
)
pi_subpic_x
[
k
]
=
p_subpic
->
i_x
;
/* */
if
(
p_subpic
->
pf_pre_render
)
p_subpic
->
pf_pre_render
(
p_fmt
,
p_spu
,
p_subpic
);
if
(
p_subpic
->
pf_update_regions
)
{
...
...
@@ -1014,16 +1003,16 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
p_subpic
->
pf_update_regions
(
&
fmt_org
,
p_spu
,
p_subpic
,
mdate
()
);
}
/* */
p_region
=
p_subpic
->
p_region
;
if
(
!
p_region
)
continue
;
}
/* Create the blending module */
if
(
!
p_spu
->
p_blend
)
SpuRenderCreateBlend
(
p_spu
,
p_fmt
->
i_chroma
,
p_fmt
->
i_aspect
);
/* Load the scaling module */
if
(
!
p_spu
->
p_scale
&&
!
p_spu
->
p_scale_yuvp
)
SpuRenderCreateAndLoadScale
(
p_spu
);
/* Load the text rendering module; it is possible there is a
* text region somewhere in the subpicture other than the first
* element in the region list, so just load it anyway as we'll
...
...
@@ -1031,6 +1020,24 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
if
(
!
p_spu
->
p_text
)
SpuRenderCreateAndLoadText
(
p_spu
,
p_fmt
->
i_width
,
p_fmt
->
i_height
);
/* Process all subpictures and regions */
for
(
p_subpic
=
p_subpic_list
;
p_subpic
!=
NULL
&&
p_subpic
->
i_status
!=
FREE_SUBPICTURE
;
p_subpic
=
p_subpic
->
p_next
)
{
subpicture_region_t
*
p_region
;
int
pi_scale_width
[
SCALE_SIZE
];
int
pi_scale_height
[
SCALE_SIZE
];
int
pi_subpic_x
[
SCALE_SIZE
];
int
k
;
if
(
!
p_subpic
->
p_region
)
continue
;
for
(
k
=
0
;
k
<
SCALE_SIZE
;
k
++
)
pi_subpic_x
[
k
]
=
p_subpic
->
i_x
;
/* */
if
(
p_spu
->
p_text
)
{
subpicture_region_t
*
p_text_region
=
p_subpic
->
p_region
;
...
...
@@ -1089,7 +1096,6 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
/* XXX for default:
* scale[] allows to pass from native (either video or original) size to output size */
if
(
p_subpic
->
i_original_picture_height
>
0
&&
p_subpic
->
i_original_picture_width
>
0
)
{
...
...
@@ -1118,7 +1124,10 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
}
}
/* Set default subpicture aspect ratio */
/* Set default subpicture aspect ratio
* FIXME if we only handle 1 aspect ratio per picture, why is it set per
* region ? */
p_region
=
p_subpic
->
p_region
;
if
(
!
p_region
->
fmt
.
i_sar_num
||
!
p_region
->
fmt
.
i_sar_den
)
{
if
(
p_region
->
fmt
.
i_aspect
!=
0
)
...
...
@@ -1147,23 +1156,7 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
}
}
/* Load the scaling module when needed */
if
(
!
p_spu
->
p_scale
)
{
bool
b_scale_used
=
false
;
for
(
k
=
0
;
k
<
SCALE_SIZE
;
k
++
)
{
const
int
i_scale_w
=
pi_scale_width
[
k
];
const
int
i_scale_h
=
pi_scale_height
[
k
];
if
(
(
i_scale_w
>
0
&&
i_scale_w
!=
1000
)
||
(
i_scale_h
>
0
&&
i_scale_h
!=
1000
)
)
b_scale_used
=
true
;
}
if
(
b_scale_used
)
SpuRenderCreateAndLoadScale
(
p_spu
);
}
/* Render all regions */
for
(
;
p_region
!=
NULL
;
p_region
=
p_region
->
p_next
)
SpuRenderRegion
(
p_spu
,
p_pic_dst
,
p_subpic
,
p_region
,
i_scale_width_orig
,
i_scale_height_orig
,
...
...
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