Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
13
Merge Requests
13
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
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
Steve Lhomme
VLC
Commits
f32044fc
Commit
f32044fc
authored
Sep 13, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vaapi: inline init and deinit functions
parent
35368806
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
37 deletions
+20
-37
modules/codec/avcodec/vaapi.c
modules/codec/avcodec/vaapi.c
+20
-37
No files found.
modules/codec/avcodec/vaapi.c
View file @
f32044fc
...
...
@@ -93,7 +93,6 @@ struct vlc_va_sys_t
bool
b_supports_derive
;
};
/* */
static
void
DestroySurfaces
(
vlc_va_sys_t
*
sys
)
{
if
(
sys
->
image
.
image_id
!=
VA_INVALID_ID
)
...
...
@@ -417,8 +416,10 @@ static int Setup( vlc_va_t *va, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,
return
VLC_EGENERIC
;
}
static
void
Close
(
vlc_va_sys_t
*
sys
)
static
void
Delete
(
vlc_va_t
*
va
)
{
vlc_va_sys_t
*
sys
=
va
->
sys
;
if
(
sys
->
i_surface_width
||
sys
->
i_surface_height
)
DestroySurfaces
(
sys
);
...
...
@@ -431,17 +432,20 @@ static void Close( vlc_va_sys_t *sys )
#ifdef VLC_VA_BACKEND_DRM
close
(
sys
->
drm_fd
);
#endif
}
static
void
Delete
(
vlc_va_t
*
va
)
{
vlc_va_sys_t
*
sys
=
va
->
sys
;
Close
(
sys
);
free
(
sys
);
}
static
int
Open
(
vlc_va_t
*
va
,
int
i_codec_id
,
int
i_thread_coun
t
)
static
int
Create
(
vlc_va_t
*
va
,
AVCodecContext
*
ctx
,
const
es_format_t
*
fm
t
)
{
(
void
)
fmt
;
#ifdef VLC_VA_BACKEND_XLIB
if
(
!
vlc_xlib_init
(
VLC_OBJECT
(
va
)
)
)
{
msg_Warn
(
va
,
"Ignoring VA-X11 API"
);
return
VLC_EGENERIC
;
}
#endif
vlc_va_sys_t
*
sys
=
calloc
(
1
,
sizeof
(
*
sys
)
);
if
(
unlikely
(
sys
==
NULL
)
)
return
VLC_ENOMEM
;
...
...
@@ -452,7 +456,7 @@ static int Open( vlc_va_t *va, int i_codec_id, int i_thread_count )
int
i_surface_count
;
/* */
switch
(
i_
codec_id
)
switch
(
ctx
->
codec_id
)
{
case
AV_CODEC_ID_MPEG1VIDEO
:
case
AV_CODEC_ID_MPEG2VIDEO
:
...
...
@@ -473,7 +477,7 @@ static int Open( vlc_va_t *va, int i_codec_id, int i_thread_count )
break
;
case
AV_CODEC_ID_H264
:
i_profile
=
VAProfileH264High
;
i_surface_count
=
16
+
i_
thread_count
+
2
;
i_surface_count
=
16
+
ctx
->
thread_count
+
2
;
break
;;
default:
free
(
sys
);
...
...
@@ -571,6 +575,11 @@ static int Open( vlc_va_t *va, int i_codec_id, int i_thread_count )
va
->
sys
=
sys
;
va
->
description
=
vaQueryVendorString
(
sys
->
p_display
);
va
->
pix_fmt
=
PIX_FMT_VAAPI_VLD
;
/* Only VLD supported */
va
->
setup
=
Setup
;
va
->
get
=
Get
;
va
->
release
=
Release
;
va
->
extract
=
Extract
;
return
VLC_SUCCESS
;
error:
...
...
@@ -588,32 +597,6 @@ error:
return
VLC_EGENERIC
;
}
static
int
Create
(
vlc_va_t
*
p_va
,
AVCodecContext
*
ctx
,
const
es_format_t
*
fmt
)
{
#ifdef VLC_VA_BACKEND_XLIB
if
(
!
vlc_xlib_init
(
VLC_OBJECT
(
p_va
)
)
)
{
msg_Warn
(
p_va
,
"Ignoring VA API"
);
return
VLC_EGENERIC
;
}
#endif
(
void
)
fmt
;
int
err
=
Open
(
p_va
,
ctx
->
codec_id
,
ctx
->
thread_count
);
if
(
err
)
return
err
;
/* Only VLD supported */
p_va
->
pix_fmt
=
PIX_FMT_VAAPI_VLD
;
p_va
->
setup
=
Setup
;
p_va
->
get
=
Get
;
p_va
->
release
=
Release
;
p_va
->
extract
=
Extract
;
return
VLC_SUCCESS
;
}
vlc_module_begin
()
#if defined (VLC_VA_BACKEND_XLIB)
set_description
(
N_
(
"VA-API video decoder via X11"
)
)
...
...
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