shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
238 stars 63 forks source link

Add API to query decrypt-decode in EME interface #145

Open TheModMaker opened 4 years ago

TheModMaker commented 4 years ago

Currently, the EME plugin interface is designed to work with decrypt to clear buffer. We can support decrypt-decode, but it requires a custom Decoder implementation and the eme::Implementation interface is mostly unused. The Decoder would cast to their type and handle decrypt-decode however their EME handled it.

We could add a built-in decrypt-decode API to the EME plugin interface, but I don't think this is needed. But there is currently no way to query this support. As was seen in #143, we currently query the global MediaPlayer instance for decoding support. But this doesn't work when storing when there isn't a MediaPlayer instance. This also requires the Decoder to know what the EME plugin supports.

We should consider adding a new method to eme::ImplementationFactory to query support for decoding. EME plugins that use decrypt to clear can just return true for all values. Since this would change existing interfaces, it would break ABI and can only be done on a major release. Also, since there is no one who does decrypt-decode, we'll wait to implement this.