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>
vdpau: pass codec-specific parameters from hwaccel

Signed-off-by: Anton Khirnov <anton@khirnov.net>
vdpau: force reinitialization when output resolution changes

This is necessary to recreate the decoder with the correct parameters,
as not all codecs invoke get_format() in this case.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
vdpau: add av_vdpau_bind_context()

This function provides an explicit VDPAU device and VDPAU driver to
libavcodec, so that the application is relieved from codec specifics
and VdpDevice life cycle management.

A stub flags parameter is added for future extension. For instance, it
could be used to ignore codec level capabilities (if someone feels
dangerous).

Signed-off-by: Anton Khirnov <anton@khirnov.net>
vdpau: check video surface and decoder capabilities

Signed-off-by: Anton Khirnov <anton@khirnov.net>
avconv_vdpau: update to new VDPAU interface

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