The Chromecast protocol specification (CASTV2) itself is sort of open. To implement it on macOS I did a little bit of reverse engineering and used a description of the protocol I found here: https://github.com/thibauts/node-castv2
VLC has Chromecast support in the development version, and has had it for over a year now. They had to reverse-engineer the protocol. I think the UI is a bit cludgey but it works.
> This framework implements the Google Cast APIs so they can be used in macOS apps. Google provides an official SDK but it is only for iOS and closed source.