diff --git a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp index 38e935941d98..d79834e15b28 100644 --- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp +++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp @@ -12,6 +12,7 @@ #include "YuvStamper.h" #include "mozilla/TemplateLib.h" #include "mozilla/media/MediaUtils.h" +#include "mozilla/StaticPrefs_media.h" #include "nsComponentManagerUtils.h" #include "nsIPrefBranch.h" #include "nsIGfxInfo.h" @@ -1682,6 +1683,13 @@ std::unique_ptr WebrtcVideoConduit::CreateEncoder( bool enabled = false; #endif + if (StaticPrefs::media_webrtc_platformencoder()) { + encoder.reset(MediaDataDecoderCodec::CreateEncoder(aType)); + if (encoder) { + return encoder; + } + } + switch (aType) { case webrtc::VideoCodecType::kVideoCodecH264: // get an external encoder diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 15d935eae4ba..7baa1162ae58 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -5727,6 +5727,11 @@ value: false mirror: always +- name: media.webrtc.platformencoder + type: bool + value: false + mirror: always + #--------------------------------------------------------------------------- # Prefs starting with "mousewheel." #---------------------------------------------------------------------------