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
dea831a9
Commit
dea831a9
authored
Nov 29, 2011
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VAAPI-X11: cleanup
parent
f5b05c6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
25 deletions
+15
-25
modules/codec/avcodec/vaapi_x11.c
modules/codec/avcodec/vaapi_x11.c
+15
-25
No files found.
modules/codec/avcodec/vaapi_x11.c
View file @
dea831a9
...
...
@@ -762,6 +762,7 @@ static int SubpictureRegionsLink(vout_display_t *vd, const picture_t *picture)
assert
(
cache
->
i_id
>
0
);
const
int
count
=
vlc_array_count
(
&
cache
->
subpictures
);
msg_Info
(
vd
,
"Subpicture cache count %d"
,
vlc_array_count
(
&
sys
->
cache
));
#ifdef VAAPI_DEBUG
msg_Dbg
(
vd
,
"link surface %d cache %d size %d"
,
surface
->
i_id
,
cache
->
i_id
,
count
);
...
...
@@ -818,7 +819,7 @@ static int SubpictureRegionsLink(vout_display_t *vd, const picture_t *picture)
cleanup:
/* Cleanup linked subpictures */
msg_
Warn
(
vd
,
"unlink surface %d cache %d"
,
surface
->
i_id
,
cache
->
i_id
);
msg_
Err
(
vd
,
"unlink surface %d cache %d"
,
surface
->
i_id
,
cache
->
i_id
);
for
(
int
i
=
0
;
i
<
i_sub
;
i
++
)
{
vasubpicture_cache_t
*
sub
=
vlc_array_item_at_index
(
&
cache
->
subpictures
,
i
);
...
...
@@ -852,6 +853,8 @@ static void SubpictureRegionsUnlink(vout_display_t *vd, picture_t *picture)
vlc_mutex_lock
(
&
sys
->
cache_lock
);
assert
(
surface
->
i_cache
>
0
);
subpicture_cache_t
*
cache
=
cache_find
(
&
sys
->
cache
,
surface
->
i_cache
);
if
(
cache
==
NULL
)
goto
error
;
...
...
@@ -1040,7 +1043,8 @@ static int RenderDirectSubpicture(vout_display_t *vd, picture_t *picture, subpic
cache
->
i_stop
=
subpicture
->
i_stop
;
#ifdef VAAPI_DEBUG
msg_Dbg
(
vd
,
"creating surface %d cache %d"
,
surface
->
i_id
,
cache
->
i_id
);
msg_Dbg
(
vd
,
"new subpicture %p prev %p cache %d surface %d"
,
subpicture
,
sys
->
render
.
prev_subpicture
,
cache
->
i_id
,
surface
->
i_id
);
#endif
int
i_sub
=
0
;
...
...
@@ -1113,7 +1117,8 @@ static int RenderDirectSubpicture(vout_display_t *vd, picture_t *picture, subpic
cleanup:
surface
->
i_cache
=
VA_INVALID_ID
;
msg_Err
(
vd
,
"failed creating surface %d cache %d"
,
surface
->
i_id
,
cache
->
i_id
);
msg_Err
(
vd
,
"failed creating subpicture cache %d for surface %d"
,
cache
->
i_id
,
surface
->
i_id
);
SubpictureCacheClean
(
vd
,
sys
->
conn
,
cache
);
cache_destroy
(
cache
);
cache
=
NULL
;
...
...
@@ -1128,35 +1133,26 @@ static int RenderCachedSubpictures(vout_display_t *vd, picture_t *picture,
assert
(
picture
);
assert
(
subpicture
);
picture_sys_t
*
surface
=
picture
->
p_sys
;
vlc_mutex_lock
(
&
sys
->
cache_lock
);
#ifdef VAAPI_DEBUG
msg_Dbg
(
vd
,
"reuse subpicture %p prev %p cache %d"
,
msg_Dbg
(
vd
,
"reuse subpicture %p prev %p cache %d
surface %d
"
,
subpicture
,
sys
->
render
.
prev_subpicture
,
sys
->
render
.
i_cache
);
sys
->
render
.
i_cache
,
surface
->
i_id
);
#endif
subpicture_cache_t
*
cache
=
(
subpicture_cache_t
*
)
cache_find
(
&
sys
->
cache
,
sys
->
render
.
i_cache
);
if
(
cache
==
NULL
)
{
msg_Dbg
(
vd
,
"did not find cached subpictures, resetting"
);
sys
->
render
.
i_cache
=
0
;
goto
cleanup
;
}
assert
(
cache
->
i_id
>
0
);
if
((
cache
->
i_start
!=
subpicture
->
i_start
)
&&
(
cache
->
i_stop
!=
subpicture
->
i_stop
))
{
msg_Dbg
(
vd
,
"different cached subpictures, resetting"
);
goto
cleanup
;
}
/* Check if all subpictures region pictures match */
const
int
count
=
vlc_array_count
(
&
cache
->
subpictures
);
#ifdef VAAPI_DEBUG
msg_Dbg
(
vd
,
"reuse surface %d cache %d size %d"
,
surface
->
i_id
,
cache
->
i_id
,
count
);
#endif
int
i_sub
=
0
;
subpicture_region_t
*
region
;
for
(
region
=
subpicture
->
p_region
;
region
!=
NULL
;
region
=
region
->
p_next
)
...
...
@@ -1196,6 +1192,8 @@ static int RenderCachedSubpictures(vout_display_t *vd, picture_t *picture,
cleanup:
/* Cannot reuse this cached subpicture */
msg_Err
(
vd
,
"cannot reuse cached subpicture %d for surface %d -- resetting"
,
cache
->
i_id
,
surface
->
i_id
);
sys
->
render
.
i_cache
=
0
;
sys
->
render
.
prev_subpicture
=
NULL
;
vlc_mutex_unlock
(
&
sys
->
cache_lock
);
...
...
@@ -1223,9 +1221,7 @@ static void Render(vout_display_t *vd, picture_t *picture, subpicture_t *subpict
{
/* Skip non-RGBA regions for now */
if
(
region
->
fmt
.
i_chroma
==
VLC_CODEC_RGBA
)
{
i_region
++
;
}
}
if
(
i_region
==
0
)
...
...
@@ -1243,14 +1239,8 @@ again:
}
else
{
#ifdef VAAPI_DEBUG
msg_Dbg
(
vd
,
"new subpicture %p prev %p"
,
subpicture
,
sys
->
render
.
prev_subpicture
);
#endif
if
(
RenderDirectSubpicture
(
vd
,
picture
,
subpicture
)
!=
VLC_SUCCESS
)
{
msg_Err
(
vd
,
"failed rendering subtitles"
);
return
;
}
sys
->
render
.
prev_subpicture
=
subpicture
;
sys
->
render
.
i_start
=
subpicture
->
i_start
;
sys
->
render
.
i_stop
=
subpicture
->
i_stop
;
...
...
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