Wouldn't it be better to do something like Ambilight rather than cropping or stretching. Personally I don't like black bars, but even more I dislike wrong proportions or cropping screen where something valuable can be...
By Ambilight I mean this:
en.wikipedia.org/wiki/Ambilight
It's used in Smooth Video Project for example
I don't know if existing Ambient Lighting could be adapted, but from my, far from development, point of view it needs to detect black color from top/bottom with same width as horizontal resolution and left/right with same height as vertical resolution. And most simplified algorithm of Ambient Light as it should be blurred with no details(and less impact is better of course), only dominant colors to apply only to those detected black areas.
I'd personally used such shader...