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
5b07bd99
Commit
5b07bd99
authored
Apr 24, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vaapi: advance and simplify context allocation
parent
4b01d3cc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
modules/codec/avcodec/vaapi.c
modules/codec/avcodec/vaapi.c
+11
-14
No files found.
modules/codec/avcodec/vaapi.c
View file @
5b07bd99
...
...
@@ -93,12 +93,8 @@ static void DestroySurfaces( vlc_va_sys_t *sys )
CopyCleanCache
(
&
sys
->
image_cache
);
}
if
(
sys
->
hw_ctx
.
context_id
!=
VA_INVALID_ID
)
vaDestroyContext
(
sys
->
hw_ctx
.
display
,
sys
->
hw_ctx
.
context_id
);
/* */
sys
->
image
.
image_id
=
VA_INVALID_ID
;
sys
->
hw_ctx
.
context_id
=
VA_INVALID_ID
;
sys
->
i_surface_width
=
0
;
sys
->
i_surface_height
=
0
;
vlc_mutex_destroy
(
&
sys
->
lock
);
...
...
@@ -111,16 +107,6 @@ static int CreateSurfaces( vlc_va_sys_t *sys, void **pp_hw_ctx, vlc_fourcc_t *pi
/* */
sys
->
image
.
image_id
=
VA_INVALID_ID
;
sys
->
hw_ctx
.
context_id
=
VA_INVALID_ID
;
/* Create a context */
if
(
vaCreateContext
(
sys
->
hw_ctx
.
display
,
sys
->
hw_ctx
.
config_id
,
i_width
,
i_height
,
VA_PROGRESSIVE
,
sys
->
surfaces
,
sys
->
count
,
&
sys
->
hw_ctx
.
context_id
))
{
sys
->
hw_ctx
.
context_id
=
VA_INVALID_ID
;
goto
error
;
}
/* Find and create a supported image chroma */
int
i_fmt_count
=
vaMaxNumImageFormats
(
sys
->
hw_ctx
.
display
);
...
...
@@ -369,6 +355,7 @@ static void Delete( vlc_va_t *va, AVCodecContext *avctx )
(
void
)
avctx
;
vaDestroyContext
(
sys
->
hw_ctx
.
display
,
sys
->
hw_ctx
.
context_id
);
vaDestroySurfaces
(
sys
->
hw_ctx
.
display
,
sys
->
surfaces
,
sys
->
count
);
vaDestroyConfig
(
sys
->
hw_ctx
.
display
,
sys
->
hw_ctx
.
config_id
);
vaTerminate
(
sys
->
hw_ctx
.
display
);
...
...
@@ -534,6 +521,16 @@ static int Create( vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
goto
error
;
}
/* Create a context */
if
(
vaCreateContext
(
sys
->
hw_ctx
.
display
,
sys
->
hw_ctx
.
config_id
,
ctx
->
coded_width
,
ctx
->
coded_height
,
VA_PROGRESSIVE
,
sys
->
surfaces
,
sys
->
count
,
&
sys
->
hw_ctx
.
context_id
))
{
sys
->
hw_ctx
.
context_id
=
VA_INVALID_ID
;
vaDestroySurfaces
(
sys
->
hw_ctx
.
display
,
sys
->
surfaces
,
sys
->
count
);
goto
error
;
}
vlc_mutex_init
(
&
sys
->
lock
);
va
->
sys
=
sys
;
...
...
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