Bug 1144912 - WebRTC Screenshare has own default FPS r=jib
authorEthan Hugg <ethanhugg@gmail.com>
Mon, 23 Mar 2015 19:17:07 -0700
changeset 265747 ae7215f501a5c7e6487947b4de6eb0a04b1df01a
parent 265746 daf836da3530392bf4827a706519b16d14c15dcf
child 265748 08f5b203cf2c7b9f05f827140616914b734b9980
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1144912
milestone39.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 1144912 - WebRTC Screenshare has own default FPS r=jib
media/webrtc/trunk/webrtc/video_engine/vie_capturer.cc
media/webrtc/trunk/webrtc/video_engine/vie_defines.h
--- a/media/webrtc/trunk/webrtc/video_engine/vie_capturer.cc
+++ b/media/webrtc/trunk/webrtc/video_engine/vie_capturer.cc
@@ -202,28 +202,33 @@ int ViECapturer::FrameCallbackChanged() 
 }
 
 int32_t ViECapturer::Start(const CaptureCapability& capture_capability) {
   int width;
   int height;
   int frame_rate;
   VideoCaptureCapability capability;
   requested_capability_ = capture_capability;
+  CaptureDeviceType type = config_.Get<CaptureDeviceInfo>().type;
 
   if (!CaptureCapabilityFixed()) {
     // Ask the observers for best size.
     GetBestFormat(&width, &height, &frame_rate);
     if (width == 0) {
       width = kViECaptureDefaultWidth;
     }
     if (height == 0) {
       height = kViECaptureDefaultHeight;
     }
     if (frame_rate == 0) {
-      frame_rate = kViECaptureDefaultFramerate;
+      if (type == Screen || type == Window || type == Application) {
+        frame_rate = kViEScreenCaptureDefaultFramerate;
+      } else {
+        frame_rate = kViECaptureDefaultFramerate;
+      }
     }
     capability.height = height;
     capability.width = width;
     capability.maxFPS = frame_rate;
     capability.rawType = kVideoI420;
     capability.codecType = kVideoCodecUnknown;
   } else {
     // Width, height and type specified with call to Start, not set by
--- a/media/webrtc/trunk/webrtc/video_engine/vie_defines.h
+++ b/media/webrtc/trunk/webrtc/video_engine/vie_defines.h
@@ -36,16 +36,17 @@ enum { kViEMinKeyRequestIntervalMs = 300
 // ViEBase
 enum { kViEMaxNumberOfChannels = 64 };
 
 // ViECapture
 enum { kViEMaxCaptureDevices = 256 };
 enum { kViECaptureDefaultWidth = 352 };
 enum { kViECaptureDefaultHeight = 288 };
 enum { kViECaptureDefaultFramerate = 30 };
+enum { kViEScreenCaptureDefaultFramerate = 3 };
 enum { kViECaptureMaxSnapshotWaitTimeMs = 500 };
 
 // ViECodec
 enum { kViEMaxCodecWidth = 4096 };
 enum { kViEMaxCodecHeight = 3072 };
 enum { kViEMaxCodecFramerate = 60 };
 enum { kViEMinCodecBitrate = 30 };