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
ef801bc9
Commit
ef801bc9
authored
Sep 16, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed spu_RenderSubpictures prototype.
It now requires source format instead of scaling parameters.
parent
6d7931bf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
42 deletions
+30
-42
include/vlc_osd.h
include/vlc_osd.h
+8
-1
modules/stream_out/transcode.c
modules/stream_out/transcode.c
+2
-8
src/video_output/vout_pictures.c
src/video_output/vout_pictures.c
+14
-24
src/video_output/vout_subpictures.c
src/video_output/vout_subpictures.c
+6
-9
No files found.
include/vlc_osd.h
View file @
ef801bc9
...
...
@@ -122,7 +122,14 @@ VLC_EXPORT( subpicture_region_t *,__spu_CreateRegion, ( vlc_object_t *, video_fo
#define spu_DestroyRegion(a,b) __spu_DestroyRegion(VLC_OBJECT(a),b)
VLC_EXPORT
(
void
,
__spu_DestroyRegion
,
(
vlc_object_t
*
,
subpicture_region_t
*
)
);
VLC_EXPORT
(
subpicture_t
*
,
spu_SortSubpictures
,
(
spu_t
*
,
mtime_t
display_date
,
bool
b_paused
,
bool
b_subtitle_only
)
);
VLC_EXPORT
(
void
,
spu_RenderSubpictures
,
(
spu_t
*
,
video_format_t
*
,
picture_t
*
,
subpicture_t
*
,
int
,
int
)
);
/**
* This function renders a list of subpicture_t on the provided picture.
*
* \param p_fmt_dst is the format of the destination picture.
* \param p_fmt_src is the format of the original(source) video.
*/
VLC_EXPORT
(
void
,
spu_RenderSubpictures
,
(
spu_t
*
,
picture_t
*
,
video_format_t
*
p_fmt_dst
,
subpicture_t
*
p_list
,
const
video_format_t
*
p_fmt_src
)
);
/** @}*/
...
...
modules/stream_out/transcode.c
View file @
ef801bc9
...
...
@@ -1988,14 +1988,8 @@ static int transcode_video_process( sout_stream_t *p_stream,
/* Overlay subpicture */
if
(
p_subpic
)
{
int
i_scale_width
,
i_scale_height
;
video_format_t
fmt
;
i_scale_width
=
id
->
p_encoder
->
fmt_in
.
video
.
i_width
*
1000
/
id
->
p_decoder
->
fmt_out
.
video
.
i_width
;
i_scale_height
=
id
->
p_encoder
->
fmt_in
.
video
.
i_height
*
1000
/
id
->
p_decoder
->
fmt_out
.
video
.
i_height
;
if
(
p_pic
->
i_refcount
&&
!
filter_chain_GetLength
(
id
->
p_f_chain
)
)
{
/* We can't modify the picture, we need to duplicate it */
...
...
@@ -2017,8 +2011,8 @@ static int transcode_video_process( sout_stream_t *p_stream,
fmt
.
i_sar_num
=
fmt
.
i_aspect
*
fmt
.
i_height
/
fmt
.
i_width
;
fmt
.
i_sar_den
=
VOUT_ASPECT_FACTOR
;
spu_RenderSubpictures
(
p_sys
->
p_spu
,
&
fmt
,
p_pic
,
p_subpic
,
i_scale_width
,
i_scale_height
);
spu_RenderSubpictures
(
p_sys
->
p_spu
,
p_pic
,
&
fmt
,
p_subpic
,
&
id
->
p_decoder
->
fmt_out
.
video
);
}
/* Run user specified filter chain */
...
...
src/video_output/vout_pictures.c
View file @
ef801bc9
...
...
@@ -320,21 +320,11 @@ static void vout_UnlockPicture( vout_thread_t *p_vout, picture_t *p_picture )
* before rendering, does the subpicture magic, and tells the video output
* thread which direct buffer needs to be displayed.
*/
picture_t
*
vout_RenderPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
,
subpicture_t
*
p_subpic
)
picture_t
*
vout_RenderPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
,
subpicture_t
*
p_subpic
)
{
int
i_scale_width
,
i_scale_height
;
if
(
p_pic
==
NULL
)
{
/* XXX: subtitles */
return
NULL
;
}
i_scale_width
=
p_vout
->
fmt_out
.
i_visible_width
*
1000
/
p_vout
->
fmt_in
.
i_visible_width
;
i_scale_height
=
p_vout
->
fmt_out
.
i_visible_height
*
1000
/
p_vout
->
fmt_in
.
i_visible_height
;
if
(
p_pic
->
i_type
==
DIRECT_PICTURE
)
{
...
...
@@ -350,9 +340,9 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
vout_CopyPicture
(
p_vout
,
PP_OUTPUTPICTURE
[
0
],
p_pic
);
spu_RenderSubpictures
(
p_vout
->
p_spu
,
&
p_vout
->
fmt_out
,
PP_OUTPUTPICTURE
[
0
],
p_subpic
,
i_scale_width
,
i_scale_height
);
spu_RenderSubpictures
(
p_vout
->
p_spu
,
PP_OUTPUTPICTURE
[
0
],
&
p_vout
->
fmt_out
,
p_subpic
,
&
p_vout
->
fmt_in
);
vout_UnlockPicture
(
p_vout
,
PP_OUTPUTPICTURE
[
0
]
);
...
...
@@ -377,9 +367,9 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
return
NULL
;
vout_CopyPicture
(
p_vout
,
PP_OUTPUTPICTURE
[
0
],
p_pic
);
spu_RenderSubpictures
(
p_vout
->
p_spu
,
&
p_vout
->
fmt_out
,
PP_OUTPUTPICTURE
[
0
],
p_subpic
,
i_scale_width
,
i_scale_height
);
spu_RenderSubpictures
(
p_vout
->
p_spu
,
PP_OUTPUTPICTURE
[
0
],
&
p_vout
->
fmt_out
,
p_subpic
,
&
p_vout
->
fmt_in
);
vout_UnlockPicture
(
p_vout
,
PP_OUTPUTPICTURE
[
0
]
);
...
...
@@ -415,9 +405,9 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
p_vout
->
p_chroma
->
pf_video_filter
(
p_vout
->
p_chroma
,
p_pic
);
/* Render subpictures on the first direct buffer */
spu_RenderSubpictures
(
p_vout
->
p_spu
,
&
p_vout
->
fmt_out
,
p_tmp_pic
,
p_subpic
,
i_scale_width
,
i_scale_height
);
spu_RenderSubpictures
(
p_vout
->
p_spu
,
p_tmp_pic
,
&
p_vout
->
fmt_out
,
p_subpic
,
&
p_vout
->
fmt_in
);
if
(
vout_LockPicture
(
p_vout
,
&
p_vout
->
p_picture
[
0
]
)
)
return
NULL
;
...
...
@@ -434,9 +424,9 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
p_vout
->
p_chroma
->
pf_video_filter
(
p_vout
->
p_chroma
,
p_pic
);
/* Render subpictures on the first direct buffer */
spu_RenderSubpictures
(
p_vout
->
p_spu
,
&
p_vout
->
fmt_out
,
&
p_vout
->
p_picture
[
0
],
p_subpic
,
i_scale_width
,
i_scale_height
);
spu_RenderSubpictures
(
p_vout
->
p_spu
,
&
p_vout
->
p_picture
[
0
],
&
p_vout
->
fmt_out
,
p_subpic
,
&
p_vout
->
fmt_in
);
}
vout_UnlockPicture
(
p_vout
,
&
p_vout
->
p_picture
[
0
]
);
...
...
src/video_output/vout_subpictures.c
View file @
ef801bc9
...
...
@@ -949,17 +949,16 @@ exit:
p_region
->
fmt
=
fmt_original
;
}
void
spu_RenderSubpictures
(
spu_t
*
p_spu
,
video_format_t
*
p_fmt_a
,
picture_t
*
p_pic_dst
,
void
spu_RenderSubpictures
(
spu_t
*
p_spu
,
picture_t
*
p_pic_dst
,
video_format_t
*
p_fmt_dst
,
subpicture_t
*
p_subpic_list
,
int
i_scale_width_orig
,
int
i_scale_height_orig
)
const
video_format_t
*
p_fmt_src
)
{
video_format_t
fmt
=
*
p_fmt_a
,
*
p_fmt
=
&
fm
t
;
video_format_t
*
p_fmt
=
p_fmt_ds
t
;
const
mtime_t
i_current_date
=
mdate
();
int
i_source_video_width
;
int
i_source_video_height
;
subpicture_t
*
p_subpic
;
spu_scale_t
scale_size_org
;
/* Get lock */
vlc_mutex_lock
(
&
p_spu
->
subpicture_lock
);
...
...
@@ -971,10 +970,8 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt_a,
return
;
}
scale_size_org
=
spu_scale_create
(
i_scale_width_orig
,
i_scale_height_orig
);
i_source_video_width
=
p_fmt
->
i_width
*
SCALE_UNIT
/
scale_size_org
.
w
;
i_source_video_height
=
p_fmt
->
i_height
*
SCALE_UNIT
/
scale_size_org
.
h
;
i_source_video_width
=
p_fmt_src
->
i_width
;
i_source_video_height
=
p_fmt_src
->
i_height
;
/* */
for
(
p_subpic
=
p_subpic_list
;
...
...
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