Provide transitional opt accessor to RTCConfiguration.crypto_options

Bug: webrtc:42235111
Change-Id: I92d56d9912d5587ef5aabcf556b942ce5eaf4e26
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/402680
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#45254}
diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h
index ed84a4f..1b0beb3 100644
--- a/api/peer_connection_interface.h
+++ b/api/peer_connection_interface.h
@@ -662,6 +662,15 @@
     // frame encryption for native WebRTC.
     std::optional<CryptoOptions> crypto_options;
 
+    // TODO: bugs.webrtc.org/42235111 - remove after converting callers that
+    // expect an optional.
+    CryptoOptions& GetWritableCryptoOptions() {
+      if (!crypto_options) {
+        crypto_options = CryptoOptions();
+      }
+      return *crypto_options;
+    }
+
     // Configure if we should include the SDP attribute extmap-allow-mixed in
     // our offer on session level.
     bool offer_extmap_allow_mixed = true;