Do not propagate generic descriptor on receiving frame
It was used only for the frame decryptor.
Decryptor needs only raw representation that it can recreate
in a way compatible with the new version of the descriptor.
This relands commit abf73de8eae90e9ac7e88ce1d52728e8102e824f.
with adjustments.
Change-Id: I935977179bef31d8e1023964b967658e9a7db92d
Bug: webrtc:10342
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168489
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30532}
diff --git a/video/buffered_frame_decryptor.cc b/video/buffered_frame_decryptor.cc
index 90d14d3..ae83da9 100644
--- a/video/buffered_frame_decryptor.cc
+++ b/video/buffered_frame_decryptor.cc
@@ -11,7 +11,10 @@
#include "video/buffered_frame_decryptor.h"
#include <utility>
+#include <vector>
+#include "modules/rtp_rtcp/source/rtp_descriptor_authentication.h"
+#include "modules/video_coding/frame_object.h"
#include "rtc_base/logging.h"
#include "system_wrappers/include/field_trial.h"
@@ -60,9 +63,7 @@
return FrameDecision::kStash;
}
// When using encryption we expect the frame to have the generic descriptor.
- absl::optional<RtpGenericFrameDescriptor> descriptor =
- frame->GetGenericFrameDescriptor();
- if (!descriptor) {
+ if (frame->GetRtpVideoHeader().generic == absl::nullopt) {
RTC_LOG(LS_ERROR) << "No generic frame descriptor found dropping frame.";
return FrameDecision::kDrop;
}
@@ -76,9 +77,9 @@
max_plaintext_byte_size);
// Only enable authenticating the header if the field trial is enabled.
- rtc::ArrayView<const uint8_t> additional_data;
+ std::vector<uint8_t> additional_data;
if (generic_descriptor_auth_experiment_) {
- additional_data = descriptor->GetByteRepresentation();
+ additional_data = RtpDescriptorAuthentication(frame->GetRtpVideoHeader());
}
// Attempt to decrypt the video frame.