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
89ac99ba
Commit
89ac99ba
authored
Oct 04, 2014
by
Rémi Denis-Courmont
Committed by
Anton Khirnov
Oct 05, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vdpau: pass codec-specific parameters from hwaccel
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
ce083282
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
119 additions
and
2 deletions
+119
-2
vdpau.c
libavcodec/vdpau.c
+2
-2
vdpau_h264.c
libavcodec/vdpau_h264.c
+30
-0
vdpau_mpeg12.c
libavcodec/vdpau_mpeg12.c
+30
-0
vdpau_mpeg4.c
libavcodec/vdpau_mpeg4.c
+30
-0
vdpau_vc1.c
libavcodec/vdpau_vc1.c
+27
-0
No files found.
libavcodec/vdpau.c
View file @
89ac99ba
...
@@ -139,11 +139,11 @@ int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx,
...
@@ -139,11 +139,11 @@ int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx,
int
ff_vdpau_common_end_frame
(
AVCodecContext
*
avctx
,
AVFrame
*
frame
,
int
ff_vdpau_common_end_frame
(
AVCodecContext
*
avctx
,
AVFrame
*
frame
,
struct
vdpau_picture_context
*
pic_ctx
)
struct
vdpau_picture_context
*
pic_ctx
)
{
{
AVVDPAUContext
*
hwctx
=
avctx
->
hwaccel_context
;
VDPAUContext
*
vdctx
=
avctx
->
internal
->
hwaccel_priv_data
;
VdpVideoSurface
surf
=
ff_vdpau_get_surface_id
(
frame
);
VdpVideoSurface
surf
=
ff_vdpau_get_surface_id
(
frame
);
VdpStatus
status
;
VdpStatus
status
;
status
=
hwctx
->
render
(
hw
ctx
->
decoder
,
surf
,
(
void
*
)
&
pic_ctx
->
info
,
status
=
vdctx
->
render
(
vd
ctx
->
decoder
,
surf
,
(
void
*
)
&
pic_ctx
->
info
,
pic_ctx
->
bitstream_buffers_used
,
pic_ctx
->
bitstream_buffers_used
,
pic_ctx
->
bitstream_buffers
);
pic_ctx
->
bitstream_buffers
);
...
...
libavcodec/vdpau_h264.c
View file @
89ac99ba
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include <vdpau/vdpau.h>
#include <vdpau/vdpau.h>
#include "avcodec.h"
#include "avcodec.h"
#include "internal.h"
#include "h264.h"
#include "h264.h"
#include "mpegutils.h"
#include "mpegutils.h"
#include "vdpau.h"
#include "vdpau.h"
...
@@ -202,6 +203,32 @@ static int vdpau_h264_end_frame(AVCodecContext *avctx)
...
@@ -202,6 +203,32 @@ static int vdpau_h264_end_frame(AVCodecContext *avctx)
return
0
;
return
0
;
}
}
static
int
vdpau_h264_init
(
AVCodecContext
*
avctx
)
{
VdpDecoderProfile
profile
;
uint32_t
level
=
avctx
->
level
;
switch
(
avctx
->
profile
&
~
FF_PROFILE_H264_INTRA
)
{
case
FF_PROFILE_H264_CONSTRAINED_BASELINE
:
case
FF_PROFILE_H264_BASELINE
:
profile
=
VDP_DECODER_PROFILE_H264_BASELINE
;
break
;
case
FF_PROFILE_H264_MAIN
:
profile
=
VDP_DECODER_PROFILE_H264_MAIN
;
break
;
case
FF_PROFILE_H264_HIGH
:
profile
=
VDP_DECODER_PROFILE_H264_HIGH
;
break
;
default:
return
AVERROR
(
ENOTSUP
);
}
if
((
avctx
->
profile
&
FF_PROFILE_H264_INTRA
)
&&
avctx
->
level
==
11
)
level
=
VDP_DECODER_LEVEL_H264_1b
;
return
ff_vdpau_common_init
(
avctx
,
profile
,
level
);
}
AVHWAccel
ff_h264_vdpau_hwaccel
=
{
AVHWAccel
ff_h264_vdpau_hwaccel
=
{
.
name
=
"h264_vdpau"
,
.
name
=
"h264_vdpau"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
...
@@ -211,4 +238,7 @@ AVHWAccel ff_h264_vdpau_hwaccel = {
...
@@ -211,4 +238,7 @@ AVHWAccel ff_h264_vdpau_hwaccel = {
.
end_frame
=
vdpau_h264_end_frame
,
.
end_frame
=
vdpau_h264_end_frame
,
.
decode_slice
=
vdpau_h264_decode_slice
,
.
decode_slice
=
vdpau_h264_decode_slice
,
.
frame_priv_data_size
=
sizeof
(
struct
vdpau_picture_context
),
.
frame_priv_data_size
=
sizeof
(
struct
vdpau_picture_context
),
.
init
=
vdpau_h264_init
,
.
uninit
=
ff_vdpau_common_uninit
,
.
priv_data_size
=
sizeof
(
VDPAUContext
),
};
};
libavcodec/vdpau_mpeg12.c
View file @
89ac99ba
...
@@ -95,6 +95,12 @@ static int vdpau_mpeg_decode_slice(AVCodecContext *avctx,
...
@@ -95,6 +95,12 @@ static int vdpau_mpeg_decode_slice(AVCodecContext *avctx,
}
}
#if CONFIG_MPEG1_VDPAU_HWACCEL
#if CONFIG_MPEG1_VDPAU_HWACCEL
static
int
vdpau_mpeg1_init
(
AVCodecContext
*
avctx
)
{
return
ff_vdpau_common_init
(
avctx
,
VDP_DECODER_PROFILE_MPEG1
,
VDP_DECODER_LEVEL_MPEG1_NA
);
}
AVHWAccel
ff_mpeg1_vdpau_hwaccel
=
{
AVHWAccel
ff_mpeg1_vdpau_hwaccel
=
{
.
name
=
"mpeg1_vdpau"
,
.
name
=
"mpeg1_vdpau"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
...
@@ -104,10 +110,31 @@ AVHWAccel ff_mpeg1_vdpau_hwaccel = {
...
@@ -104,10 +110,31 @@ AVHWAccel ff_mpeg1_vdpau_hwaccel = {
.
end_frame
=
ff_vdpau_mpeg_end_frame
,
.
end_frame
=
ff_vdpau_mpeg_end_frame
,
.
decode_slice
=
vdpau_mpeg_decode_slice
,
.
decode_slice
=
vdpau_mpeg_decode_slice
,
.
frame_priv_data_size
=
sizeof
(
struct
vdpau_picture_context
),
.
frame_priv_data_size
=
sizeof
(
struct
vdpau_picture_context
),
.
init
=
vdpau_mpeg1_init
,
.
uninit
=
ff_vdpau_common_uninit
,
.
priv_data_size
=
sizeof
(
VDPAUContext
),
};
};
#endif
#endif
#if CONFIG_MPEG2_VDPAU_HWACCEL
#if CONFIG_MPEG2_VDPAU_HWACCEL
static
int
vdpau_mpeg2_init
(
AVCodecContext
*
avctx
)
{
VdpDecoderProfile
profile
;
switch
(
avctx
->
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:
return
AVERROR
(
EINVAL
);
}
return
ff_vdpau_common_init
(
avctx
,
profile
,
VDP_DECODER_LEVEL_MPEG2_HL
);
}
AVHWAccel
ff_mpeg2_vdpau_hwaccel
=
{
AVHWAccel
ff_mpeg2_vdpau_hwaccel
=
{
.
name
=
"mpeg2_vdpau"
,
.
name
=
"mpeg2_vdpau"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
...
@@ -117,5 +144,8 @@ AVHWAccel ff_mpeg2_vdpau_hwaccel = {
...
@@ -117,5 +144,8 @@ AVHWAccel ff_mpeg2_vdpau_hwaccel = {
.
end_frame
=
ff_vdpau_mpeg_end_frame
,
.
end_frame
=
ff_vdpau_mpeg_end_frame
,
.
decode_slice
=
vdpau_mpeg_decode_slice
,
.
decode_slice
=
vdpau_mpeg_decode_slice
,
.
frame_priv_data_size
=
sizeof
(
struct
vdpau_picture_context
),
.
frame_priv_data_size
=
sizeof
(
struct
vdpau_picture_context
),
.
init
=
vdpau_mpeg2_init
,
.
uninit
=
ff_vdpau_common_uninit
,
.
priv_data_size
=
sizeof
(
VDPAUContext
),
};
};
#endif
#endif
libavcodec/vdpau_mpeg4.c
View file @
89ac99ba
...
@@ -89,6 +89,12 @@ static int vdpau_mpeg4_decode_slice(av_unused AVCodecContext *avctx,
...
@@ -89,6 +89,12 @@ static int vdpau_mpeg4_decode_slice(av_unused AVCodecContext *avctx,
}
}
#if CONFIG_H263_VDPAU_HWACCEL
#if CONFIG_H263_VDPAU_HWACCEL
static
int
vdpau_h263_init
(
AVCodecContext
*
avctx
)
{
return
ff_vdpau_common_init
(
avctx
,
VDP_DECODER_PROFILE_MPEG4_PART2_ASP
,
VDP_DECODER_LEVEL_MPEG4_PART2_ASP_L5
);
}
AVHWAccel
ff_h263_vdpau_hwaccel
=
{
AVHWAccel
ff_h263_vdpau_hwaccel
=
{
.
name
=
"h263_vdpau"
,
.
name
=
"h263_vdpau"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
...
@@ -98,10 +104,31 @@ AVHWAccel ff_h263_vdpau_hwaccel = {
...
@@ -98,10 +104,31 @@ AVHWAccel ff_h263_vdpau_hwaccel = {
.
end_frame
=
ff_vdpau_mpeg_end_frame
,
.
end_frame
=
ff_vdpau_mpeg_end_frame
,
.
decode_slice
=
vdpau_mpeg4_decode_slice
,
.
decode_slice
=
vdpau_mpeg4_decode_slice
,
.
frame_priv_data_size
=
sizeof
(
struct
vdpau_picture_context
),
.
frame_priv_data_size
=
sizeof
(
struct
vdpau_picture_context
),
.
init
=
vdpau_h263_init
,
.
uninit
=
ff_vdpau_common_uninit
,
.
priv_data_size
=
sizeof
(
VDPAUContext
),
};
};
#endif
#endif
#if CONFIG_MPEG4_VDPAU_HWACCEL
#if CONFIG_MPEG4_VDPAU_HWACCEL
static
int
vdpau_mpeg4_init
(
AVCodecContext
*
avctx
)
{
VdpDecoderProfile
profile
;
switch
(
avctx
->
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:
return
AVERROR
(
ENOTSUP
);
}
return
ff_vdpau_common_init
(
avctx
,
profile
,
avctx
->
level
);
}
AVHWAccel
ff_mpeg4_vdpau_hwaccel
=
{
AVHWAccel
ff_mpeg4_vdpau_hwaccel
=
{
.
name
=
"mpeg4_vdpau"
,
.
name
=
"mpeg4_vdpau"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
...
@@ -111,5 +138,8 @@ AVHWAccel ff_mpeg4_vdpau_hwaccel = {
...
@@ -111,5 +138,8 @@ AVHWAccel ff_mpeg4_vdpau_hwaccel = {
.
end_frame
=
ff_vdpau_mpeg_end_frame
,
.
end_frame
=
ff_vdpau_mpeg_end_frame
,
.
decode_slice
=
vdpau_mpeg4_decode_slice
,
.
decode_slice
=
vdpau_mpeg4_decode_slice
,
.
frame_priv_data_size
=
sizeof
(
struct
vdpau_picture_context
),
.
frame_priv_data_size
=
sizeof
(
struct
vdpau_picture_context
),
.
init
=
vdpau_mpeg4_init
,
.
uninit
=
ff_vdpau_common_uninit
,
.
priv_data_size
=
sizeof
(
VDPAUContext
),
};
};
#endif
#endif
libavcodec/vdpau_vc1.c
View file @
89ac99ba
...
@@ -109,6 +109,27 @@ static int vdpau_vc1_decode_slice(AVCodecContext *avctx,
...
@@ -109,6 +109,27 @@ static int vdpau_vc1_decode_slice(AVCodecContext *avctx,
return
0
;
return
0
;
}
}
static
int
vdpau_vc1_init
(
AVCodecContext
*
avctx
)
{
VdpDecoderProfile
profile
;
switch
(
avctx
->
profile
)
{
case
FF_PROFILE_VC1_SIMPLE
:
profile
=
VDP_DECODER_PROFILE_VC1_SIMPLE
;
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:
return
AVERROR
(
ENOTSUP
);
}
return
ff_vdpau_common_init
(
avctx
,
profile
,
avctx
->
level
);
}
#if CONFIG_WMV3_VDPAU_HWACCEL
#if CONFIG_WMV3_VDPAU_HWACCEL
AVHWAccel
ff_wmv3_vdpau_hwaccel
=
{
AVHWAccel
ff_wmv3_vdpau_hwaccel
=
{
.
name
=
"wm3_vdpau"
,
.
name
=
"wm3_vdpau"
,
...
@@ -119,6 +140,9 @@ AVHWAccel ff_wmv3_vdpau_hwaccel = {
...
@@ -119,6 +140,9 @@ AVHWAccel ff_wmv3_vdpau_hwaccel = {
.
end_frame
=
ff_vdpau_mpeg_end_frame
,
.
end_frame
=
ff_vdpau_mpeg_end_frame
,
.
decode_slice
=
vdpau_vc1_decode_slice
,
.
decode_slice
=
vdpau_vc1_decode_slice
,
.
frame_priv_data_size
=
sizeof
(
struct
vdpau_picture_context
),
.
frame_priv_data_size
=
sizeof
(
struct
vdpau_picture_context
),
.
init
=
vdpau_vc1_init
,
.
uninit
=
ff_vdpau_common_uninit
,
.
priv_data_size
=
sizeof
(
VDPAUContext
),
};
};
#endif
#endif
...
@@ -131,4 +155,7 @@ AVHWAccel ff_vc1_vdpau_hwaccel = {
...
@@ -131,4 +155,7 @@ AVHWAccel ff_vc1_vdpau_hwaccel = {
.
end_frame
=
ff_vdpau_mpeg_end_frame
,
.
end_frame
=
ff_vdpau_mpeg_end_frame
,
.
decode_slice
=
vdpau_vc1_decode_slice
,
.
decode_slice
=
vdpau_vc1_decode_slice
,
.
frame_priv_data_size
=
sizeof
(
struct
vdpau_picture_context
),
.
frame_priv_data_size
=
sizeof
(
struct
vdpau_picture_context
),
.
init
=
vdpau_vc1_init
,
.
uninit
=
ff_vdpau_common_uninit
,
.
priv_data_size
=
sizeof
(
VDPAUContext
),
};
};
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