OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 * | 9 * |
10 */ | 10 */ |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "webrtc/base/logging.h" | 21 #include "webrtc/base/logging.h" |
22 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 22 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
23 | 23 |
24 namespace webrtc { | 24 namespace webrtc { |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 const bool kOpenH264EncoderDetailedLogging = false; | 28 const bool kOpenH264EncoderDetailedLogging = false; |
29 | 29 |
30 int NumberOfThreads(int width, int height, int number_of_cores) { | 30 int NumberOfThreads(int width, int height, int number_of_cores) { |
31 if (width * height >= 1920 * 1080 && number_of_cores > 8) { | 31 // TODO(hbos): In Chromium, multiple threads do not work with sandbox on Mac, |
32 return 8; // 8 threads for 1080p on high perf machines. | 32 // see crbug.com/583348. Until further investigated, only use one thread. |
33 } else if (width * height > 1280 * 960 && number_of_cores >= 6) { | 33 // if (width * height >= 1920 * 1080 && number_of_cores > 8) { |
34 return 3; // 3 threads for 1080p. | 34 // return 8; // 8 threads for 1080p on high perf machines. |
35 } else if (width * height > 640 * 480 && number_of_cores >= 3) { | 35 // } else if (width * height > 1280 * 960 && number_of_cores >= 6) { |
36 return 2; // 2 threads for qHD/HD. | 36 // return 3; // 3 threads for 1080p. |
37 } else { | 37 // } else if (width * height > 640 * 480 && number_of_cores >= 3) { |
38 return 1; // 1 thread for VGA or less. | 38 // return 2; // 2 threads for qHD/HD. |
39 } | 39 // } else { |
| 40 // return 1; // 1 thread for VGA or less. |
| 41 // } |
| 42 return 1; |
40 } | 43 } |
41 | 44 |
42 } // namespace | 45 } // namespace |
43 | 46 |
44 static FrameType EVideoFrameType_to_FrameType(EVideoFrameType type) { | 47 static FrameType EVideoFrameType_to_FrameType(EVideoFrameType type) { |
45 switch (type) { | 48 switch (type) { |
46 case videoFrameTypeInvalid: | 49 case videoFrameTypeInvalid: |
47 return kEmptyFrame; | 50 return kEmptyFrame; |
48 case videoFrameTypeIDR: | 51 case videoFrameTypeIDR: |
49 return kVideoFrameKey; | 52 return kVideoFrameKey; |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 } | 395 } |
393 | 396 |
394 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { | 397 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { |
395 return WEBRTC_VIDEO_CODEC_OK; | 398 return WEBRTC_VIDEO_CODEC_OK; |
396 } | 399 } |
397 | 400 |
398 void H264EncoderImpl::OnDroppedFrame() { | 401 void H264EncoderImpl::OnDroppedFrame() { |
399 } | 402 } |
400 | 403 |
401 } // namespace webrtc | 404 } // namespace webrtc |
OLD | NEW |