Bug 905701 - Apply MediaStreamConstraint on FirefoxOS. r=jesup
authorShih-Chiang Chien <schien@mozilla.com>
Tue, 17 Sep 2013 11:09:52 -0400
changeset 161216 bb0967aed17120e5b2fe75705a32c1f4319e74a5
parent 161215 e669f4a0235a09dfdba1be0cbdfbeddf3313cf80
child 161217 d3d07b3134ca3aa6d800008235357171b9521851
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs905701
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 905701 - Apply MediaStreamConstraint on FirefoxOS. r=jesup
dom/media/MediaManager.cpp
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -316,16 +316,26 @@ NS_IMPL_ISUPPORTS1(MediaDevice, nsIMedia
 
 MediaDevice::MediaDevice(MediaEngineVideoSource* aSource)
   : mHasFacingMode(false)
   , mSource(aSource) {
   mType.Assign(NS_LITERAL_STRING("video"));
   mSource->GetName(mName);
   mSource->GetUUID(mID);
 
+#ifdef MOZ_B2G_CAMERA
+  if (mName.EqualsLiteral("back")) {
+    mHasFacingMode = true;
+    mFacingMode = dom::VideoFacingModeEnum::Environment;
+  } else if (mName.EqualsLiteral("front")) {
+    mHasFacingMode = true;
+    mFacingMode = dom::VideoFacingModeEnum::User;
+  }
+#endif // MOZ_B2G_CAMERA
+
   // Kludge to test user-facing cameras on OSX.
   if (mName.Find(NS_LITERAL_STRING("Face")) != -1) {
     mHasFacingMode = true;
     mFacingMode = dom::VideoFacingModeEnum::User;
   }
 }
 
 MediaDevice::MediaDevice(MediaEngineAudioSource* aSource)