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
8de1d679
Commit
8de1d679
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
avconv_vdpau: update to new VDPAU interface
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
bef067f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
43 deletions
+2
-43
avconv_vdpau.c
avconv_vdpau.c
+2
-43
No files found.
avconv_vdpau.c
View file @
8de1d679
...
...
@@ -42,9 +42,6 @@ typedef struct VDPAUContext {
VdpGetErrorString
*
get_error_string
;
VdpGetInformationString
*
get_information_string
;
VdpDeviceDestroy
*
device_destroy
;
VdpDecoderCreate
*
decoder_create
;
VdpDecoderDestroy
*
decoder_destroy
;
VdpDecoderRender
*
decoder_render
;
VdpVideoSurfaceCreate
*
video_surface_create
;
VdpVideoSurfaceDestroy
*
video_surface_destroy
;
VdpVideoSurfaceGetBitsYCbCr
*
video_surface_get_bits
;
...
...
@@ -66,9 +63,6 @@ static void vdpau_uninit(AVCodecContext *s)
ist
->
hwaccel_get_buffer
=
NULL
;
ist
->
hwaccel_retrieve_data
=
NULL
;
if
(
ctx
->
decoder_destroy
)
ctx
->
decoder_destroy
(
ctx
->
decoder
);
if
(
ctx
->
device_destroy
)
ctx
->
device_destroy
(
ctx
->
device
);
...
...
@@ -190,7 +184,6 @@ static int vdpau_alloc(AVCodecContext *s)
{
InputStream
*
ist
=
s
->
opaque
;
int
loglevel
=
(
ist
->
hwaccel_id
==
HWACCEL_AUTO
)
?
AV_LOG_VERBOSE
:
AV_LOG_ERROR
;
AVVDPAUContext
*
vdpau_ctx
;
VDPAUContext
*
ctx
;
const
char
*
display
,
*
vendor
;
VdpStatus
err
;
...
...
@@ -239,9 +232,6 @@ do {
GET_CALLBACK
(
VDP_FUNC_ID_GET_ERROR_STRING
,
get_error_string
);
GET_CALLBACK
(
VDP_FUNC_ID_GET_INFORMATION_STRING
,
get_information_string
);
GET_CALLBACK
(
VDP_FUNC_ID_DEVICE_DESTROY
,
device_destroy
);
GET_CALLBACK
(
VDP_FUNC_ID_DECODER_CREATE
,
decoder_create
);
GET_CALLBACK
(
VDP_FUNC_ID_DECODER_DESTROY
,
decoder_destroy
);
GET_CALLBACK
(
VDP_FUNC_ID_DECODER_RENDER
,
decoder_render
);
GET_CALLBACK
(
VDP_FUNC_ID_VIDEO_SURFACE_CREATE
,
video_surface_create
);
GET_CALLBACK
(
VDP_FUNC_ID_VIDEO_SURFACE_DESTROY
,
video_surface_destroy
);
GET_CALLBACK
(
VDP_FUNC_ID_VIDEO_SURFACE_GET_BITS_Y_CB_CR
,
video_surface_get_bits
);
...
...
@@ -270,12 +260,8 @@ do {
ctx
->
vdpau_format
=
vdpau_formats
[
i
][
0
];
ctx
->
pix_fmt
=
vdpau_formats
[
i
][
1
];
vdpau_ctx
=
av_vdpau_alloc_context
();
if
(
!
vdpau_ctx
)
if
(
av_vdpau_bind_context
(
s
,
ctx
->
device
,
ctx
->
get_proc_address
,
0
))
goto
fail
;
vdpau_ctx
->
render
=
ctx
->
decoder_render
;
s
->
hwaccel_context
=
vdpau_ctx
;
ctx
->
get_information_string
(
&
vendor
);
av_log
(
NULL
,
AV_LOG_VERBOSE
,
"Using VDPAU -- %s -- on X11 display %s, "
...
...
@@ -294,39 +280,12 @@ fail:
int
vdpau_init
(
AVCodecContext
*
s
)
{
InputStream
*
ist
=
s
->
opaque
;
int
loglevel
=
(
ist
->
hwaccel_id
==
HWACCEL_AUTO
)
?
AV_LOG_VERBOSE
:
AV_LOG_ERROR
;
AVVDPAUContext
*
vdpau_ctx
;
VDPAUContext
*
ctx
;
VdpStatus
err
;
int
profile
,
ret
;
if
(
!
ist
->
hwaccel_ctx
)
{
ret
=
vdpau_alloc
(
s
);
int
ret
=
vdpau_alloc
(
s
);
if
(
ret
<
0
)
return
ret
;
}
ctx
=
ist
->
hwaccel_ctx
;
vdpau_ctx
=
s
->
hwaccel_context
;
ret
=
av_vdpau_get_profile
(
s
,
&
profile
);
if
(
ret
<
0
)
{
av_log
(
NULL
,
loglevel
,
"No known VDPAU decoder profile for this stream.
\n
"
);
return
AVERROR
(
EINVAL
);
}
if
(
ctx
->
decoder
)
ctx
->
decoder_destroy
(
ctx
->
decoder
);
err
=
ctx
->
decoder_create
(
ctx
->
device
,
profile
,
s
->
coded_width
,
s
->
coded_height
,
16
,
&
ctx
->
decoder
);
if
(
err
!=
VDP_STATUS_OK
)
{
av_log
(
NULL
,
loglevel
,
"Error creating the VDPAU decoder: %s
\n
"
,
ctx
->
get_error_string
(
err
));
return
AVERROR_UNKNOWN
;
}
vdpau_ctx
->
decoder
=
ctx
->
decoder
;
ist
->
hwaccel_get_buffer
=
vdpau_get_buffer
;
ist
->
hwaccel_retrieve_data
=
vdpau_retrieve_data
;
...
...
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