Some libraries are shared on windows (system32, check your PATH variable).
With video codecs there are like you mentioned two routes: internal functionality (like VLC) or use Windows Media Foundation (Directshow is outdated, but still used alot). WMF codecs are written using some windows SDK, and after installation can be used by software that uses the WMF framework (like Windows Media Player).