summaryrefslogtreecommitdiff
path: root/dom/media
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media')
-rw-r--r--dom/media/AudioStream.cpp4
-rw-r--r--dom/media/CubebUtils.cpp27
-rw-r--r--dom/media/CubebUtils.h3
-rw-r--r--dom/media/GraphDriver.cpp4
-rw-r--r--dom/media/MediaManager.cpp8
-rw-r--r--dom/media/PeerConnection.js1
-rw-r--r--dom/media/webrtc/MediaEngine.h5
-rw-r--r--dom/media/webrtc/MediaEngineWebRTCAudio.cpp4
8 files changed, 1 insertions, 55 deletions
diff --git a/dom/media/AudioStream.cpp b/dom/media/AudioStream.cpp
index 82ae3ee866..54cf7b9653 100644
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -333,11 +333,7 @@ AudioStream::Init(uint32_t aNumChannels, uint32_t aRate,
params.rate = aRate;
params.channels = mOutChannels;
#if defined(__ANDROID__)
-#if defined(MOZ_B2G)
- params.stream_type = CubebUtils::ConvertChannelToCubebType(aAudioChannel);
-#else
params.stream_type = CUBEB_STREAM_TYPE_MUSIC;
-#endif
if (params.stream_type == CUBEB_STREAM_TYPE_MAX) {
return NS_ERROR_INVALID_ARG;
diff --git a/dom/media/CubebUtils.cpp b/dom/media/CubebUtils.cpp
index d1b4bae99d..fe94264eed 100644
--- a/dom/media/CubebUtils.cpp
+++ b/dom/media/CubebUtils.cpp
@@ -342,33 +342,6 @@ uint32_t MaxNumberOfChannels()
return 0;
}
-#if defined(__ANDROID__) && defined(MOZ_B2G)
-cubeb_stream_type ConvertChannelToCubebType(dom::AudioChannel aChannel)
-{
- switch(aChannel) {
- case dom::AudioChannel::Normal:
- /* FALLTHROUGH */
- case dom::AudioChannel::Content:
- return CUBEB_STREAM_TYPE_MUSIC;
- case dom::AudioChannel::Notification:
- return CUBEB_STREAM_TYPE_NOTIFICATION;
- case dom::AudioChannel::Alarm:
- return CUBEB_STREAM_TYPE_ALARM;
- case dom::AudioChannel::Telephony:
- return CUBEB_STREAM_TYPE_VOICE_CALL;
- case dom::AudioChannel::Ringer:
- return CUBEB_STREAM_TYPE_RING;
- case dom::AudioChannel::System:
- return CUBEB_STREAM_TYPE_SYSTEM;
- case dom::AudioChannel::Publicnotification:
- return CUBEB_STREAM_TYPE_SYSTEM_ENFORCED;
- default:
- NS_ERROR("The value of AudioChannel is invalid");
- return CUBEB_STREAM_TYPE_MAX;
- }
-}
-#endif
-
void GetCurrentBackend(nsAString& aBackend)
{
cubeb* cubebContext = GetCubebContext();
diff --git a/dom/media/CubebUtils.h b/dom/media/CubebUtils.h
index 171c244b78..fa5fc22948 100644
--- a/dom/media/CubebUtils.h
+++ b/dom/media/CubebUtils.h
@@ -40,9 +40,6 @@ void ReportCubebBackendUsed();
uint32_t GetCubebPlaybackLatencyInMilliseconds();
Maybe<uint32_t> GetCubebMSGLatencyInFrames();
bool CubebLatencyPrefSet();
-#if defined(__ANDROID__) && defined(MOZ_B2G)
-cubeb_stream_type ConvertChannelToCubebType(dom::AudioChannel aChannel);
-#endif
void GetCurrentBackend(nsAString& aBackend);
} // namespace CubebUtils
diff --git a/dom/media/GraphDriver.cpp b/dom/media/GraphDriver.cpp
index 40e3b72cfd..cae15eb8c2 100644
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -640,11 +640,7 @@ AudioCallbackDriver::Init()
mSampleRate = output.rate = CubebUtils::PreferredSampleRate();
#if defined(__ANDROID__)
-#if defined(MOZ_B2G)
- output.stream_type = CubebUtils::ConvertChannelToCubebType(mAudioChannel);
-#else
output.stream_type = CUBEB_STREAM_TYPE_MUSIC;
-#endif
if (output.stream_type == CUBEB_STREAM_TYPE_MAX) {
NS_WARNING("Bad stream type");
return;
diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp
index 97a6855d97..44f330e99a 100644
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -73,10 +73,6 @@
#include "browser_logging/WebRtcLog.h"
#endif
-#ifdef MOZ_B2G
-#include "MediaPermissionGonk.h"
-#endif
-
#if defined (XP_WIN)
#include "mozilla/WindowsVersion.h"
#include <winsock2.h>
@@ -1819,10 +1815,6 @@ MediaManager::Get() {
__LINE__,
NS_LITERAL_STRING("Media shutdown"));
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
-#ifdef MOZ_B2G
- // Init MediaPermissionManager before sending out any permission requests.
- (void) MediaPermissionManager::GetInstance();
-#endif //MOZ_B2G
}
return sSingleton;
}
diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js
index 98b8debbeb..0c3021799a 100644
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -791,7 +791,6 @@ RTCPeerConnection.prototype = {
return this._havePermission;
}
if (this._isChrome ||
- AppConstants.MOZ_B2G ||
Services.prefs.getBoolPref("media.navigator.permission.disabled")) {
return this._havePermission = Promise.resolve();
}
diff --git a/dom/media/webrtc/MediaEngine.h b/dom/media/webrtc/MediaEngine.h
index ff2a6e25a3..6a69885449 100644
--- a/dom/media/webrtc/MediaEngine.h
+++ b/dom/media/webrtc/MediaEngine.h
@@ -54,11 +54,8 @@ public:
static const int DEFAULT_169_VIDEO_WIDTH = 1280;
static const int DEFAULT_169_VIDEO_HEIGHT = 720;
-#ifndef MOZ_B2G
static const int DEFAULT_SAMPLE_RATE = 32000;
-#else
- static const int DEFAULT_SAMPLE_RATE = 16000;
-#endif
+
// This allows using whatever rate the graph is using for the
// MediaStreamTrack. This is useful for microphone data, we know it's already
// at the correct rate for insertion in the MSG.
diff --git a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
index 0b8796aa8b..1e2e13d01a 100644
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -741,9 +741,6 @@ MediaEngineWebRTCMicrophoneSource::AllocChannel()
// Check for availability.
if (!mAudioInput->SetRecordingDevice(mCapIndex)) {
-#ifndef MOZ_B2G
- // Because of the permission mechanism of B2G, we need to skip the status
- // check here.
bool avail = false;
mAudioInput->GetRecordingDeviceStatus(avail);
if (!avail) {
@@ -752,7 +749,6 @@ MediaEngineWebRTCMicrophoneSource::AllocChannel()
}
return false;
}
-#endif // MOZ_B2G
// Set "codec" to PCM, 32kHz on 1 channel
ScopedCustomReleasePtr<webrtc::VoECodec> ptrVoECodec(webrtc::VoECodec::GetInterface(mVoiceEngine));