[FFmpeg-cvslog] vdpau: add helper for VDPAU to libav error codes conversion

Rémi Denis-Courmont git at videolan.org
Mon Oct 6 11:47:12 CEST 2014


ffmpeg | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct  4 16:55:02 2014 +0300| [319424d25c53f82b87187ce03ed984d438f1bee6] | committer: Anton Khirnov

vdpau: add helper for VDPAU to libav error codes conversion

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=319424d25c53f82b87187ce03ed984d438f1bee6
---

 libavcodec/vdpau.c |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index 5406874..581eada 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -38,6 +38,30 @@
  * @{
  */
 
+static int vdpau_error(VdpStatus status)
+{
+    switch (status) {
+    case VDP_STATUS_OK:
+        return 0;
+    case VDP_STATUS_NO_IMPLEMENTATION:
+        return AVERROR(ENOSYS);
+    case VDP_STATUS_DISPLAY_PREEMPTED:
+        return AVERROR(EIO);
+    case VDP_STATUS_INVALID_HANDLE:
+        return AVERROR(EBADF);
+    case VDP_STATUS_INVALID_POINTER:
+        return AVERROR(EFAULT);
+    case VDP_STATUS_RESOURCES:
+        return AVERROR(ENOBUFS);
+    case VDP_STATUS_HANDLE_DEVICE_MISMATCH:
+        return AVERROR(EXDEV);
+    case VDP_STATUS_ERROR:
+        return AVERROR(EIO);
+    default:
+        return AVERROR(EINVAL);
+    }
+}
+
 int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx,
                                 av_unused const uint8_t *buffer,
                                 av_unused uint32_t size)



More information about the ffmpeg-cvslog mailing list