Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xvba-video
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
xvba-video
Commits
42be4519
Commit
42be4519
authored
Jun 07, 2012
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/xvba_video.c: rewrite sync_surface()
parent
140ae52b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
10 deletions
+24
-10
src/xvba_video.c
src/xvba_video.c
+24
-10
No files found.
src/xvba_video.c
View file @
42be4519
...
...
@@ -135,6 +135,7 @@ destroy_surface(xvba_driver_data_t *driver_data, object_surface_p obj_surface)
}
// Query surface status
// NOTE: also used for images
int
query_surface_status
(
xvba_driver_data_t
*
driver_data
,
...
...
@@ -145,21 +146,22 @@ query_surface_status(
{
int
status
;
if
(
surface_status
)
*
surface_status
=
VASurfaceReady
;
if
(
!
surface_status
)
abort
();
/* coding error */
*
surface_status
=
0
;
if
(
!
obj_surface
)
return
0
;
abort
();
/* coding error */
switch
(
obj_surface
->
va_surface_status
)
{
case
VASurfaceRendering
:
/* Rendering (XvBA level) */
ASSERT
(
obj_surface
->
used_for_decoding
);
if
(
!
obj_context
)
return
0
;
goto
ok
;
/* Can be called with obj_context = NULL */
if
(
!
obj_context
->
xvba_decoder
)
return
0
;
abort
();
/* coding error */
if
(
!
obj_surface
->
xvba_surface
)
return
0
;
goto
ok
;
;
status
=
xvba_sync_surface
(
obj_context
->
xvba_decoder
,
obj_surface
->
xvba_surface
,
...
...
@@ -177,11 +179,22 @@ query_surface_status(
if
(
status
==
XVBA_COMPLETED
)
obj_surface
->
va_surface_status
=
VASurfaceReady
;
break
;
default:
/* NOTE: va_surface_status could be 0 or VASurfaceSkipped
* in both cases it is safe to be used. */
if
((
obj_surface
->
va_surface_status
==
0
)
||
(
obj_surface
->
va_surface_status
==
VASurfaceSkipped
))
{
goto
ok
;
}
break
;
}
if
(
surface_status
)
*
surface_status
=
obj_surface
->
va_surface_status
;
return
0
;
ok:
/* State is safe to continue surface is not used for decoding */
*
surface_status
=
VASurfaceReady
;
return
0
;
}
// Synchronize surface
...
...
@@ -195,9 +208,10 @@ sync_surface(
VASurfaceStatus
surface_status
;
int
status
;
while
((
status
=
query_surface_status
(
driver_data
,
obj_context
,
obj_surface
,
&
surface_status
))
==
0
&&
surface_status
!=
VASurfaceReady
)
do
{
status
=
query_surface_status
(
driver_data
,
obj_context
,
obj_surface
,
&
surface_status
);
delay_usec
(
XVBA_SYNC_DELAY
);
}
while
(
surface_status
!=
VASurfaceReady
&&
status
!=
0
);
return
status
;
}
...
...
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