[vlc-commits] vdpau: revector (no functional changes)
Rémi Denis-Courmont
git at videolan.org
Wed Jul 24 21:51:42 CEST 2013
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 24 22:39:44 2013 +0300| [7840c4dc4bb72bcb306fc9ee5599aecaca0ac8d7] | committer: Rémi Denis-Courmont
vdpau: revector (no functional changes)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7840c4dc4bb72bcb306fc9ee5599aecaca0ac8d7
---
modules/hw/vdpau/picture.c | 27 ++++++++++++++++++---------
modules/hw/vdpau/vlc_vdpau.h | 5 +++++
2 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/modules/hw/vdpau/picture.c b/modules/hw/vdpau/picture.c
index c488a6c..7c865ed 100644
--- a/modules/hw/vdpau/picture.c
+++ b/modules/hw/vdpau/picture.c
@@ -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;
}
diff --git a/modules/hw/vdpau/vlc_vdpau.h b/modules/hw/vdpau/vlc_vdpau.h
index 362e60a..f899ba2 100644
--- a/modules/hw/vdpau/vlc_vdpau.h
+++ b/modules/hw/vdpau/vlc_vdpau.h
@@ -287,6 +287,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).
*/
More information about the vlc-commits
mailing list