"Like Hubert said, Chromecast isn't open source. Getting it to work on desktop would require some reverse engineering and may or may not be impossible (I've heard that the Desktop extension for Chrome is all JS though, so that code may be useable)."
You might also be interested in the "casting support" bugs: