summarylogtreecommitdiffstats
path: root/0001-Revert-RTCInsertableStreams-Make-RTCEncodedAudioFram.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-Revert-RTCInsertableStreams-Make-RTCEncodedAudioFram.patch')
-rw-r--r--0001-Revert-RTCInsertableStreams-Make-RTCEncodedAudioFram.patch515
1 files changed, 0 insertions, 515 deletions
diff --git a/0001-Revert-RTCInsertableStreams-Make-RTCEncodedAudioFram.patch b/0001-Revert-RTCInsertableStreams-Make-RTCEncodedAudioFram.patch
deleted file mode 100644
index 4f94b9cabbe..00000000000
--- a/0001-Revert-RTCInsertableStreams-Make-RTCEncodedAudioFram.patch
+++ /dev/null
@@ -1,515 +0,0 @@
-From 806760e32fbde130c2ddbdd81a1838e02f2e9d59 Mon Sep 17 00:00:00 2001
-From: Daniel Playfair Cal <daniel.playfair.cal@gmail.com>
-Date: Fri, 17 Apr 2020 00:37:18 +1000
-Subject: [PATCH 1/8] Revert "[RTCInsertableStreams] Make RTCEncodedAudioFrame
- serializable"
-
-This reverts commit 7415e4fb52b66c115395e0b08eb79c7d10326130.
----
- .../core/v8/serialization/serialization_tag.h | 1 -
- ...8_script_value_deserializer_for_modules.cc | 28 --------
- ...v8_script_value_deserializer_for_modules.h | 2 -
- .../v8_script_value_serializer_for_modules.cc | 28 --------
- .../v8_script_value_serializer_for_modules.h | 2 -
- .../renderer/modules/peerconnection/BUILD.gn | 2 -
- .../peerconnection/rtc_encoded_audio_frame.cc | 51 +++++--------
- .../peerconnection/rtc_encoded_audio_frame.h | 16 ++---
- .../rtc_encoded_audio_frame_delegate.cc | 68 ------------------
- .../rtc_encoded_audio_frame_delegate.h | 72 -------------------
- .../rtc_encoded_audio_underlying_sink.cc | 3 +-
- 11 files changed, 24 insertions(+), 249 deletions(-)
- delete mode 100644 third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame_delegate.cc
- delete mode 100644 third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame_delegate.h
-
-diff --git a/third_party/blink/renderer/bindings/core/v8/serialization/serialization_tag.h b/third_party/blink/renderer/bindings/core/v8/serialization/serialization_tag.h
-index a0eaa09214de..cce273938fc2 100644
---- a/third_party/blink/renderer/bindings/core/v8/serialization/serialization_tag.h
-+++ b/third_party/blink/renderer/bindings/core/v8/serialization/serialization_tag.h
-@@ -102,7 +102,6 @@ enum SerializationTag {
- // namedCurve:uint32_t
- kRTCCertificateTag = 'k', // length:uint32_t, pemPrivateKey:WebCoreString,
- // pemCertificate:WebCoreString
-- kRTCEncodedAudioFrameTag = 'A', // uint32_t -> transferred audio frame ID
- kRTCEncodedVideoFrameTag = 'V', // uint32_t -> transferred video frame ID
-
- // The following tags were used by the Shape Detection API implementation
-diff --git a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.cc b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.cc
-index 7b07f6283073..684d40f0cee8 100644
---- a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.cc
-+++ b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.cc
-@@ -18,8 +18,6 @@
- #include "third_party/blink/renderer/modules/native_file_system/native_file_system_file_handle.h"
- #include "third_party/blink/renderer/modules/peerconnection/rtc_certificate.h"
- #include "third_party/blink/renderer/modules/peerconnection/rtc_certificate_generator.h"
--#include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.h"
--#include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame_delegate.h"
- #include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_video_frame.h"
- #include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_video_frame_delegate.h"
-
-@@ -69,8 +67,6 @@ ScriptWrappable* V8ScriptValueDeserializerForModules::ReadDOMObject(
- return nullptr;
- return MakeGarbageCollected<RTCCertificate>(std::move(certificate));
- }
-- case kRTCEncodedAudioFrameTag:
-- return ReadRTCEncodedAudioFrame();
- case kRTCEncodedVideoFrameTag:
- return ReadRTCEncodedVideoFrame();
- default:
-@@ -377,30 +373,6 @@ V8ScriptValueDeserializerForModules::ReadNativeFileSystemHandle(
- }
- }
-
--RTCEncodedAudioFrame*
--V8ScriptValueDeserializerForModules::ReadRTCEncodedAudioFrame() {
-- if (!RuntimeEnabledFeatures::RTCInsertableStreamsEnabled(
-- ExecutionContext::From(GetScriptState()))) {
-- return nullptr;
-- }
--
-- uint32_t index;
-- if (!ReadUint32(&index))
-- return nullptr;
--
-- const auto* attachment =
-- GetSerializedScriptValue()
-- ->GetAttachmentIfExists<RTCEncodedAudioFramesAttachment>();
-- if (!attachment)
-- return nullptr;
--
-- const auto& frames = attachment->EncodedAudioFrames();
-- if (index >= frames.size())
-- return nullptr;
--
-- return MakeGarbageCollected<RTCEncodedAudioFrame>(frames[index]);
--}
--
- RTCEncodedVideoFrame*
- V8ScriptValueDeserializerForModules::ReadRTCEncodedVideoFrame() {
- if (!RuntimeEnabledFeatures::RTCInsertableStreamsEnabled(
-diff --git a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.h b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.h
-index fd08855f9bea..410fe5098096 100644
---- a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.h
-+++ b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_deserializer_for_modules.h
-@@ -12,7 +12,6 @@ namespace blink {
-
- class CryptoKey;
- class NativeFileSystemHandle;
--class RTCEncodedAudioFrame;
- class RTCEncodedVideoFrame;
-
- // Extends V8ScriptValueSerializer with support for modules/ types.
-@@ -46,7 +45,6 @@ class MODULES_EXPORT V8ScriptValueDeserializerForModules final
- }
- CryptoKey* ReadCryptoKey();
- NativeFileSystemHandle* ReadNativeFileSystemHandle(SerializationTag tag);
-- RTCEncodedAudioFrame* ReadRTCEncodedAudioFrame();
- RTCEncodedVideoFrame* ReadRTCEncodedVideoFrame();
- };
-
-diff --git a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.cc b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.cc
-index 2e88d05de51c..6811770537b9 100644
---- a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.cc
-+++ b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.cc
-@@ -18,10 +18,7 @@
- #include "third_party/blink/renderer/bindings/modules/v8/v8_landmark.h"
- #include "third_party/blink/renderer/bindings/modules/v8/v8_point_2d.h"
- #include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_certificate.h"
--#include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_encoded_audio_frame.h"
- #include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_encoded_video_frame.h"
--#include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.h"
--#include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame_delegate.h"
- #include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_video_frame.h"
- #include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_video_frame_delegate.h"
- #include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
-@@ -80,17 +77,6 @@ bool V8ScriptValueSerializerForModules::WriteDOMObject(
- WriteUTF8String(pem.certificate().c_str());
- return true;
- }
-- if (wrapper_type_info == V8RTCEncodedAudioFrame::GetWrapperTypeInfo() &&
-- RuntimeEnabledFeatures::RTCInsertableStreamsEnabled(
-- ExecutionContext::From(GetScriptState()))) {
-- if (IsForStorage()) {
-- exception_state.ThrowDOMException(DOMExceptionCode::kDataCloneError,
-- "An RTCEncodedAudioFrame cannot be "
-- "serialized for storage.");
-- return false;
-- }
-- return WriteRTCEncodedAudioFrame(wrappable->ToImpl<RTCEncodedAudioFrame>());
-- }
- if (wrapper_type_info == V8RTCEncodedVideoFrame::GetWrapperTypeInfo() &&
- RuntimeEnabledFeatures::RTCInsertableStreamsEnabled(
- ExecutionContext::From(GetScriptState()))) {
-@@ -300,20 +286,6 @@ bool V8ScriptValueSerializerForModules::WriteNativeFileSystemHandle(
- return true;
- }
-
--bool V8ScriptValueSerializerForModules::WriteRTCEncodedAudioFrame(
-- RTCEncodedAudioFrame* audio_frame) {
-- auto* attachment =
-- GetSerializedScriptValue()
-- ->GetOrCreateAttachment<RTCEncodedAudioFramesAttachment>();
-- auto& frames = attachment->EncodedAudioFrames();
-- frames.push_back(audio_frame->Delegate());
-- const uint32_t index = static_cast<uint32_t>(frames.size() - 1);
--
-- WriteTag(kRTCEncodedAudioFrameTag);
-- WriteUint32(index);
-- return true;
--}
--
- bool V8ScriptValueSerializerForModules::WriteRTCEncodedVideoFrame(
- RTCEncodedVideoFrame* video_frame) {
- auto* attachment =
-diff --git a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.h b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.h
-index eda1434b359f..10ac32ca4f69 100644
---- a/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.h
-+++ b/third_party/blink/renderer/bindings/modules/v8/serialization/v8_script_value_serializer_for_modules.h
-@@ -12,7 +12,6 @@
- namespace blink {
-
- class NativeFileSystemHandle;
--class RTCEncodedAudioFrame;
- class RTCEncodedVideoFrame;
- class WebCryptoKey;
-
-@@ -34,7 +33,6 @@ class MODULES_EXPORT V8ScriptValueSerializerForModules final
- bool WriteNativeFileSystemHandle(
- SerializationTag tag,
- NativeFileSystemHandle* native_file_system_handle);
-- bool WriteRTCEncodedAudioFrame(RTCEncodedAudioFrame*);
- bool WriteRTCEncodedVideoFrame(RTCEncodedVideoFrame*);
- };
-
-diff --git a/third_party/blink/renderer/modules/peerconnection/BUILD.gn b/third_party/blink/renderer/modules/peerconnection/BUILD.gn
-index 27fe410a7319..4f9144ed30e0 100644
---- a/third_party/blink/renderer/modules/peerconnection/BUILD.gn
-+++ b/third_party/blink/renderer/modules/peerconnection/BUILD.gn
-@@ -78,8 +78,6 @@ blink_modules_sources("peerconnection") {
- "rtc_dtmf_tone_change_event.h",
- "rtc_encoded_audio_frame.cc",
- "rtc_encoded_audio_frame.h",
-- "rtc_encoded_audio_frame_delegate.cc",
-- "rtc_encoded_audio_frame_delegate.h",
- "rtc_encoded_audio_underlying_sink.cc",
- "rtc_encoded_audio_underlying_sink.h",
- "rtc_encoded_audio_underlying_source.cc",
-diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.cc b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.cc
-index 6dbaa7fedf78..208b4bff2eb2 100644
---- a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.cc
-+++ b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.cc
-@@ -4,10 +4,7 @@
-
- #include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.h"
-
--#include <utility>
--
- #include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h"
--#include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame_delegate.h"
- #include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
- #include "third_party/webrtc/api/frame_transformer_interface.h"
-
-@@ -15,37 +12,30 @@ namespace blink {
-
- RTCEncodedAudioFrame::RTCEncodedAudioFrame(
- std::unique_ptr<webrtc::TransformableFrameInterface> webrtc_frame)
-- : delegate_(base::MakeRefCounted<RTCEncodedAudioFrameDelegate>(
-- std::move(webrtc_frame),
-- Vector<uint32_t>())) {}
-+ : webrtc_frame_(std::move(webrtc_frame)) {}
-
- RTCEncodedAudioFrame::RTCEncodedAudioFrame(
- std::unique_ptr<webrtc::TransformableAudioFrameInterface>
- webrtc_audio_frame) {
-- Vector<uint32_t> contributing_sources;
- if (webrtc_audio_frame) {
- wtf_size_t num_csrcs = webrtc_audio_frame->GetHeader().numCSRCs;
-- contributing_sources.ReserveInitialCapacity(num_csrcs);
-+ contributing_sources_.ReserveInitialCapacity(num_csrcs);
- for (wtf_size_t i = 0; i < num_csrcs; i++) {
-- contributing_sources.push_back(
-+ contributing_sources_.push_back(
- webrtc_audio_frame->GetHeader().arrOfCSRCs[i]);
- }
- }
-- delegate_ = base::MakeRefCounted<RTCEncodedAudioFrameDelegate>(
-- std::move(webrtc_audio_frame), std::move(contributing_sources));
-+ webrtc_frame_ = std::move(webrtc_audio_frame);
- }
-
--RTCEncodedAudioFrame::RTCEncodedAudioFrame(
-- scoped_refptr<RTCEncodedAudioFrameDelegate> delegate)
-- : delegate_(std::move(delegate)) {}
--
- uint64_t RTCEncodedAudioFrame::timestamp() const {
-- return delegate_->Timestamp();
-+ return webrtc_frame_ ? webrtc_frame_->GetTimestamp() : 0;
- }
-
- DOMArrayBuffer* RTCEncodedAudioFrame::data() const {
-- if (!frame_data_) {
-- frame_data_ = delegate_->CreateDataBuffer();
-+ if (webrtc_frame_ && !frame_data_) {
-+ frame_data_ = DOMArrayBuffer::Create(webrtc_frame_->GetData().data(),
-+ webrtc_frame_->GetData().size());
- }
- return frame_data_;
- }
-@@ -59,11 +49,11 @@ void RTCEncodedAudioFrame::setData(DOMArrayBuffer* data) {
- }
-
- uint32_t RTCEncodedAudioFrame::synchronizationSource() const {
-- return delegate_->Ssrc();
-+ return webrtc_frame_ ? webrtc_frame_->GetSsrc() : 0;
- }
-
- Vector<uint32_t> RTCEncodedAudioFrame::contributingSources() const {
-- return delegate_->ContributingSources();
-+ return webrtc_frame_ ? contributing_sources_ : Vector<uint32_t>();
- }
-
- String RTCEncodedAudioFrame::toString() const {
-@@ -76,20 +66,15 @@ String RTCEncodedAudioFrame::toString() const {
- return sb.ToString();
- }
-
--void RTCEncodedAudioFrame::SyncDelegate() const {
-- delegate_->SetData(frame_data_);
--}
--
--scoped_refptr<RTCEncodedAudioFrameDelegate> RTCEncodedAudioFrame::Delegate()
-- const {
-- SyncDelegate();
-- return delegate_;
--}
--
- std::unique_ptr<webrtc::TransformableFrameInterface>
--RTCEncodedAudioFrame::PassWebRtcFrame() {
-- SyncDelegate();
-- return delegate_->PassWebRtcFrame();
-+RTCEncodedAudioFrame::PassDelegate() {
-+ // Sync the delegate data with |frame_data_| if necessary.
-+ if (webrtc_frame_ && frame_data_) {
-+ webrtc_frame_->SetData(rtc::ArrayView<const uint8_t>(
-+ static_cast<const uint8_t*>(frame_data_->Data()),
-+ frame_data_->ByteLengthAsSizeT()));
-+ }
-+ return std::move(webrtc_frame_);
- }
-
- void RTCEncodedAudioFrame::Trace(Visitor* visitor) {
-diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.h b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.h
-index 1e11e9ed04ee..7565e4b1ebc8 100644
---- a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.h
-+++ b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.h
-@@ -20,7 +20,6 @@ class TransformableFrameInterface;
- namespace blink {
-
- class DOMArrayBuffer;
--class RTCEncodedAudioFrameDelegate;
-
- class MODULES_EXPORT RTCEncodedAudioFrame final : public ScriptWrappable {
- DEFINE_WRAPPERTYPEINFO();
-@@ -30,8 +29,6 @@ class MODULES_EXPORT RTCEncodedAudioFrame final : public ScriptWrappable {
- std::unique_ptr<webrtc::TransformableFrameInterface> webrtc_frame);
- explicit RTCEncodedAudioFrame(
- std::unique_ptr<webrtc::TransformableAudioFrameInterface> webrtc_frame);
-- explicit RTCEncodedAudioFrame(
-- scoped_refptr<RTCEncodedAudioFrameDelegate> delegate);
-
- // rtc_encoded_audio_frame.idl implementation.
- uint64_t timestamp() const;
-@@ -42,20 +39,17 @@ class MODULES_EXPORT RTCEncodedAudioFrame final : public ScriptWrappable {
- Vector<uint32_t> contributingSources() const;
- String toString() const;
-
-- scoped_refptr<RTCEncodedAudioFrameDelegate> Delegate() const;
-- void SyncDelegate() const;
--
- // Returns and transfers ownership of the internal WebRTC frame
-- // backing this RTCEncodedAudioFrame, neutering all RTCEncodedAudioFrames
-- // backed by that internal WebRTC frame.
-- std::unique_ptr<webrtc::TransformableFrameInterface> PassWebRtcFrame();
-+ // backing this RTCEncodedVideoFrame, leaving the RTCEncodedVideoFrame
-+ // without a delegate WebRTC frame.
-+ std::unique_ptr<webrtc::TransformableFrameInterface> PassDelegate();
-
- void Trace(Visitor*) override;
-
- private:
-- scoped_refptr<RTCEncodedAudioFrameDelegate> delegate_;
-- Vector<uint32_t> contributing_sources_;
- mutable Member<DOMArrayBuffer> frame_data_;
-+ Vector<uint32_t> contributing_sources_;
-+ std::unique_ptr<webrtc::TransformableFrameInterface> webrtc_frame_;
- };
-
- } // namespace blink
-diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame_delegate.cc b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame_delegate.cc
-deleted file mode 100644
-index 2c71c02c5223..000000000000
---- a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame_delegate.cc
-+++ /dev/null
-@@ -1,68 +0,0 @@
--// Copyright 2020 The Chromium Authors. All rights reserved.
--// Use of this source code is governed by a BSD-style license that can be
--// found in the LICENSE file.
--
--#include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame_delegate.h"
--
--#include <utility>
--
--#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h"
--
--namespace blink {
--
--const void* RTCEncodedAudioFramesAttachment::kAttachmentKey;
--
--RTCEncodedAudioFrameDelegate::RTCEncodedAudioFrameDelegate(
-- std::unique_ptr<webrtc::TransformableFrameInterface> webrtc_frame,
-- Vector<uint32_t> contributing_sources)
-- : webrtc_frame_(std::move(webrtc_frame)),
-- contributing_sources_(std::move(contributing_sources)) {}
--
--uint64_t RTCEncodedAudioFrameDelegate::Timestamp() const {
-- MutexLocker lock(mutex_);
-- return webrtc_frame_ ? webrtc_frame_->GetTimestamp() : 0;
--}
--
--DOMArrayBuffer* RTCEncodedAudioFrameDelegate::CreateDataBuffer() const {
-- ArrayBufferContents contents;
-- {
-- MutexLocker lock(mutex_);
-- if (!webrtc_frame_)
-- return nullptr;
--
-- auto data = webrtc_frame_->GetData();
-- contents =
-- ArrayBufferContents(data.size(), 1, ArrayBufferContents::kNotShared,
-- ArrayBufferContents::kDontInitialize);
-- if (UNLIKELY(!contents.Data()))
-- OOM_CRASH(data.size());
-- memcpy(contents.Data(), data.data(), data.size());
-- }
-- return DOMArrayBuffer::Create(std::move(contents));
--}
--
--void RTCEncodedAudioFrameDelegate::SetData(const DOMArrayBuffer* data) {
-- MutexLocker lock(mutex_);
-- if (webrtc_frame_ && data) {
-- webrtc_frame_->SetData(rtc::ArrayView<const uint8_t>(
-- static_cast<const uint8_t*>(data->Data()), data->ByteLengthAsSizeT()));
-- }
--}
--
--uint32_t RTCEncodedAudioFrameDelegate::Ssrc() const {
-- MutexLocker lock(mutex_);
-- return webrtc_frame_ ? webrtc_frame_->GetSsrc() : 0;
--}
--
--Vector<uint32_t> RTCEncodedAudioFrameDelegate::ContributingSources() const {
-- MutexLocker lock(mutex_);
-- return contributing_sources_;
--}
--
--std::unique_ptr<webrtc::TransformableFrameInterface>
--RTCEncodedAudioFrameDelegate::PassWebRtcFrame() {
-- MutexLocker lock(mutex_);
-- return std::move(webrtc_frame_);
--}
--
--} // namespace blink
-diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame_delegate.h b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame_delegate.h
-deleted file mode 100644
-index 90853ecfa325..000000000000
---- a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame_delegate.h
-+++ /dev/null
-@@ -1,72 +0,0 @@
--// Copyright 2020 The Chromium Authors. All rights reserved.
--// Use of this source code is governed by a BSD-style license that can be
--// found in the LICENSE file.
--
--#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ENCODED_AUDIO_FRAME_DELEGATE_H_
--#define THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ENCODED_AUDIO_FRAME_DELEGATE_H_
--
--#include <stdint.h>
--
--#include <memory>
--
--#include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h"
--#include "third_party/blink/renderer/modules/modules_export.h"
--#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h"
--#include "third_party/blink/renderer/platform/wtf/threading_primitives.h"
--#include "third_party/webrtc/api/frame_transformer_interface.h"
--
--namespace blink {
--
--class DOMArrayBuffer;
--
--// This class wraps a WebRTC audio frame and allows making shallow
--// copies. Its purpose is to support making RTCEncodedVideoFrames
--// serializable in the same process.
--class RTCEncodedAudioFrameDelegate
-- : public WTF::ThreadSafeRefCounted<RTCEncodedAudioFrameDelegate> {
-- public:
-- explicit RTCEncodedAudioFrameDelegate(
-- std::unique_ptr<webrtc::TransformableFrameInterface> webrtc_frame,
-- Vector<uint32_t> contributing_sources);
--
-- uint64_t Timestamp() const;
-- DOMArrayBuffer* CreateDataBuffer() const;
-- void SetData(const DOMArrayBuffer* data);
-- uint32_t Ssrc() const;
-- Vector<uint32_t> ContributingSources() const;
-- std::unique_ptr<webrtc::TransformableFrameInterface> PassWebRtcFrame();
--
-- private:
-- mutable Mutex mutex_;
-- std::unique_ptr<webrtc::TransformableFrameInterface> webrtc_frame_
-- GUARDED_BY(mutex_);
-- Vector<uint32_t> contributing_sources_;
--};
--
--class MODULES_EXPORT RTCEncodedAudioFramesAttachment
-- : public SerializedScriptValue::Attachment {
-- public:
-- static const void* kAttachmentKey;
-- RTCEncodedAudioFramesAttachment() = default;
-- ~RTCEncodedAudioFramesAttachment() override = default;
--
-- bool IsLockedToAgentCluster() const override {
-- return !encoded_audio_frames_.IsEmpty();
-- }
--
-- Vector<scoped_refptr<RTCEncodedAudioFrameDelegate>>& EncodedAudioFrames() {
-- return encoded_audio_frames_;
-- }
--
-- const Vector<scoped_refptr<RTCEncodedAudioFrameDelegate>>&
-- EncodedAudioFrames() const {
-- return encoded_audio_frames_;
-- }
--
-- private:
-- Vector<scoped_refptr<RTCEncodedAudioFrameDelegate>> encoded_audio_frames_;
--};
--
--} // namespace blink
--
--#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ENCODED_AUDIO_FRAME_DELEGATE_H_
-diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink.cc b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink.cc
-index c0e5fa9c6f44..2635b6348029 100644
---- a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink.cc
-+++ b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink.cc
-@@ -48,8 +48,7 @@ ScriptPromise RTCEncodedAudioUnderlyingSink::write(
- return ScriptPromise();
- }
-
-- transformer_callback_.Run()->SendFrameToSink(
-- encoded_frame->PassWebRtcFrame());
-+ transformer_callback_.Run()->SendFrameToSink(encoded_frame->PassDelegate());
- return ScriptPromise::CastUndefined(script_state);
- }
-
---
-2.26.1
-