Add support of multi keys from different MediaKeySession in CDMinstanceClearKey Use case: Two sessions of MediaKeysession, one for the audio track and one for the video track and a single CDMinstanceClearKey that receives the keys of both sessions, so it should cache these keys in a vector in order to send them to the Decryptors
Created attachment 327753 [details] Patch
Comment on attachment 327753 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=327753&action=review I think in this case we would be duplicating the keys so I'd suggest checking for the keys to be inside the Vector before adding a new one. Another issue I see is that a little bit below, the vector is cleared and probably we don't want to clear the keys that are still associated with a session. I think this logic is flawed and needs more work. Maybe Žan can correct me if I am wrong. > Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:545 > + for (auto& key : keyVector) > + m_keys.append(key); If you wanted to do this, which I don't think is what I'd really want, you could use appendVector.
(In reply to Xabier Rodríguez Calvar from comment #2) > Comment on attachment 327753 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=327753&action=review > > I think in this case we would be duplicating the keys so I'd suggest > checking for the keys to be inside the Vector before adding a new one. > I agree > Another issue I see is that a little bit below, the vector is cleared and > probably we don't want to clear the keys that are still associated with a > session. I think this logic is flawed and needs more work. > I'll check > Maybe Žan can correct me if I am wrong. > > > Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:545 > > + for (auto& key : keyVector) > > + m_keys.append(key); > > If you wanted to do this, which I don't think is what I'd really want, you > could use appendVector.
Created attachment 331486 [details] Patch
Comment on attachment 331486 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=331486&action=review Can you explain a bit more how this works? > Source/WebCore/ChangeLog:8 > + Add support of multi keys from different MediaKeySession in CDMinstanceClearKey. CDMInstanceClearKey > Source/WebCore/ChangeLog:9 > + The single CDMinstanceClearKey that receives the keys of different sessions ditto
Created attachment 331614 [details] Patch
Comment on attachment 331614 [details] Patch Clearing flags on attachment: 331614 Committed r227409: <https://trac.webkit.org/changeset/227409>
All reviewed patches have been landed. Closing bug.
<rdar://problem/36771885>