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
327d631d
Commit
327d631d
authored
Apr 24, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vaapi: do not reuse still referenced surfaces
parent
2e6b61f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
13 deletions
+4
-13
modules/codec/avcodec/vaapi.c
modules/codec/avcodec/vaapi.c
+4
-13
No files found.
modules/codec/avcodec/vaapi.c
View file @
327d631d
...
...
@@ -59,7 +59,6 @@ typedef struct
{
VASurfaceID
i_id
;
int
i_refcount
;
unsigned
int
i_order
;
vlc_mutex_t
*
p_lock
;
}
vlc_va_surface_t
;
...
...
@@ -81,7 +80,6 @@ struct vlc_va_sys_t
/* */
vlc_mutex_t
lock
;
int
i_surface_count
;
unsigned
int
i_surface_order
;
int
i_surface_width
;
int
i_surface_height
;
vlc_fourcc_t
i_surface_chroma
;
...
...
@@ -155,7 +153,6 @@ static int CreateSurfaces( vlc_va_sys_t *sys, void **pp_hw_ctx, vlc_fourcc_t *pi
p_surface
->
i_id
=
pi_surface_id
[
i
];
p_surface
->
i_refcount
=
0
;
p_surface
->
i_order
=
0
;
p_surface
->
p_lock
=
&
sys
->
lock
;
}
...
...
@@ -352,30 +349,24 @@ static int Extract( vlc_va_t *va, picture_t *p_picture, uint8_t *data )
static
int
Get
(
vlc_va_t
*
va
,
picture_t
*
pic
,
uint8_t
**
data
)
{
vlc_va_sys_t
*
sys
=
va
->
sys
;
int
i_old
;
int
i
;
vlc_mutex_lock
(
&
sys
->
lock
);
/* Grab an unused surface, in case none are, try the oldest
* XXX using the oldest is a workaround in case a problem happens with ffmpeg */
for
(
i
=
0
,
i_old
=
0
;
i
<
sys
->
i_surface_count
;
i
++
)
for
(
i
=
0
;
i
<
sys
->
i_surface_count
;
i
++
)
{
vlc_va_surface_t
*
p_surface
=
&
sys
->
p_surface
[
i
];
if
(
!
p_surface
->
i_refcount
)
break
;
if
(
p_surface
->
i_order
<
sys
->
p_surface
[
i_old
].
i_order
)
i_old
=
i
;
}
if
(
i
>=
sys
->
i_surface_count
)
i
=
i_old
;
vlc_mutex_unlock
(
&
sys
->
lock
);
if
(
i
==
sys
->
i_surface_count
)
return
VLC_ENOMEM
;
vlc_va_surface_t
*
p_surface
=
&
sys
->
p_surface
[
i
];
p_surface
->
i_refcount
=
1
;
p_surface
->
i_order
=
sys
->
i_surface_order
++
;
pic
->
context
=
p_surface
;
*
data
=
(
void
*
)(
uintptr_t
)
p_surface
->
i_id
;
return
VLC_SUCCESS
;
...
...
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