vdpau: add helper for VDPAU to libav error codes conversion

Signed-off-by: Anton Khirnov <anton@khirnov.net>
vdpau: factor out common end-of-frame handling

Also add error handling.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
vdpau: common support for managing the VdpDecoder in avcodec

Using the not so new init and uninit callbacks, avcodec can now take
care of creating and destroying the VDPAU decoder instance.

The application is still responsible for creating the VDPAU device
and allocating video surfaces - this is necessary to keep video
surfaces on the GPU all the way to the output. But the application
will no longer needs to care about any codec-specific aspects.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
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>
Merge commit 'fcc1022611f79c2f3aa2f392a5ce14c74be9c1d7'

* commit 'fcc1022611f79c2f3aa2f392a5ce14c74be9c1d7':
  vdpau: factor out common end-of-frame handling

Conflicts:
	libavcodec/vdpau.c
	libavcodec/vdpau_h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'ce083282f0a8b7d63c4047c30b7bac498f9806dd'

* commit 'ce083282f0a8b7d63c4047c30b7bac498f9806dd':
  vdpau: common support for managing the VdpDecoder in avcodec

Conflicts:
	libavcodec/vdpau.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/vdpau_internal: add comment to #endif

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>