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
8826fb82
Commit
8826fb82
authored
Aug 05, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/video_output/*: optimized/simplified vout_RenderPicture().
parent
716cd870
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
46 deletions
+16
-46
include/video_output.h
include/video_output.h
+1
-1
src/video_output/vout_pictures.c
src/video_output/vout_pictures.c
+10
-40
src/video_output/vout_subpictures.c
src/video_output/vout_subpictures.c
+5
-5
No files found.
include/video_output.h
View file @
8826fb82
...
...
@@ -280,7 +280,7 @@ void vout_InitSPU( vout_thread_t * );
void
vout_DestroySPU
(
vout_thread_t
*
);
subpicture_t
*
vout_SortSubPictures
(
vout_thread_t
*
,
mtime_t
);
void
vout_RenderSubPictures
(
vout_thread_t
*
,
picture_t
*
,
subpicture_t
*
);
picture_t
*
,
subpicture_t
*
);
/** @}*/
/**
* @}
...
...
src/video_output/vout_pictures.c
View file @
8826fb82
...
...
@@ -299,7 +299,8 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
if
(
p_pic
->
i_type
==
DIRECT_PICTURE
)
{
if
(
!
p_vout
->
render
.
b_allow_modify_pics
||
p_pic
->
i_refcount
)
if
(
!
p_vout
->
render
.
b_allow_modify_pics
||
p_pic
->
i_refcount
||
p_pic
->
b_force
)
{
/* Picture is in a direct buffer and is still in use,
* we need to copy it to another direct buffer before
...
...
@@ -311,7 +312,8 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
* subtitles. */
CopyPicture
(
p_vout
,
p_pic
,
PP_OUTPUTPICTURE
[
0
]
);
vout_RenderSubPictures
(
p_vout
,
PP_OUTPUTPICTURE
[
0
],
p_subpic
);
vout_RenderSubPictures
(
p_vout
,
PP_OUTPUTPICTURE
[
0
],
p_pic
,
p_subpic
);
return
PP_OUTPUTPICTURE
[
0
];
}
...
...
@@ -325,7 +327,7 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
/* Picture is in a direct buffer but isn't used by the
* decoder. We can safely render subtitles on it and
* display it. */
vout_RenderSubPictures
(
p_vout
,
p_pic
,
p_subpic
);
vout_RenderSubPictures
(
p_vout
,
p_pic
,
p_
pic
,
p_
subpic
);
return
p_pic
;
}
...
...
@@ -347,41 +349,8 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
return
NULL
;
}
if
(
p_subpic
==
NULL
||
(
p_vout
->
render
.
b_allow_modify_pics
&&
!
p_pic
->
i_refcount
)
)
{
vout_RenderSubPictures
(
p_vout
,
p_pic
,
p_subpic
);
CopyPicture
(
p_vout
,
p_pic
,
PP_OUTPUTPICTURE
[
0
]
);
}
else
if
(
PP_OUTPUTPICTURE
[
0
]
->
b_slow
)
{
/* The picture buffer is in slow memory. We'll use
* the "2 * VOUT_MAX_PICTURES + 1" picture as a temporary
* one for subpictures rendering. */
picture_t
*
p_tmp_pic
=
&
p_vout
->
p_picture
[
2
*
VOUT_MAX_PICTURES
];
if
(
p_tmp_pic
->
i_status
==
FREE_PICTURE
)
{
vout_AllocatePicture
(
VLC_OBJECT
(
p_vout
),
p_tmp_pic
,
p_vout
->
render
.
i_chroma
,
p_vout
->
render
.
i_width
,
p_vout
->
render
.
i_height
,
p_vout
->
render
.
i_aspect
);
p_tmp_pic
->
i_type
=
MEMORY_PICTURE
;
p_tmp_pic
->
i_status
=
RESERVED_PICTURE
;
}
CopyPicture
(
p_vout
,
p_pic
,
p_tmp_pic
);
vout_RenderSubPictures
(
p_vout
,
p_tmp_pic
,
p_subpic
);
CopyPicture
(
p_vout
,
p_tmp_pic
,
PP_OUTPUTPICTURE
[
0
]
);
}
else
{
CopyPicture
(
p_vout
,
p_pic
,
PP_OUTPUTPICTURE
[
0
]
);
vout_RenderSubPictures
(
p_vout
,
PP_OUTPUTPICTURE
[
0
],
p_subpic
);
}
CopyPicture
(
p_vout
,
p_pic
,
PP_OUTPUTPICTURE
[
0
]
);
vout_RenderSubPictures
(
p_vout
,
PP_OUTPUTPICTURE
[
0
],
p_pic
,
p_subpic
);
if
(
PP_OUTPUTPICTURE
[
0
]
->
pf_unlock
)
PP_OUTPUTPICTURE
[
0
]
->
pf_unlock
(
p_vout
,
PP_OUTPUTPICTURE
[
0
]
);
...
...
@@ -415,7 +384,7 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
p_vout
->
chroma
.
pf_convert
(
p_vout
,
p_pic
,
p_tmp_pic
);
/* Render subpictures on the first direct buffer */
vout_RenderSubPictures
(
p_vout
,
p_tmp_pic
,
p_subpic
);
vout_RenderSubPictures
(
p_vout
,
p_tmp_pic
,
p_
tmp_pic
,
p_
subpic
);
if
(
p_vout
->
p_picture
[
0
].
pf_lock
)
if
(
p_vout
->
p_picture
[
0
].
pf_lock
(
p_vout
,
&
p_vout
->
p_picture
[
0
]
)
)
...
...
@@ -433,7 +402,8 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
p_vout
->
chroma
.
pf_convert
(
p_vout
,
p_pic
,
&
p_vout
->
p_picture
[
0
]
);
/* Render subpictures on the first direct buffer */
vout_RenderSubPictures
(
p_vout
,
&
p_vout
->
p_picture
[
0
],
p_subpic
);
vout_RenderSubPictures
(
p_vout
,
&
p_vout
->
p_picture
[
0
],
&
p_vout
->
p_picture
[
0
],
p_subpic
);
}
if
(
p_vout
->
p_picture
[
0
].
pf_unlock
)
...
...
src/video_output/vout_subpictures.c
View file @
8826fb82
...
...
@@ -355,8 +355,8 @@ void vout_DestroySubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
*****************************************************************************
* This function renders all sub picture units in the list.
*****************************************************************************/
void
vout_RenderSubPictures
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
,
subpicture_t
*
p_subpic
)
void
vout_RenderSubPictures
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
_dst
,
picture_t
*
p_pic_src
,
subpicture_t
*
p_subpic
)
{
/* Load the blending module */
if
(
!
p_vout
->
p_blend
&&
p_subpic
&&
p_subpic
->
p_region
)
...
...
@@ -392,7 +392,7 @@ void vout_RenderSubPictures( vout_thread_t *p_vout, picture_t *p_pic,
if
(
p_subpic
->
pf_render
)
{
p_subpic
->
pf_render
(
p_vout
,
p_pic
,
p_subpic
);
p_subpic
->
pf_render
(
p_vout
,
p_pic
_dst
,
p_subpic
);
}
else
while
(
p_region
&&
p_vout
->
p_blend
&&
p_vout
->
p_blend
->
pf_video_blend
)
...
...
@@ -457,8 +457,8 @@ void vout_RenderSubPictures( vout_thread_t *p_vout, picture_t *p_pic,
p_vout
->
pi_alpha
[
3
];
}
p_vout
->
p_blend
->
pf_video_blend
(
p_vout
->
p_blend
,
p_pic
,
p_pi
c
,
&
p_region
->
picture
,
i_x_offset
,
i_y_offset
);
p_vout
->
p_blend
->
pf_video_blend
(
p_vout
->
p_blend
,
p_pic_dst
,
p_pic
_sr
c
,
&
p_region
->
picture
,
i_x_offset
,
i_y_offset
);
p_region
=
p_region
->
p_next
;
}
...
...
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