AVHWAccel infrastructure. Originally committed as revision 18135 to svn://svn.ffmpeg.org/ffmpeg/trunk