Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
bef067f8
Commit
bef067f8
authored
Oct 04, 2014
by
Rémi Denis-Courmont
Committed by
Anton Khirnov
Oct 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vdpau: check video surface and decoder capabilities
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
e3e158e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
vdpau.c
libavcodec/vdpau.c
+40
-0
No files found.
libavcodec/vdpau.c
View file @
bef067f8
...
...
@@ -69,9 +69,13 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile,
{
VDPAUHWContext
*
hwctx
=
avctx
->
hwaccel_context
;
VDPAUContext
*
vdctx
=
avctx
->
internal
->
hwaccel_priv_data
;
VdpVideoSurfaceQueryCapabilities
*
surface_query_caps
;
VdpDecoderQueryCapabilities
*
decoder_query_caps
;
VdpDecoderCreate
*
create
;
void
*
func
;
VdpStatus
status
;
VdpBool
supported
;
uint32_t
max_level
,
max_mb
,
max_width
,
max_height
;
/* See vdpau/vdpau.h for alignment constraints. */
uint32_t
width
=
(
avctx
->
coded_width
+
1
)
&
~
1
;
uint32_t
height
=
(
avctx
->
coded_height
+
3
)
&
~
3
;
...
...
@@ -90,6 +94,42 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile,
vdctx
->
device
=
hwctx
->
device
;
vdctx
->
get_proc_address
=
hwctx
->
get_proc_address
;
if
(
level
<
0
)
return
AVERROR
(
ENOTSUP
);
status
=
vdctx
->
get_proc_address
(
vdctx
->
device
,
VDP_FUNC_ID_VIDEO_SURFACE_QUERY_CAPABILITIES
,
&
func
);
if
(
status
!=
VDP_STATUS_OK
)
return
vdpau_error
(
status
);
else
surface_query_caps
=
func
;
status
=
surface_query_caps
(
vdctx
->
device
,
VDP_CHROMA_TYPE_420
,
&
supported
,
&
max_width
,
&
max_height
);
if
(
status
!=
VDP_STATUS_OK
)
return
vdpau_error
(
status
);
if
(
supported
!=
VDP_TRUE
||
max_width
<
width
||
max_height
<
height
)
return
AVERROR
(
ENOTSUP
);
status
=
vdctx
->
get_proc_address
(
vdctx
->
device
,
VDP_FUNC_ID_DECODER_QUERY_CAPABILITIES
,
&
func
);
if
(
status
!=
VDP_STATUS_OK
)
return
vdpau_error
(
status
);
else
decoder_query_caps
=
func
;
status
=
decoder_query_caps
(
vdctx
->
device
,
profile
,
&
supported
,
&
max_level
,
&
max_mb
,
&
max_width
,
&
max_height
);
if
(
status
!=
VDP_STATUS_OK
)
return
vdpau_error
(
status
);
if
(
supported
!=
VDP_TRUE
||
max_level
<
level
||
max_width
<
width
||
max_height
<
height
)
return
AVERROR
(
ENOTSUP
);
status
=
vdctx
->
get_proc_address
(
vdctx
->
device
,
VDP_FUNC_ID_DECODER_CREATE
,
&
func
);
if
(
status
!=
VDP_STATUS_OK
)
...
...
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