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
Hide 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)
...
@@ -135,6 +135,7 @@ destroy_surface(xvba_driver_data_t *driver_data, object_surface_p obj_surface)
}
}
// Query surface status
// Query surface status
// NOTE: also used for images
int
int
query_surface_status
(
query_surface_status
(
xvba_driver_data_t
*
driver_data
,
xvba_driver_data_t
*
driver_data
,
...
@@ -145,21 +146,22 @@ query_surface_status(
...
@@ -145,21 +146,22 @@ query_surface_status(
{
{
int
status
;
int
status
;
if
(
surface_status
)
if
(
!
surface_status
)
*
surface_status
=
VASurfaceReady
;
abort
();
/* coding error */
*
surface_status
=
0
;
if
(
!
obj_surface
)
if
(
!
obj_surface
)
return
0
;
abort
();
/* coding error */
switch
(
obj_surface
->
va_surface_status
)
{
switch
(
obj_surface
->
va_surface_status
)
{
case
VASurfaceRendering
:
/* Rendering (XvBA level) */
case
VASurfaceRendering
:
/* Rendering (XvBA level) */
ASSERT
(
obj_surface
->
used_for_decoding
);
ASSERT
(
obj_surface
->
used_for_decoding
);
if
(
!
obj_context
)
if
(
!
obj_context
)
return
0
;
goto
ok
;
/* Can be called with obj_context = NULL */
if
(
!
obj_context
->
xvba_decoder
)
if
(
!
obj_context
->
xvba_decoder
)
return
0
;
abort
();
/* coding error */
if
(
!
obj_surface
->
xvba_surface
)
if
(
!
obj_surface
->
xvba_surface
)
return
0
;
goto
ok
;
;
status
=
xvba_sync_surface
(
status
=
xvba_sync_surface
(
obj_context
->
xvba_decoder
,
obj_context
->
xvba_decoder
,
obj_surface
->
xvba_surface
,
obj_surface
->
xvba_surface
,
...
@@ -177,10 +179,21 @@ query_surface_status(
...
@@ -177,10 +179,21 @@ query_surface_status(
if
(
status
==
XVBA_COMPLETED
)
if
(
status
==
XVBA_COMPLETED
)
obj_surface
->
va_surface_status
=
VASurfaceReady
;
obj_surface
->
va_surface_status
=
VASurfaceReady
;
break
;
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
;
*
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
;
return
0
;
}
}
...
@@ -195,9 +208,10 @@ sync_surface(
...
@@ -195,9 +208,10 @@ sync_surface(
VASurfaceStatus
surface_status
;
VASurfaceStatus
surface_status
;
int
status
;
int
status
;
while
((
status
=
query_surface_status
(
driver_data
,
obj_context
,
obj_surface
,
&
surface_status
))
==
0
&&
do
{
surface_status
!=
VASurfaceReady
)
status
=
query_surface_status
(
driver_data
,
obj_context
,
obj_surface
,
&
surface_status
);
delay_usec
(
XVBA_SYNC_DELAY
);
delay_usec
(
XVBA_SYNC_DELAY
);
}
while
(
surface_status
!=
VASurfaceReady
&&
status
!=
0
);
return
status
;
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