Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
7840c4dc
Commit
7840c4dc
authored
Jul 24, 2013
by
Rémi Denis-Courmont
Browse files
vdpau: revector (no functional changes)
parent
473c629a
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/hw/vdpau/picture.c
View file @
7840c4dc
...
...
@@ -62,8 +62,8 @@ static const VdpProcamp procamp_default =
.
hue
=
0
.
f
,
};
VdpStatus
vlc_vdp_video_
attach
(
vdp_t
*
vdp
,
VdpVideoSurface
surface
,
picture_t
*
pic
)
vlc_vdp_video_field_t
*
vlc_vdp_video_
create
(
vdp_t
*
vdp
,
VdpVideoSurface
surface
)
{
vlc_vdp_video_field_t
*
field
=
malloc
(
sizeof
(
*
field
));
vlc_vdp_video_frame_t
*
frame
=
malloc
(
sizeof
(
*
frame
));
...
...
@@ -73,15 +73,9 @@ VdpStatus vlc_vdp_video_attach(vdp_t *vdp, VdpVideoSurface surface,
free
(
frame
);
free
(
field
);
vdp_video_surface_destroy
(
vdp
,
surface
);
return
VDP_STATUS_RESOURCES
;
return
NULL
;
}
assert
(
pic
->
format
.
i_chroma
==
VLC_CODEC_VDPAU_VIDEO_420
||
pic
->
format
.
i_chroma
==
VLC_CODEC_VDPAU_VIDEO_422
);
assert
(
!
picture_IsReferenced
(
pic
));
assert
(
pic
->
context
==
NULL
);
pic
->
context
=
field
;
field
->
destroy
=
SurfaceDestroy
;
field
->
frame
=
frame
;
field
->
structure
=
VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME
;
...
...
@@ -91,6 +85,21 @@ VdpStatus vlc_vdp_video_attach(vdp_t *vdp, VdpVideoSurface surface,
atomic_init
(
&
frame
->
refs
,
1
);
frame
->
surface
=
surface
;
frame
->
vdp
=
vdp_hold_x11
(
vdp
,
&
frame
->
device
);
return
field
;
}
VdpStatus
vlc_vdp_video_attach
(
vdp_t
*
vdp
,
VdpVideoSurface
surface
,
picture_t
*
pic
)
{
vlc_vdp_video_field_t
*
field
=
vlc_vdp_video_create
(
vdp
,
surface
);
if
(
unlikely
(
field
==
NULL
))
return
VDP_STATUS_RESOURCES
;
assert
(
pic
->
format
.
i_chroma
==
VLC_CODEC_VDPAU_VIDEO_420
||
pic
->
format
.
i_chroma
==
VLC_CODEC_VDPAU_VIDEO_422
);
assert
(
!
picture_IsReferenced
(
pic
));
assert
(
pic
->
context
==
NULL
);
pic
->
context
=
field
;
return
VDP_STATUS_OK
;
}
...
...
modules/hw/vdpau/vlc_vdpau.h
View file @
7840c4dc
...
...
@@ -286,6 +286,11 @@ typedef struct vlc_vdp_video_field
*/
VdpStatus
vlc_vdp_video_attach
(
vdp_t
*
,
VdpVideoSurface
,
picture_t
*
);
/**
* Wraps a VDPAU video surface into a VLC picture context.
*/
vlc_vdp_video_field_t
*
vlc_vdp_video_create
(
vdp_t
*
,
VdpVideoSurface
);
/**
* Performs a shallow copy of a VDPAU video surface context
* (the underlying VDPAU video surface is shared).
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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