Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
92f80c3f
Commit
92f80c3f
authored
Jun 28, 2013
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VAAPI: cleanup and small improvements.
parent
848a0b43
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
21 deletions
+27
-21
modules/codec/avcodec/va.c
modules/codec/avcodec/va.c
+2
-0
modules/codec/avcodec/vaapi.c
modules/codec/avcodec/vaapi.c
+22
-14
modules/video_output/vaapi/glx.c
modules/video_output/vaapi/glx.c
+3
-7
No files found.
modules/codec/avcodec/va.c
View file @
92f80c3f
...
...
@@ -49,6 +49,8 @@
#include "va.h"
#include "vaapi.h"
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
static
vlc_mutex_t
vlc_va_conn_lock
=
VLC_STATIC_MUTEX
;
static
vlc_va_conn_t
vlc_va_conn
;
...
...
modules/codec/avcodec/vaapi.c
View file @
92f80c3f
...
...
@@ -395,11 +395,19 @@ static int CreateDecodingContext( vlc_va_sys_t *p_va, void **pp_hw_ctx, vlc_four
p_va
->
image
.
image_id
=
VA_INVALID_ID
;
continue
;
}
bool
b_workaround
=
false
;
const
char
*
psz_driver
=
getenv
(
"VDPAU_DRIVER"
);
if
(
psz_driver
&&
(
strcmp
(
psz_driver
,
"via"
)
==
0
)
)
b_workaround
=
true
;
/* Validate that vaGetImage works with this format */
if
(
vaGetImage
(
p_va
->
conn
->
p_display
,
p_va
->
conn
->
pool
.
p_surfaces
[
0
].
i_id
,
0
,
0
,
i_width
,
i_height
,
p_va
->
image
.
image_id
)
)
VAStatus
err
;
err
=
vaGetImage
(
p_va
->
conn
->
p_display
,
p_va
->
conn
->
pool
.
p_surfaces
[
0
].
i_id
,
0
,
0
,
i_width
,
i_height
,
p_va
->
image
.
image_id
);
if
(
err
!=
VA_STATUS_SUCCESS
&&
!
b_workaround
)
{
vaDestroyImage
(
p_va
->
conn
->
p_display
,
p_va
->
image
.
image_id
);
p_va
->
image
.
image_id
=
VA_INVALID_ID
;
...
...
@@ -555,23 +563,24 @@ static void Put(vlc_va_t *p_external, AVFrame *p_ff, picture_t *p_picture )
{
vlc_va_sys_t
*
p_va
=
p_external
->
sys
;
p_va
->
conn
->
lock
();
for
(
unsigned
i
=
0
;
i
<
AV_NUM_DATA_POINTERS
;
i
++
)
{
p_ff
->
data
[
i
]
=
NULL
;
p_ff
->
linesize
[
i
]
=
0
;
}
if
(
!
p_picture
->
p_sys
)
abort
();
p_va
->
conn
->
lock
();
picture_sys_t
*
p_surface
=
p_picture
->
p_sys
;
assert
(
p_surface
->
i_refcount
==
2
);
/* */
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
p_ff
->
data
[
i
]
=
NULL
;
p_ff
->
linesize
[
i
]
=
0
;
if
(
i
==
0
||
i
==
3
)
p_ff
->
data
[
i
]
=
(
void
*
)(
uintptr_t
)
p_surface
->
i_id
;
/* Yummie */
}
p_ff
->
data
[
0
]
=
(
void
*
)(
uintptr_t
)
p_surface
->
i_id
;
/* must be non-NULL */
p_ff
->
data
[
3
]
=
(
void
*
)(
uintptr_t
)
p_surface
->
i_id
;
p_ff
->
opaque
=
(
void
*
)
p_picture
;
p_va
->
conn
->
unlock
();
}
...
...
@@ -725,4 +734,3 @@ static int Create( vlc_va_t *p_va, int i_codec_id, const es_format_t *fmt )
p_va
->
query
=
QuerySurfaceReady
;
return
VLC_SUCCESS
;
}
modules/video_output/vaapi/glx.c
View file @
92f80c3f
...
...
@@ -236,8 +236,8 @@ static int InitializeGLXv13(vout_display_t *vd)
}
sys
->
glwin
=
None
;
if
(
!
CreateWindow
(
vd
,
sys
->
embed
,
sys
->
conn
,
depth
,
0
/* ??? */
,
width
,
height
,
&
sys
->
window
))
if
(
CreateWindow
(
vd
,
sys
->
embed
,
sys
->
conn
,
depth
,
0
/* ??? */
,
width
,
height
,
&
sys
->
window
)
==
VLC_SUCCESS
)
sys
->
glwin
=
glXCreateWindow
(
dpy
,
conf
,
sys
->
window
,
NULL
);
if
(
sys
->
glwin
==
None
)
{
...
...
@@ -560,11 +560,7 @@ int OpenVaapiGLX(vlc_object_t *obj)
CloseVaapiGLX
(
obj
);
return
VLC_EGENERIC
;
}
#if 1
/* DEBUG CODE */
msg_Dbg
(
vd
,
"video output format size %d x %d (%d x %d)"
,
vd
->
fmt
.
i_width
,
vd
->
fmt
.
i_height
,
vd
->
fmt
.
i_visible_width
,
vd
->
fmt
.
i_visible_height
);
#endif
/* */
vout_display_info_t
info
=
vd
->
info
;
info
.
is_slow
=
false
;
...
...
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