Skip to content

Conversation

cloudwebrtc
Copy link
Member

@cloudwebrtc cloudwebrtc commented Aug 25, 2025

TODO:

  • Core Implementation
  • Android JNI Wrapper
  • Objective-C Wrapper

@cloudwebrtc cloudwebrtc marked this pull request as ready for review August 27, 2025 00:49
@@ -753,4 +761,156 @@ uint8_t FrameCryptorTransformer::getIvSize() {
}
}

DataPacketCryptor::DataPacketCryptor(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I noticed this doesn't use the signalling thread. Will this cause any multi-threading issues with the key provider potentially being used at the same time as frame crypting?

Copy link
Member Author

@cloudwebrtc cloudwebrtc Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. The signaling thread in FrameCryptor is actually only used to deliver the onFrameCryptionStateChanged event. Internally, a separate thread ["FrameCryptorTransformer"] is used to encryptFrame/decryptFrame. Unless we use same thread as a worker thread for DataPacketCryptor to avoid keyProvider contention.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think they compete strongly by default. It only happens once when retrieving the key_handler key_handler->GetKeySet(key_index); and once when the key ratchet needs to update the key material.
This is essentially similar to the two thread competition in frameCryptor for rtp_sender and rtp_receiver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants