Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
686df8fd
Commit
686df8fd
authored
Mar 04, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vdpau_avcodec: simplify with av_vdpau_get_profile()
parent
d4d02c57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
84 deletions
+19
-84
modules/hw/vdpau/avcodec.c
modules/hw/vdpau/avcodec.c
+19
-84
No files found.
modules/hw/vdpau/avcodec.c
View file @
686df8fd
...
...
@@ -173,97 +173,32 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, const es_format_t *fmt)
{
VdpStatus
err
;
VdpDecoderProfile
profile
;
int
level
;
int
level
=
fmt
->
i_level
;
switch
(
ctx
->
codec_id
)
if
(
av_vdpau_get_profile
(
ctx
,
&
profile
)
)
{
case
AV_CODEC_ID_MPEG1VIDEO
:
profile
=
VDP_DECODER_PROFILE_MPEG1
;
level
=
VDP_DECODER_LEVEL_MPEG1_NA
;
break
;
case
AV_CODEC_ID_MPEG2VIDEO
:
switch
(
fmt
->
i_profile
)
{
case
FF_PROFILE_MPEG2_MAIN
:
profile
=
VDP_DECODER_PROFILE_MPEG2_MAIN
;
break
;
case
FF_PROFILE_MPEG2_SIMPLE
:
profile
=
VDP_DECODER_PROFILE_MPEG2_SIMPLE
;
break
;
default:
msg_Err
(
va
,
"unsupported %s profile %d"
,
"MPEG2"
,
fmt
->
i_profile
);
return
VLC_EGENERIC
;
}
level
=
VDP_DECODER_LEVEL_MPEG2_HL
;
break
;
case
AV_CODEC_ID_H263
:
profile
=
VDP_DECODER_PROFILE_MPEG4_PART2_ASP
;
level
=
VDP_DECODER_LEVEL_MPEG4_PART2_ASP_L5
;
break
;
case
AV_CODEC_ID_MPEG4
:
switch
(
fmt
->
i_profile
)
{
case
FF_PROFILE_MPEG4_SIMPLE
:
profile
=
VDP_DECODER_PROFILE_MPEG4_PART2_SP
;
break
;
case
FF_PROFILE_MPEG4_ADVANCED_SIMPLE
:
profile
=
VDP_DECODER_PROFILE_MPEG4_PART2_ASP
;
break
;
default:
msg_Err
(
va
,
"unsupported %s profile %d"
,
"MPEG4"
,
fmt
->
i_profile
);
return
VLC_EGENERIC
;
}
level
=
fmt
->
i_level
;
break
;
msg_Err
(
va
,
"unsupported codec %d or profile %d"
,
ctx
->
codec_id
,
fmt
->
i_profile
);
return
VLC_EGENERIC
;
}
case
AV_CODEC_ID_H264
:
switch
(
fmt
->
i_profile
&
~
(
FF_PROFILE_H264_CONSTRAINED
|
FF_PROFILE_H264_INTRA
))
{
case
FF_PROFILE_H264_BASELINE
:
profile
=
VDP_DECODER_PROFILE_H264_BASELINE
;
switch
(
ctx
->
codec_id
)
{
case
AV_CODEC_ID_MPEG1VIDEO
:
level
=
VDP_DECODER_LEVEL_MPEG1_NA
;
break
;
case
FF_PROFILE_H264_MAIN
:
profile
=
VDP_DECODER_PROFILE_H264_MAIN
;
case
AV_CODEC_ID_MPEG2VIDEO
:
level
=
VDP_DECODER_LEVEL_MPEG2_HL
;
break
;
case
FF_PROFILE_H264_HIGH
:
profile
=
VDP_DECODER_PROFILE_H264_HIGH
;
case
AV_CODEC_ID_H263
:
level
=
VDP_DECODER_LEVEL_MPEG4_PART2_ASP_L5
;
break
;
case
FF_PROFILE_H264_EXTENDED
:
default:
msg_Err
(
va
,
"unsupported %s profile %d"
,
"H.264"
,
fmt
->
i_profile
);
return
VLC_EGENERIC
;
}
level
=
fmt
->
i_level
;
if
((
fmt
->
i_profile
&
FF_PROFILE_H264_INTRA
)
&&
(
fmt
->
i_level
==
11
))
level
=
VDP_DECODER_LEVEL_H264_1b
;
break
;
case
AV_CODEC_ID_WMV3
:
case
AV_CODEC_ID_VC1
:
switch
(
fmt
->
i_profile
)
{
case
FF_PROFILE_VC1_SIMPLE
:
profile
=
VDP_DECODER_PROFILE_VC1_SIMPLE
;
case
AV_CODEC_ID_H264
:
if
((
fmt
->
i_profile
&
FF_PROFILE_H264_INTRA
)
&&
(
fmt
->
i_level
==
11
))
level
=
VDP_DECODER_LEVEL_H264_1b
;
default:
break
;
case
FF_PROFILE_VC1_MAIN
:
profile
=
VDP_DECODER_PROFILE_VC1_MAIN
;
break
;
case
FF_PROFILE_VC1_ADVANCED
:
profile
=
VDP_DECODER_PROFILE_VC1_ADVANCED
;
break
;
default:
msg_Err
(
va
,
"unsupported %s profile %d"
,
"VC-1"
,
fmt
->
i_profile
);
return
VLC_EGENERIC
;
}
level
=
fmt
->
i_level
;
break
;
default:
msg_Err
(
va
,
"unknown codec %d"
,
ctx
->
codec_id
);
return
VLC_EGENERIC
;
}
if
(
!
vlc_xlib_init
(
VLC_OBJECT
(
va
)))
...
...
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