mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 1581902 - p5: check H.264 hardware availability. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D46367 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
572a122361
commit
854d85bd05
@ -2305,4 +2305,17 @@ bool WebrtcVideoConduit::RequiresNewSendStream(
|
||||
;
|
||||
}
|
||||
|
||||
bool WebrtcVideoConduit::HasH264Hardware() {
|
||||
nsCOMPtr<nsIGfxInfo> gfxInfo = do_GetService("@mozilla.org/gfx/info;1");
|
||||
if (!gfxInfo) {
|
||||
return false;
|
||||
}
|
||||
int32_t status;
|
||||
nsCString discardFailureId;
|
||||
return NS_SUCCEEDED(gfxInfo->GetFeatureStatus(
|
||||
nsIGfxInfo::FEATURE_WEBRTC_HW_ACCELERATION_H264, discardFailureId,
|
||||
&status)) &&
|
||||
status == nsIGfxInfo::FEATURE_STATUS_OK;
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -76,6 +76,9 @@ class WebrtcVideoConduit
|
||||
// VoiceEngine defined constant for Payload Name Size.
|
||||
static const unsigned int CODEC_PLNAME_SIZE;
|
||||
|
||||
// Returns true when both encoder and decoder are HW accelerated.
|
||||
static bool HasH264Hardware();
|
||||
|
||||
MediaConduitErrorCode SetLocalRTPExtensions(
|
||||
MediaSessionConduitLocalDirection aDirection,
|
||||
const RtpExtList& aExtensions) override;
|
||||
|
@ -637,6 +637,8 @@ class ConfigureCodec {
|
||||
mDtmfEnabled(false) {
|
||||
mSoftwareH264Enabled = PeerConnectionCtx::GetInstance()->gmpHasH264();
|
||||
|
||||
mHardwareH264Supported = WebrtcVideoConduit::HasH264Hardware();
|
||||
|
||||
mH264Enabled = mHardwareH264Supported || mSoftwareH264Enabled;
|
||||
|
||||
branch->GetIntPref("media.navigator.video.h264.level", &mH264Level);
|
||||
|
Loading…
Reference in New Issue
Block a user