aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-06 11:38:06 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-06 11:38:06 +0200
commit567c0dcee6745dc53d67e6de796270449b5753f7 (patch)
tree43cac939d1979e472eef2e8b522ae0afe8d13c7d
parent6b347f519d5303c56fe21195aeb2a2eb91221061 (diff)
parent319424d25c53f82b87187ce03ed984d438f1bee6 (diff)
downloadffmpeg-567c0dcee6745dc53d67e6de796270449b5753f7.tar.gz
Merge commit '319424d25c53f82b87187ce03ed984d438f1bee6'
* commit '319424d25c53f82b87187ce03ed984d438f1bee6': vdpau: add helper for VDPAU to libav error codes conversion Conflicts: libavcodec/vdpau.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/vdpau.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index 0dc5355262..18d09ae980 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);
+ }
+}
+
AVVDPAUContext *av_alloc_vdpaucontext(void)
{
return av_vdpau_alloc_context();