Remove deprecated TransformableVideoFrameInterface::GetMetadata

Bug: chromium:1420245
Change-Id: I4cc008bf8a4af2404f33589aededa8a16b774764
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299263
Commit-Queue: Tony Herre <herre@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39712}
diff --git a/api/frame_transformer_interface.h b/api/frame_transformer_interface.h
index e6f7a3f..fd60b87 100644
--- a/api/frame_transformer_interface.h
+++ b/api/frame_transformer_interface.h
@@ -58,11 +58,6 @@
   virtual ~TransformableVideoFrameInterface() = default;
   virtual bool IsKeyFrame() const = 0;
 
-  // The returned const ref may become invalid due to later SetMetadata calls,
-  // or other modifications. Use Metadata() instead.
-  [[deprecated("Use Metadata() instead")]] virtual const VideoFrameMetadata&
-  GetMetadata() const = 0;
-
   virtual VideoFrameMetadata Metadata() const = 0;
 
   // TODO(https://crbug.com/webrtc/14709): Make pure virtual when Chromium MOCK
diff --git a/api/test/mock_transformable_video_frame.h b/api/test/mock_transformable_video_frame.h
index 9d56a29..eab02d7 100644
--- a/api/test/mock_transformable_video_frame.h
+++ b/api/test/mock_transformable_video_frame.h
@@ -26,10 +26,6 @@
   MOCK_METHOD(uint32_t, GetTimestamp, (), (const, override));
   MOCK_METHOD(uint32_t, GetSsrc, (), (const, override));
   MOCK_METHOD(bool, IsKeyFrame, (), (const, override));
-  MOCK_METHOD(const webrtc::VideoFrameMetadata&,
-              GetMetadata,
-              (),
-              (const, override));
   MOCK_METHOD(void,
               SetMetadata,
               (const webrtc::VideoFrameMetadata&),
diff --git a/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc b/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc
index 3b26214..34b4af0 100644
--- a/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc
+++ b/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc
@@ -42,8 +42,7 @@
         capture_time_identifier_(encoded_image.CaptureTimeIdentifier()),
         expected_retransmission_time_ms_(expected_retransmission_time_ms),
         ssrc_(ssrc),
-        csrcs_(csrcs),
-        metadata_(Metadata()) {
+        csrcs_(csrcs) {
     RTC_DCHECK_GE(payload_type_, 0);
     RTC_DCHECK_LE(payload_type_, 127);
   }
@@ -66,8 +65,6 @@
     return frame_type_ == VideoFrameType::kVideoFrameKey;
   }
 
-  const VideoFrameMetadata& GetMetadata() const override { return metadata_; }
-
   VideoFrameMetadata Metadata() const override {
     VideoFrameMetadata metadata = header_.GetAsMetadata();
     metadata.SetSsrc(ssrc_);
@@ -79,9 +76,6 @@
     header_.SetFromMetadata(metadata);
     ssrc_ = metadata.GetSsrc();
     csrcs_ = metadata.GetCsrcs();
-    // Cache a copy to allow GetMetadata() to return references.
-    // TODO(crbug.com/webrtc/14709): Remove once GetMetadata() is removed.
-    metadata_ = Metadata();
   }
 
   const RTPVideoHeader& GetHeader() const { return header_; }
@@ -111,12 +105,6 @@
 
   uint32_t ssrc_;
   std::vector<uint32_t> csrcs_;
-
-  // This is a copy of the value returned by `Metadata()`, only needed because
-  // the interface says GetMetadata() must return a const ref rather than a
-  // value.
-  // TODO(crbug.com/webrtc/14709): Delete once GetMetdata() is removed.
-  VideoFrameMetadata metadata_;
 };
 }  // namespace
 
@@ -184,7 +172,7 @@
                      transformed_video_frame->GetData(),
                      transformed_video_frame->GetHeader(),
                      transformed_video_frame->GetExpectedRetransmissionTimeMs(),
-                     transformed_video_frame->GetMetadata().GetCsrcs());
+                     transformed_video_frame->Metadata().GetCsrcs());
 }
 
 void RTPSenderVideoFrameTransformerDelegate::SetVideoStructureUnderLock(
diff --git a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc
index c66c05b..8254341 100644
--- a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc
+++ b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc
@@ -51,8 +51,6 @@
     return frame_->FrameType() == VideoFrameType::kVideoFrameKey;
   }
 
-  const VideoFrameMetadata& GetMetadata() const override { return metadata_; }
-
   VideoFrameMetadata Metadata() const override { return metadata_; }
 
   void SetMetadata(const VideoFrameMetadata&) override {