commit b8005febde95f2a3b1e99b8977091f4579a7b7a1 parent dafda85a58afd0560359f15a2b34f25567dee53d Author: agoloman <agoloman@mozilla.com> Date: Wed, 8 Oct 2025 05:59:29 +0300 Revert "Bug 1868223 - Reenable WPT RTCRtpScriptTransform-sender-worker-single-frame.https.html. r=bwc" for causing ios build bustages @StructuredCloneHolder.cpp. This reverts commit 7988aa91567244a30ad3ea88417b71973443083e. Revert "Bug 1868223 - Implement custom RTCEncodedAudioFrame::Read/WriteStructuredClone for same process. r=bwc" This reverts commit e37d4c6dc5f50ccc92cfce0a8bb8622780a85703. Revert "Bug 1868223 - Implement custom RTCEncodedVideoFrame::Read/WriteStructuredClone for same process. r=bwc,webidl,smaug" This reverts commit 17b8e797b622c8e5c2f05ab8c30dcce401ff5981. Revert "Bug 1868223 - Add moz.build files from updated BUILD.gn r=mjf" This reverts commit 5c0daa9ed9ff148beb20b22345c7c105173c4008. Revert "Bug 1868223 - Add api:frame_transformer_factory to BUILD.gn r=mjf" This reverts commit 84bd0063760c4b0c9e5edeeb93f4499ab475771f. Diffstat:
16 files changed, 67 insertions(+), 630 deletions(-)
diff --git a/dom/base/StructuredCloneHolder.cpp b/dom/base/StructuredCloneHolder.cpp @@ -22,7 +22,6 @@ #include "mozilla/RefPtr.h" #include "mozilla/ScopeExit.h" #include "mozilla/StaticPrefs_dom.h" -#include "mozilla/StaticPrefs_media.h" #include "mozilla/dom/AudioData.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/BindingUtils.h" @@ -53,10 +52,6 @@ #include "mozilla/dom/MessagePortBinding.h" #include "mozilla/dom/OffscreenCanvas.h" #include "mozilla/dom/OffscreenCanvasBinding.h" -#include "mozilla/dom/RTCEncodedAudioFrame.h" -#include "mozilla/dom/RTCEncodedAudioFrameBinding.h" -#include "mozilla/dom/RTCEncodedVideoFrame.h" -#include "mozilla/dom/RTCEncodedVideoFrameBinding.h" #include "mozilla/dom/ReadableStream.h" #include "mozilla/dom/ReadableStreamBinding.h" #include "mozilla/dom/ScriptSettings.h" @@ -1160,28 +1155,6 @@ JSObject* StructuredCloneHolder::CustomReadHandler( } } - if (StaticPrefs::media_peerconnection_enabled() && - aTag == SCTAG_DOM_RTCENCODEDVIDEOFRAME && - CloneScope() == StructuredCloneScope::SameProcess && - aCloneDataPolicy.areIntraClusterClonableSharedObjectsAllowed()) { - JS::Rooted<JSObject*> global(aCx, mGlobal->GetGlobalJSObject()); - if (RTCEncodedVideoFrame_Binding::ConstructorEnabled(aCx, global)) { - return RTCEncodedVideoFrame::ReadStructuredClone( - aCx, mGlobal, aReader, RtcEncodedVideoFrames()[aIndex]); - } - } - - if (StaticPrefs::media_peerconnection_enabled() && - aTag == SCTAG_DOM_RTCENCODEDAUDIOFRAME && - CloneScope() == StructuredCloneScope::SameProcess && - aCloneDataPolicy.areIntraClusterClonableSharedObjectsAllowed()) { - JS::Rooted<JSObject*> global(aCx, mGlobal->GetGlobalJSObject()); - if (RTCEncodedAudioFrame_Binding::ConstructorEnabled(aCx, global)) { - return RTCEncodedAudioFrame::ReadStructuredClone( - aCx, mGlobal, aReader, RtcEncodedAudioFrames()[aIndex]); - } - } - return ReadFullySerializableObjects(aCx, aReader, aTag, false); } @@ -1324,28 +1297,6 @@ bool StructuredCloneHolder::CustomWriteHandler( } } - // See if this is an RTCEncodedVideoFrame object. - if (StaticPrefs::media_peerconnection_enabled()) { - RTCEncodedVideoFrame* rtcFrame = nullptr; - if (NS_SUCCEEDED(UNWRAP_OBJECT(RTCEncodedVideoFrame, &obj, rtcFrame))) { - SameProcessScopeRequired(aSameProcessScopeRequired); - return CloneScope() == StructuredCloneScope::SameProcess - ? rtcFrame->WriteStructuredClone(aWriter, this) - : false; - } - } - - // See if this is an RTCEncodedAudioFrame object. - if (StaticPrefs::media_peerconnection_enabled()) { - RTCEncodedAudioFrame* rtcFrame = nullptr; - if (NS_SUCCEEDED(UNWRAP_OBJECT(RTCEncodedAudioFrame, &obj, rtcFrame))) { - SameProcessScopeRequired(aSameProcessScopeRequired); - return CloneScope() == StructuredCloneScope::SameProcess - ? rtcFrame->WriteStructuredClone(aWriter, this) - : false; - } - } - { // We only care about streams, so ReflectorToISupportsStatic is fine. nsCOMPtr<nsISupports> base = xpc::ReflectorToISupportsStatic(aObj); diff --git a/dom/base/StructuredCloneHolder.h b/dom/base/StructuredCloneHolder.h @@ -172,8 +172,6 @@ class MessagePort; class MessagePortIdentifier; struct VideoFrameSerializedData; struct AudioDataSerializedData; -struct RTCEncodedVideoFrameData; -struct RTCEncodedAudioFrameData; class StructuredCloneHolder : public StructuredCloneHolderBase { public: @@ -216,17 +214,15 @@ class StructuredCloneHolder : public StructuredCloneHolderBase { // Create a statement for each of the side DOM-ish data members. // mTransferredPorts is not included because it is part of the // deserialized state. -#define CLONED_DATA_MEMBERS \ - STMT(mBlobImplArray); \ - STMT(mWasmModuleArray); \ - STMT(mInputStreamArray); \ - STMT(mClonedSurfaces); \ - STMT(mVideoFrames); \ - STMT(mAudioData); \ - STMT(mEncodedVideoChunks); \ - STMT(mEncodedAudioChunks); \ - STMT(mRtcEncodedVideoFrames); \ - STMT(mRtcEncodedAudioFrames); \ +#define CLONED_DATA_MEMBERS \ + STMT(mBlobImplArray); \ + STMT(mWasmModuleArray); \ + STMT(mInputStreamArray); \ + STMT(mClonedSurfaces); \ + STMT(mVideoFrames); \ + STMT(mAudioData); \ + STMT(mEncodedVideoChunks); \ + STMT(mEncodedAudioChunks); \ STMT(mPortIdentifiers); // Call this method to know if this object is keeping some DOM object alive. @@ -306,14 +302,6 @@ class StructuredCloneHolder : public StructuredCloneHolderBase { return mEncodedAudioChunks; } - nsTArray<RTCEncodedVideoFrameData>& RtcEncodedVideoFrames() { - return mRtcEncodedVideoFrames; - } - - nsTArray<RTCEncodedAudioFrameData>& RtcEncodedAudioFrames() { - return mRtcEncodedAudioFrames; - } - // Implementations of the virtual methods to allow cloning of objects which // JS engine itself doesn't clone. @@ -428,12 +416,6 @@ class StructuredCloneHolder : public StructuredCloneHolderBase { // Used for cloning EncodedAudioChunk in the structured cloning algorithm. nsTArray<EncodedAudioChunkData> mEncodedAudioChunks; - // Used for cloning RTCEncodedVideoFrame in the structured cloning algorithm. - nsTArray<RTCEncodedVideoFrameData> mRtcEncodedVideoFrames; - - // Used for cloning RTCEncodedAudioFrame in the structured cloning algorithm. - nsTArray<RTCEncodedAudioFrameData> mRtcEncodedAudioFrames; - // This raw pointer is only set within ::Read() and is unset by the end. nsIGlobalObject* MOZ_NON_OWNING_REF mGlobal; diff --git a/dom/base/StructuredCloneTags.h b/dom/base/StructuredCloneTags.h @@ -163,10 +163,6 @@ enum StructuredCloneTags : uint32_t { SCTAG_DOM_RTCDATACHANNEL, - SCTAG_DOM_RTCENCODEDVIDEOFRAME, - - SCTAG_DOM_RTCENCODEDAUDIOFRAME, - // IMPORTANT: If you plan to add an new IDB tag, it _must_ be add before the // "less stable" tags! }; diff --git a/dom/media/webrtc/jsapi/RTCEncodedAudioFrame.cpp b/dom/media/webrtc/jsapi/RTCEncodedAudioFrame.cpp @@ -11,7 +11,6 @@ #include <memory> #include <utility> -#include "api/frame_transformer_factory.h" #include "api/frame_transformer_interface.h" #include "js/RootingAPI.h" #include "jsapi/RTCEncodedFrameBase.h" @@ -21,8 +20,6 @@ #include "mozilla/Unused.h" #include "mozilla/dom/RTCEncodedAudioFrameBinding.h" #include "mozilla/dom/RTCRtpScriptTransformer.h" -#include "mozilla/dom/StructuredCloneHolder.h" -#include "mozilla/dom/StructuredCloneTags.h" #include "mozilla/fallible.h" #include "nsContentUtils.h" #include "nsCycleCollectionParticipant.h" @@ -32,20 +29,8 @@ namespace mozilla::dom { -NS_IMPL_CYCLE_COLLECTION_CLASS(RTCEncodedAudioFrame) -NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(RTCEncodedAudioFrame, - RTCEncodedFrameBase) - NS_IMPL_CYCLE_COLLECTION_UNLINK(mOwner) - NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER -NS_IMPL_CYCLE_COLLECTION_UNLINK_END -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(RTCEncodedAudioFrame, - RTCEncodedFrameBase) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwner) -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END -NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(RTCEncodedAudioFrame, - RTCEncodedFrameBase) - NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER -NS_IMPL_CYCLE_COLLECTION_TRACE_END +NS_IMPL_CYCLE_COLLECTION_INHERITED(RTCEncodedAudioFrame, RTCEncodedFrameBase, + mOwner) NS_IMPL_ADDREF_INHERITED(RTCEncodedAudioFrame, RTCEncodedFrameBase) NS_IMPL_RELEASE_INHERITED(RTCEncodedAudioFrame, RTCEncodedFrameBase) @@ -57,8 +42,7 @@ RTCEncodedAudioFrame::RTCEncodedAudioFrame( nsIGlobalObject* aGlobal, std::unique_ptr<webrtc::TransformableFrameInterface> aFrame, uint64_t aCounter, RTCRtpScriptTransformer* aOwner) - : RTCEncodedAudioFrameData{{std::move(aFrame), aCounter, /*timestamp*/ 0}}, - RTCEncodedFrameBase(aGlobal, static_cast<RTCEncodedFrameState&>(*this)), + : RTCEncodedFrameBase(aGlobal, std::move(aFrame), aCounter), mOwner(aOwner) { mMetadata.mSynchronizationSource.Construct(mFrame->GetSsrc()); mMetadata.mPayloadType.Construct(mFrame->GetPayloadType()); @@ -78,22 +62,7 @@ RTCEncodedAudioFrame::RTCEncodedAudioFrame( mozilla::HoldJSObjects(this); } -RTCEncodedAudioFrame::RTCEncodedAudioFrame(nsIGlobalObject* aGlobal, - RTCEncodedAudioFrameData&& aData) - : RTCEncodedAudioFrameData{{std::move(aData.mFrame), aData.mCounter, - aData.mTimestamp}, - std::move(aData.mMetadata)}, - RTCEncodedFrameBase(aGlobal, static_cast<RTCEncodedFrameState&>(*this)), - mOwner(nullptr) { - // Base class needs this, but can't do it itself because of an assertion in - // the cycle-collector. - mozilla::HoldJSObjects(this); -} - RTCEncodedAudioFrame::~RTCEncodedAudioFrame() { - // Clear JS::Heap<> members before unregistering as a script holder, - // so their destructors don't barrier against a finalized JS object. - mData = nullptr; // from RTCEncodedFrameBase (protected) // Base class needs this, but can't do it itself because of an assertion in // the cycle-collector. mozilla::DropJSObjects(this); @@ -104,14 +73,6 @@ JSObject* RTCEncodedAudioFrame::WrapObject(JSContext* aCx, return RTCEncodedAudioFrame_Binding::Wrap(aCx, this, aGivenProto); } -RTCEncodedAudioFrameData RTCEncodedAudioFrameData::Clone() const { - return RTCEncodedAudioFrameData{ - {webrtc::CloneAudioFrame( - static_cast<webrtc::TransformableAudioFrameInterface*>( - mFrame.get()))}, - RTCEncodedAudioFrameMetadata(mMetadata)}; -} - nsIGlobalObject* RTCEncodedAudioFrame::GetParentObject() const { return mGlobal; } @@ -124,43 +85,4 @@ void RTCEncodedAudioFrame::GetMetadata( bool RTCEncodedAudioFrame::CheckOwner(RTCRtpScriptTransformer* aOwner) const { return aOwner == mOwner; } - -// https://www.w3.org/TR/webrtc-encoded-transform/#RTCEncodedAudioFrame-serialization -/* static */ -JSObject* RTCEncodedAudioFrame::ReadStructuredClone( - JSContext* aCx, nsIGlobalObject* aGlobal, JSStructuredCloneReader* aReader, - RTCEncodedAudioFrameData& aData) { - JS::Rooted<JS::Value> value(aCx, JS::NullValue()); - // To avoid a rooting hazard error from returning a raw JSObject* before - // running the RefPtr destructor, RefPtr needs to be destructed before - // returning the raw JSObject*, which is why the RefPtr<RTCEncodedAudioFrame> - // is created in the scope below. Otherwise, the static analysis infers the - // RefPtr cannot be safely destructed while the unrooted return JSObject* is - // on the stack. - { - auto frame = MakeRefPtr<RTCEncodedAudioFrame>(aGlobal, std::move(aData)); - if (!GetOrCreateDOMReflector(aCx, frame, &value) || !value.isObject()) { - return nullptr; - } - } - return value.toObjectOrNull(); -} - -bool RTCEncodedAudioFrame::WriteStructuredClone( - JSStructuredCloneWriter* aWriter, StructuredCloneHolder* aHolder) const { - AssertIsOnOwningThread(); - - // Indexing the chunk and send the index to the receiver. - const uint32_t index = - static_cast<uint32_t>(aHolder->RtcEncodedAudioFrames().Length()); - // The serialization is limited to the same process scope so it's ok to - // hand over a (copy of a) webrtc internal object here. - // - // TODO: optimize later once encoded source API materializes - // .AppendElement(aHolder->IsTransferred(mData) ? Take() : Clone()) - aHolder->RtcEncodedAudioFrames().AppendElement(Clone()); - return !NS_WARN_IF( - !JS_WriteUint32Pair(aWriter, SCTAG_DOM_RTCENCODEDAUDIOFRAME, index)); -} - } // namespace mozilla::dom diff --git a/dom/media/webrtc/jsapi/RTCEncodedAudioFrame.h b/dom/media/webrtc/jsapi/RTCEncodedAudioFrame.h @@ -7,40 +7,28 @@ #ifndef MOZILLA_DOM_MEDIA_WEBRTC_JSAPI_RTCENCODEDAUDIOFRAME_H_ #define MOZILLA_DOM_MEDIA_WEBRTC_JSAPI_RTCENCODEDAUDIOFRAME_H_ +#include "jsapi/RTCEncodedFrameBase.h" #include "mozilla/RefPtr.h" #include "mozilla/dom/RTCEncodedAudioFrameBinding.h" -#include "mozilla/dom/RTCEncodedFrameBase.h" #include "nsIGlobalObject.h" namespace mozilla::dom { -class StructuredCloneHolder; - -struct RTCEncodedAudioFrameData : RTCEncodedFrameState { - RTCEncodedAudioFrameMetadata mMetadata; - - [[nodiscard]] RTCEncodedAudioFrameData Clone() const; -}; - // Wraps a libwebrtc frame, allowing the frame buffer to be modified, and // providing read-only access to various metadata. After the libwebrtc frame is // extracted (with RTCEncodedFrameBase::TakeFrame), the frame buffer is // detached, but the metadata remains accessible. -class RTCEncodedAudioFrame final : public RTCEncodedAudioFrameData, - public RTCEncodedFrameBase { +class RTCEncodedAudioFrame final : public RTCEncodedFrameBase { public: explicit RTCEncodedAudioFrame( nsIGlobalObject* aGlobal, std::unique_ptr<webrtc::TransformableFrameInterface> aFrame, uint64_t aCounter, RTCRtpScriptTransformer* aOwner); - explicit RTCEncodedAudioFrame(nsIGlobalObject* aGlobal, - RTCEncodedAudioFrameData&& aData); - // nsISupports NS_DECL_ISUPPORTS_INHERITED - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(RTCEncodedAudioFrame, - RTCEncodedFrameBase) + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(RTCEncodedAudioFrame, + RTCEncodedFrameBase) // webidl (timestamp and data accessors live in base class) JSObject* WrapObject(JSContext* aCx, @@ -54,27 +42,10 @@ class RTCEncodedAudioFrame final : public RTCEncodedAudioFrameData, bool IsVideo() const override { return false; } - static JSObject* ReadStructuredClone(JSContext* aCx, nsIGlobalObject* aGlobal, - JSStructuredCloneReader* aReader, - RTCEncodedAudioFrameData& aData); - bool WriteStructuredClone(JSStructuredCloneWriter* aWriter, - StructuredCloneHolder* aHolder) const; - private: virtual ~RTCEncodedAudioFrame(); - - // forbid copy/move to keep mState member in base valid - RTCEncodedAudioFrame(const RTCEncodedAudioFrame&) = delete; - RTCEncodedAudioFrame& operator=(const RTCEncodedAudioFrame&) = delete; - RTCEncodedAudioFrame(RTCEncodedAudioFrame&&) = delete; - RTCEncodedAudioFrame& operator=(RTCEncodedAudioFrame&&) = delete; - - // RTCEncodedAudioFrame can run on either main thread or worker thread. - void AssertIsOnOwningThread() const { - NS_ASSERT_OWNINGTHREAD(RTCEncodedAudioFrame); - } - RefPtr<RTCRtpScriptTransformer> mOwner; + RTCEncodedAudioFrameMetadata mMetadata; }; } // namespace mozilla::dom diff --git a/dom/media/webrtc/jsapi/RTCEncodedFrameBase.cpp b/dom/media/webrtc/jsapi/RTCEncodedFrameBase.cpp @@ -6,7 +6,6 @@ #include "jsapi/RTCEncodedFrameBase.h" -#include "api/frame_transformer_interface.h" #include "js/ArrayBuffer.h" #include "js/GCAPI.h" #include "mozilla/dom/ScriptSettings.h" @@ -22,10 +21,14 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(RTCEncodedFrameBase) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END -RTCEncodedFrameBase::RTCEncodedFrameBase(nsIGlobalObject* aGlobal, - RTCEncodedFrameState& aState) - : mGlobal(aGlobal), mState(aState), mData(nullptr) { - mState.mTimestamp = mState.mFrame->GetTimestamp(); +RTCEncodedFrameBase::RTCEncodedFrameBase( + nsIGlobalObject* aGlobal, + std::unique_ptr<webrtc::TransformableFrameInterface> aFrame, + uint64_t aCounter) + : mGlobal(aGlobal), + mFrame(std::move(aFrame)), + mCounter(aCounter), + mTimestamp(mFrame->GetTimestamp()) { AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(mGlobal))) { return; @@ -33,52 +36,38 @@ RTCEncodedFrameBase::RTCEncodedFrameBase(nsIGlobalObject* aGlobal, // Avoid a copy mData = JS::NewArrayBufferWithUserOwnedContents( - jsapi.cx(), mState.mFrame->GetData().size(), - (void*)(mState.mFrame->GetData().data())); + jsapi.cx(), mFrame->GetData().size(), (void*)(mFrame->GetData().data())); } RTCEncodedFrameBase::~RTCEncodedFrameBase() = default; -unsigned long RTCEncodedFrameBase::Timestamp() const { - return mState.mTimestamp; -} +unsigned long RTCEncodedFrameBase::Timestamp() const { return mTimestamp; } void RTCEncodedFrameBase::SetData(const ArrayBuffer& aData) { mData.set(aData.Obj()); - if (mState.mFrame) { + if (mFrame) { aData.ProcessData([&](const Span<uint8_t>& aData, JS::AutoCheckCannotGC&&) { - mState.mFrame->SetData( + mFrame->SetData( webrtc::ArrayView<const uint8_t>(aData.Elements(), aData.Length())); }); } } -void RTCEncodedFrameBase::GetData(JSContext* aCx, - JS::Rooted<JSObject*>* aObj) const { +void RTCEncodedFrameBase::GetData(JSContext* aCx, JS::Rooted<JSObject*>* aObj) { aObj->set(mData); } -uint64_t RTCEncodedFrameBase::GetCounter() const { return mState.mCounter; } +uint64_t RTCEncodedFrameBase::GetCounter() const { return mCounter; } std::unique_ptr<webrtc::TransformableFrameInterface> RTCEncodedFrameBase::TakeFrame() { - if (mState.mFrame) { - AutoJSAPI jsapi; - if (!jsapi.Init(mGlobal)) { - MOZ_CRASH("Could not init JSAPI!"); - } - // If the JS buffer was transferred (or otherwise detached), neuter native. - JS::Rooted<JSObject*> rootedData(jsapi.cx(), mData); - if (rootedData && JS::IsDetachedArrayBufferObject(rootedData)) { - mState.mFrame.reset(); - return nullptr; - } - // Still attached: detach now since we're consuming the frame. - JS::DetachArrayBuffer(jsapi.cx(), rootedData); + AutoJSAPI jsapi; + if (!jsapi.Init(mGlobal)) { + MOZ_CRASH("Could not init JSAPI!"); } - return std::move(mState.mFrame); + JS::Rooted<JSObject*> rootedData(jsapi.cx(), mData); + JS::DetachArrayBuffer(jsapi.cx(), rootedData); + return std::move(mFrame); } -RTCEncodedFrameState::~RTCEncodedFrameState() = default; - } // namespace mozilla::dom diff --git a/dom/media/webrtc/jsapi/RTCEncodedFrameBase.h b/dom/media/webrtc/jsapi/RTCEncodedFrameBase.h @@ -9,40 +9,23 @@ #include <memory> +#include "api/frame_transformer_interface.h" #include "js/TypeDecls.h" #include "mozilla/Assertions.h" #include "mozilla/dom/TypedArray.h" // ArrayBuffer class nsIGlobalObject; -namespace webrtc { -class TransformableFrameInterface; -} - namespace mozilla::dom { -struct RTCEncodedFrameState { - std::unique_ptr<webrtc::TransformableFrameInterface> mFrame; - uint64_t mCounter = 0; - unsigned long mTimestamp = 0; - - // work around only having forward-declared TransformableFrameInterface - ~RTCEncodedFrameState(); - - // avoid "move got disabled by a user-declared destructor” trap - RTCEncodedFrameState() = default; - RTCEncodedFrameState(RTCEncodedFrameState&&) noexcept = default; - RTCEncodedFrameState& operator=(RTCEncodedFrameState&&) noexcept = default; - RTCEncodedFrameState(const RTCEncodedFrameState&) = delete; - RTCEncodedFrameState& operator=(const RTCEncodedFrameState&) = delete; -}; - class RTCRtpScriptTransformer; class RTCEncodedFrameBase : public nsISupports, public nsWrapperCache { public: - explicit RTCEncodedFrameBase(nsIGlobalObject* aGlobal, - RTCEncodedFrameState& aState); + explicit RTCEncodedFrameBase( + nsIGlobalObject* aGlobal, + std::unique_ptr<webrtc::TransformableFrameInterface> aFrame, + uint64_t aCounter); // nsISupports NS_DECL_CYCLE_COLLECTING_ISUPPORTS @@ -53,7 +36,7 @@ class RTCEncodedFrameBase : public nsISupports, public nsWrapperCache { void SetData(const ArrayBuffer& aData); - void GetData(JSContext* aCx, JS::Rooted<JSObject*>* aObj) const; + void GetData(JSContext* aCx, JS::Rooted<JSObject*>* aObj); uint64_t GetCounter() const; @@ -65,20 +48,10 @@ class RTCEncodedFrameBase : public nsISupports, public nsWrapperCache { protected: virtual ~RTCEncodedFrameBase(); - - // forbid copy/move to protect mState - RTCEncodedFrameBase(const RTCEncodedFrameBase&) = delete; - RTCEncodedFrameBase& operator=(const RTCEncodedFrameBase&) = delete; - RTCEncodedFrameBase(RTCEncodedFrameBase&&) = delete; - RTCEncodedFrameBase& operator=(RTCEncodedFrameBase&&) = delete; - RefPtr<nsIGlobalObject> mGlobal; - - // Keep serializable state separate in this base and its subclasses - // in a manner that avoids diamond inheritance. Subclasses must pass - // in *this, to ensure it's constructed before and destroyed after - // this base; copy and move are deleted. - RTCEncodedFrameState& mState; + std::unique_ptr<webrtc::TransformableFrameInterface> mFrame; + const uint64_t mCounter = 0; + const unsigned long mTimestamp = 0; JS::Heap<JSObject*> mData; }; diff --git a/dom/media/webrtc/jsapi/RTCEncodedVideoFrame.cpp b/dom/media/webrtc/jsapi/RTCEncodedVideoFrame.cpp @@ -12,7 +12,6 @@ #include <string> #include <utility> -#include "api/frame_transformer_factory.h" #include "api/frame_transformer_interface.h" #include "js/RootingAPI.h" #include "jsapi/RTCEncodedFrameBase.h" @@ -21,8 +20,6 @@ #include "mozilla/Unused.h" #include "mozilla/dom/RTCEncodedVideoFrameBinding.h" #include "mozilla/dom/RTCRtpScriptTransformer.h" -#include "mozilla/dom/StructuredCloneHolder.h" -#include "mozilla/dom/StructuredCloneTags.h" #include "mozilla/fallible.h" #include "nsContentUtils.h" #include "nsCycleCollectionParticipant.h" @@ -32,22 +29,11 @@ namespace mozilla::dom { -NS_IMPL_CYCLE_COLLECTION_CLASS(RTCEncodedVideoFrame) -NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(RTCEncodedVideoFrame, - RTCEncodedFrameBase) - NS_IMPL_CYCLE_COLLECTION_UNLINK(mOwner) - NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER -NS_IMPL_CYCLE_COLLECTION_UNLINK_END -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(RTCEncodedVideoFrame, - RTCEncodedFrameBase) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwner) -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END -NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(RTCEncodedVideoFrame, - RTCEncodedFrameBase) - NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER -NS_IMPL_CYCLE_COLLECTION_TRACE_END +NS_IMPL_CYCLE_COLLECTION_INHERITED(RTCEncodedVideoFrame, RTCEncodedFrameBase, + mOwner) NS_IMPL_ADDREF_INHERITED(RTCEncodedVideoFrame, RTCEncodedFrameBase) NS_IMPL_RELEASE_INHERITED(RTCEncodedVideoFrame, RTCEncodedFrameBase) + NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(RTCEncodedVideoFrame) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY NS_INTERFACE_MAP_END_INHERITING(RTCEncodedFrameBase) @@ -56,30 +42,8 @@ RTCEncodedVideoFrame::RTCEncodedVideoFrame( nsIGlobalObject* aGlobal, std::unique_ptr<webrtc::TransformableFrameInterface> aFrame, uint64_t aCounter, RTCRtpScriptTransformer* aOwner) - : RTCEncodedVideoFrameData{{std::move(aFrame), aCounter, /*timestamp*/ 0}}, - RTCEncodedFrameBase(aGlobal, static_cast<RTCEncodedFrameState&>(*this)), + : RTCEncodedFrameBase(aGlobal, std::move(aFrame), aCounter), mOwner(aOwner) { - InitMetadata(); - // Base class needs this, but can't do it itself because of an assertion in - // the cycle-collector. - mozilla::HoldJSObjects(this); -} - -RTCEncodedVideoFrame::RTCEncodedVideoFrame(nsIGlobalObject* aGlobal, - RTCEncodedVideoFrameData&& aData) - : RTCEncodedVideoFrameData{{std::move(aData.mFrame), aData.mCounter, - aData.mTimestamp}, - aData.mType, - std::move(aData.mMetadata), - aData.mRid}, - RTCEncodedFrameBase(aGlobal, static_cast<RTCEncodedFrameState&>(*this)), - mOwner(nullptr) { - // Base class needs this, but can't do it itself because of an assertion in - // the cycle-collector. - mozilla::HoldJSObjects(this); -} - -void RTCEncodedVideoFrame::InitMetadata() { const auto& videoFrame( static_cast<webrtc::TransformableVideoFrameInterface&>(*mFrame)); mType = videoFrame.IsKeyFrame() ? RTCEncodedVideoFrameType::Key @@ -113,14 +77,15 @@ void RTCEncodedVideoFrame::InitMetadata() { // The metadata timestamp is different, and not presently present in the // libwebrtc types if (!videoFrame.GetRid().empty()) { - mRid = Some(videoFrame.GetRid().c_str()); + mRid = Some(videoFrame.GetRid()); } + + // Base class needs this, but can't do it itself because of an assertion in + // the cycle-collector. + mozilla::HoldJSObjects(this); } RTCEncodedVideoFrame::~RTCEncodedVideoFrame() { - // Clear JS::Heap<> members before unregistering as a script holder, - // so their destructors don't barrier against a finalized JS object. - mData = nullptr; // from RTCEncodedFrameBase (protected) // Base class needs this, but can't do it itself because of an assertion in // the cycle-collector. mozilla::DropJSObjects(this); @@ -131,17 +96,6 @@ JSObject* RTCEncodedVideoFrame::WrapObject(JSContext* aCx, return RTCEncodedVideoFrame_Binding::Wrap(aCx, this, aGivenProto); } -RTCEncodedVideoFrameData RTCEncodedVideoFrameData::Clone() const { - return RTCEncodedVideoFrameData{ - {webrtc::CloneVideoFrame( - static_cast<webrtc::TransformableVideoFrameInterface*>( - mFrame.get())), - mCounter, mTimestamp}, - mType, - RTCEncodedVideoFrameMetadata(mMetadata), - mRid}; -} - nsIGlobalObject* RTCEncodedVideoFrame::GetParentObject() const { return mGlobal; } @@ -157,44 +111,6 @@ bool RTCEncodedVideoFrame::CheckOwner(RTCRtpScriptTransformer* aOwner) const { return aOwner == mOwner; } -Maybe<nsCString> RTCEncodedVideoFrame::Rid() const { return mRid; } - -// https://www.w3.org/TR/webrtc-encoded-transform/#RTCEncodedVideoFrame-serialization -/* static */ -JSObject* RTCEncodedVideoFrame::ReadStructuredClone( - JSContext* aCx, nsIGlobalObject* aGlobal, JSStructuredCloneReader* aReader, - RTCEncodedVideoFrameData& aData) { - JS::Rooted<JS::Value> value(aCx, JS::NullValue()); - // To avoid a rooting hazard error from returning a raw JSObject* before - // running the RefPtr destructor, RefPtr needs to be destructed before - // returning the raw JSObject*, which is why the RefPtr<RTCEncodedVideoFrame> - // is created in the scope below. Otherwise, the static analysis infers the - // RefPtr cannot be safely destructed while the unrooted return JSObject* is - // on the stack. - { - auto frame = MakeRefPtr<RTCEncodedVideoFrame>(aGlobal, std::move(aData)); - if (!GetOrCreateDOMReflector(aCx, frame, &value) || !value.isObject()) { - return nullptr; - } - } - return value.toObjectOrNull(); -} - -bool RTCEncodedVideoFrame::WriteStructuredClone( - JSStructuredCloneWriter* aWriter, StructuredCloneHolder* aHolder) const { - AssertIsOnOwningThread(); - - // Indexing the chunk and send the index to the receiver. - const uint32_t index = - static_cast<uint32_t>(aHolder->RtcEncodedVideoFrames().Length()); - // The serialization is limited to the same process scope so it's ok to - // hand over a (copy of a) webrtc internal object here. - // - // TODO: optimize later once encoded source API materializes - // .AppendElement(aHolder->IsTransferred(mData) ? Take() : Clone()) - aHolder->RtcEncodedVideoFrames().AppendElement(Clone()); - return !NS_WARN_IF( - !JS_WriteUint32Pair(aWriter, SCTAG_DOM_RTCENCODEDVIDEOFRAME, index)); -} +Maybe<std::string> RTCEncodedVideoFrame::Rid() const { return mRid; } } // namespace mozilla::dom diff --git a/dom/media/webrtc/jsapi/RTCEncodedVideoFrame.h b/dom/media/webrtc/jsapi/RTCEncodedVideoFrame.h @@ -7,43 +7,29 @@ #ifndef MOZILLA_DOM_MEDIA_WEBRTC_JSAPI_RTCENCODEDVIDEOFRAME_H_ #define MOZILLA_DOM_MEDIA_WEBRTC_JSAPI_RTCENCODEDVIDEOFRAME_H_ +#include "jsapi/RTCEncodedFrameBase.h" #include "mozilla/RefPtr.h" -#include "mozilla/dom/RTCEncodedFrameBase.h" #include "mozilla/dom/RTCEncodedVideoFrameBinding.h" #include "nsIGlobalObject.h" namespace mozilla::dom { - class RTCRtpScriptTransformer; -class StructuredCloneHolder; - -struct RTCEncodedVideoFrameData : RTCEncodedFrameState { - RTCEncodedVideoFrameType mType; - RTCEncodedVideoFrameMetadata mMetadata; - Maybe<nsCString> mRid; - - [[nodiscard]] RTCEncodedVideoFrameData Clone() const; -}; // Wraps a libwebrtc frame, allowing the frame buffer to be modified, and // providing read-only access to various metadata. After the libwebrtc frame is // extracted (with RTCEncodedFrameBase::TakeFrame), the frame buffer is // detached, but the metadata remains accessible. -class RTCEncodedVideoFrame final : public RTCEncodedVideoFrameData, - public RTCEncodedFrameBase { +class RTCEncodedVideoFrame final : public RTCEncodedFrameBase { public: explicit RTCEncodedVideoFrame( nsIGlobalObject* aGlobal, std::unique_ptr<webrtc::TransformableFrameInterface> aFrame, uint64_t aCounter, RTCRtpScriptTransformer* aOwner); - explicit RTCEncodedVideoFrame(nsIGlobalObject* aGlobal, - RTCEncodedVideoFrameData&& aData); - // nsISupports NS_DECL_ISUPPORTS_INHERITED - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(RTCEncodedVideoFrame, - RTCEncodedFrameBase) + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(RTCEncodedVideoFrame, + RTCEncodedFrameBase) // webidl (timestamp and data accessors live in base class) JSObject* WrapObject(JSContext* aCx, @@ -53,8 +39,6 @@ class RTCEncodedVideoFrame final : public RTCEncodedVideoFrameData, RTCEncodedVideoFrameType Type() const; - void InitMetadata(); - void GetMetadata(RTCEncodedVideoFrameMetadata& aMetadata); bool CheckOwner(RTCRtpScriptTransformer* aOwner) const override; @@ -63,29 +47,14 @@ class RTCEncodedVideoFrame final : public RTCEncodedVideoFrameData, // Not in webidl right now. Might change. // https://github.com/w3c/webrtc-encoded-transform/issues/147 - Maybe<nsCString> Rid() const; - - static JSObject* ReadStructuredClone(JSContext* aCx, nsIGlobalObject* aGlobal, - JSStructuredCloneReader* aReader, - RTCEncodedVideoFrameData& aData); - bool WriteStructuredClone(JSStructuredCloneWriter* aWriter, - StructuredCloneHolder* aHolder) const; + Maybe<std::string> Rid() const; private: virtual ~RTCEncodedVideoFrame(); - - // forbid copy/move to keep mState member in base valid - RTCEncodedVideoFrame(const RTCEncodedVideoFrame&) = delete; - RTCEncodedVideoFrame& operator=(const RTCEncodedVideoFrame&) = delete; - RTCEncodedVideoFrame(RTCEncodedVideoFrame&&) = delete; - RTCEncodedVideoFrame& operator=(RTCEncodedVideoFrame&&) = delete; - - // RTCEncodedVideoFrame can run on either main thread or worker thread. - void AssertIsOnOwningThread() const { - NS_ASSERT_OWNINGTHREAD(RTCEncodedVideoFrame); - } - RefPtr<RTCRtpScriptTransformer> mOwner; + RTCEncodedVideoFrameType mType; + RTCEncodedVideoFrameMetadata mMetadata; + Maybe<std::string> mRid; }; } // namespace mozilla::dom diff --git a/dom/media/webrtc/jsapi/RTCRtpScriptTransformer.cpp b/dom/media/webrtc/jsapi/RTCRtpScriptTransformer.cpp @@ -428,10 +428,7 @@ already_AddRefed<Promise> RTCRtpScriptTransformer::OnTransformedFrame( if (aFrame->GetCounter() > mLastReceivedFrameCounter && aFrame->CheckOwner(this) && mProxy) { mLastReceivedFrameCounter = aFrame->GetCounter(); - // also skip if frame has been detached (transferred away) - if (auto frame = aFrame->TakeFrame()) { - mProxy->OnTransformedFrame(std::move(frame)); - } + mProxy->OnTransformedFrame(aFrame->TakeFrame()); } return Promise::CreateResolvedWithUndefined(GetParentObject(), aError); diff --git a/dom/webidl/RTCEncodedAudioFrame.webidl b/dom/webidl/RTCEncodedAudioFrame.webidl @@ -14,8 +14,6 @@ dictionary RTCEncodedAudioFrameMetadata { short sequenceNumber; }; -// [Serializable] is implemented without adding attribute here, -// because we don't implement "full serialization" to disk. [Pref="media.peerconnection.enabled", Pref="media.peerconnection.scripttransform.enabled", Exposed=(Window,DedicatedWorker)] diff --git a/dom/webidl/RTCEncodedVideoFrame.webidl b/dom/webidl/RTCEncodedVideoFrame.webidl @@ -30,9 +30,6 @@ dictionary RTCEncodedVideoFrameMetadata { // New interfaces to define encoded video and audio frames. Will eventually // re-use or extend the equivalent defined in WebCodecs. -// -// [Serializable] is implemented without adding attribute here, -// because we don't implement "full serialization" to disk. [Pref="media.peerconnection.enabled", Pref="media.peerconnection.scripttransform.enabled", Exposed=(Window,DedicatedWorker)] diff --git a/testing/web-platform/meta/webrtc-encoded-transform/RTCRtpScriptTransform-sender-worker-single-frame.https.html.ini b/testing/web-platform/meta/webrtc-encoded-transform/RTCRtpScriptTransform-sender-worker-single-frame.https.html.ini @@ -0,0 +1,2 @@ +[RTCRtpScriptTransform-sender-worker-single-frame.https.html] + disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1868223 diff --git a/third_party/libwebrtc/BUILD.gn b/third_party/libwebrtc/BUILD.gn @@ -617,7 +617,6 @@ if (!build_with_chromium) { if (build_with_mozilla) { deps += [ - "api:frame_transformer_factory", "api/audio:builtin_audio_processing_builder", "api/environment:environment_factory", "api/video:video_frame", diff --git a/third_party/libwebrtc/api/frame_transformer_factory_gn/moz.build b/third_party/libwebrtc/api/frame_transformer_factory_gn/moz.build @@ -1,224 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - - - ### This moz.build was AUTOMATICALLY GENERATED from a GN config, ### - ### DO NOT edit it by hand. ### - -COMPILE_FLAGS["OS_INCLUDES"] = [] -AllowCompilerWarnings() - -DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1" -DEFINES["PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII"] = "0" -DEFINES["RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY"] = True -DEFINES["RTC_ENABLE_VP9"] = True -DEFINES["WEBRTC_ALLOW_DEPRECATED_NAMESPACES"] = True -DEFINES["WEBRTC_ENABLE_PROTOBUF"] = "0" -DEFINES["WEBRTC_LIBRARY_IMPL"] = True -DEFINES["WEBRTC_MOZILLA_BUILD"] = True -DEFINES["WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS"] = "0" -DEFINES["WEBRTC_STRICT_FIELD_TRIALS"] = "0" -DEFINES["_LIBCPP_HARDENING_MODE"] = "_LIBCPP_HARDENING_MODE_NONE" - -FINAL_LIBRARY = "xul" - - -LOCAL_INCLUDES += [ - "!/dist/include/libwebrtc_overrides", - "!/ipc/ipdl/_ipdlheaders", - "!/third_party/libwebrtc/gen", - "/ipc/chromium/src", - "/third_party/abseil-cpp/", - "/third_party/libwebrtc/", - "/tools/profiler/public" -] - -UNIFIED_SOURCES += [ - "/third_party/libwebrtc/api/frame_transformer_factory.cc" -] - -if not CONFIG["MOZ_DEBUG"]: - - DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0" - DEFINES["NDEBUG"] = True - DEFINES["NVALGRIND"] = True - -if CONFIG["MOZ_DEBUG"] == "1": - - DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "1" - -if CONFIG["OS_TARGET"] == "Android": - - DEFINES["ANDROID"] = True - DEFINES["ANDROID_NDK_VERSION_ROLL"] = "r27_1" - DEFINES["HAVE_SYS_UIO_H"] = True - DEFINES["WEBRTC_ANDROID"] = True - DEFINES["WEBRTC_ANDROID_OPENSLES"] = True - DEFINES["WEBRTC_LINUX"] = True - DEFINES["WEBRTC_POSIX"] = True - DEFINES["_GNU_SOURCE"] = True - DEFINES["__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"] = True - DEFINES["__STDC_CONSTANT_MACROS"] = True - DEFINES["__STDC_FORMAT_MACROS"] = True - - OS_LIBS += [ - "GLESv2", - "log" - ] - -if CONFIG["OS_TARGET"] == "Darwin": - - DEFINES["WEBRTC_MAC"] = True - DEFINES["WEBRTC_POSIX"] = True - DEFINES["__STDC_CONSTANT_MACROS"] = True - DEFINES["__STDC_FORMAT_MACROS"] = True - -if CONFIG["OS_TARGET"] == "Linux": - - DEFINES["USE_AURA"] = "1" - DEFINES["USE_GLIB"] = "1" - DEFINES["USE_OZONE"] = "1" - DEFINES["USE_UDEV"] = True - DEFINES["WEBRTC_LINUX"] = True - DEFINES["WEBRTC_POSIX"] = True - DEFINES["_FILE_OFFSET_BITS"] = "64" - DEFINES["_GLIBCXX_ASSERTIONS"] = "1" - DEFINES["_LARGEFILE64_SOURCE"] = True - DEFINES["_LARGEFILE_SOURCE"] = True - DEFINES["__STDC_CONSTANT_MACROS"] = True - DEFINES["__STDC_FORMAT_MACROS"] = True - -if CONFIG["OS_TARGET"] == "OpenBSD": - - DEFINES["USE_GLIB"] = "1" - DEFINES["USE_OZONE"] = "1" - DEFINES["WEBRTC_BSD"] = True - DEFINES["WEBRTC_POSIX"] = True - DEFINES["_FILE_OFFSET_BITS"] = "64" - DEFINES["_LARGEFILE64_SOURCE"] = True - DEFINES["_LARGEFILE_SOURCE"] = True - DEFINES["__STDC_CONSTANT_MACROS"] = True - DEFINES["__STDC_FORMAT_MACROS"] = True - -if CONFIG["OS_TARGET"] == "WINNT": - - DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True - DEFINES["NOMINMAX"] = True - DEFINES["NTDDI_VERSION"] = "0x0A000000" - DEFINES["PSAPI_VERSION"] = "2" - DEFINES["RTC_ENABLE_WIN_WGC"] = True - DEFINES["UNICODE"] = True - DEFINES["USE_AURA"] = "1" - DEFINES["WEBRTC_WIN"] = True - DEFINES["WIN32"] = True - DEFINES["WIN32_LEAN_AND_MEAN"] = True - DEFINES["WINAPI_FAMILY"] = "WINAPI_FAMILY_DESKTOP_APP" - DEFINES["WINVER"] = "0x0A00" - DEFINES["_ATL_NO_OPENGL"] = True - DEFINES["_CRT_NONSTDC_NO_WARNINGS"] = True - DEFINES["_CRT_RAND_S"] = True - DEFINES["_CRT_SECURE_NO_DEPRECATE"] = True - DEFINES["_ENABLE_EXTENDED_ALIGNED_STORAGE"] = True - DEFINES["_HAS_EXCEPTIONS"] = "0" - DEFINES["_HAS_NODISCARD"] = True - DEFINES["_SCL_SECURE_NO_DEPRECATE"] = True - DEFINES["_SECURE_ATL"] = True - DEFINES["_UNICODE"] = True - DEFINES["_WIN32_WINNT"] = "0x0A00" - DEFINES["_WINDOWS"] = True - DEFINES["_WINSOCK_DEPRECATED_NO_WARNINGS"] = True - DEFINES["__STD_C"] = True - - OS_LIBS += [ - "crypt32", - "iphlpapi", - "secur32", - "winmm" - ] - -if CONFIG["TARGET_CPU"] == "aarch64": - - DEFINES["WEBRTC_ARCH_ARM64"] = True - DEFINES["WEBRTC_HAS_NEON"] = True - DEFINES["__ARM_NEON__"] = "1" - -if CONFIG["TARGET_CPU"] == "arm": - - CXXFLAGS += [ - "-mfpu=neon" - ] - - DEFINES["WEBRTC_ARCH_ARM"] = True - DEFINES["WEBRTC_ARCH_ARM_V7"] = True - DEFINES["WEBRTC_HAS_NEON"] = True - -if CONFIG["TARGET_CPU"] == "loongarch64": - - DEFINES["_GNU_SOURCE"] = True - -if CONFIG["TARGET_CPU"] == "mips32": - - DEFINES["MIPS32_LE"] = True - DEFINES["MIPS_FPU_LE"] = True - DEFINES["_GNU_SOURCE"] = True - -if CONFIG["TARGET_CPU"] == "mips64": - - DEFINES["_GNU_SOURCE"] = True - -if CONFIG["TARGET_CPU"] == "x86": - - DEFINES["WEBRTC_ENABLE_AVX2"] = True - -if CONFIG["TARGET_CPU"] == "x86_64": - - DEFINES["WEBRTC_ENABLE_AVX2"] = True - -if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Android": - - DEFINES["_DEBUG"] = True - -if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Darwin": - - DEFINES["_DEBUG"] = True - -if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": - - DEFINES["_DEBUG"] = True - -if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "OpenBSD": - - DEFINES["_DEBUG"] = True - -if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "WINNT": - - DEFINES["_HAS_ITERATOR_DEBUGGING"] = "0" - -if CONFIG["OS_TARGET"] == "Android" and CONFIG["TARGET_CPU"] == "x86": - - CXXFLAGS += [ - "-msse2" - ] - -if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "aarch64": - - DEFINES["_GNU_SOURCE"] = True - -if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "arm": - - DEFINES["_GNU_SOURCE"] = True - -if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86": - - CXXFLAGS += [ - "-msse2" - ] - - DEFINES["_GNU_SOURCE"] = True - -if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"] == "x86_64": - - DEFINES["_GNU_SOURCE"] = True - -Library("frame_transformer_factory_gn") diff --git a/third_party/libwebrtc/moz.build b/third_party/libwebrtc/moz.build @@ -49,7 +49,6 @@ DIRS += [ "/third_party/libwebrtc/api/field_trials_gn", "/third_party/libwebrtc/api/field_trials_registry_gn", "/third_party/libwebrtc/api/field_trials_view_gn", - "/third_party/libwebrtc/api/frame_transformer_factory_gn", "/third_party/libwebrtc/api/frame_transformer_interface_gn", "/third_party/libwebrtc/api/function_view_gn", "/third_party/libwebrtc/api/libjingle_logging_api_gn",