OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 class VideoEncoder { | 68 class VideoEncoder { |
69 public: | 69 public: |
70 struct QpThresholds { | 70 struct QpThresholds { |
71 QpThresholds(int l, int h) : low(l), high(h) {} | 71 QpThresholds(int l, int h) : low(l), high(h) {} |
72 QpThresholds() : low(-1), high(-1) {} | 72 QpThresholds() : low(-1), high(-1) {} |
73 int low; | 73 int low; |
74 int high; | 74 int high; |
75 }; | 75 }; |
76 struct ScalingSettings { | 76 struct ScalingSettings { |
77 ScalingSettings(bool on, int low, int high); | 77 ScalingSettings(bool on, int low, int high); |
| 78 ScalingSettings(bool on, int low, int high, int min_pixels); |
| 79 ScalingSettings(bool on, int min_pixels); |
78 explicit ScalingSettings(bool on); | 80 explicit ScalingSettings(bool on); |
79 ScalingSettings(const ScalingSettings&); | 81 ScalingSettings(const ScalingSettings&); |
80 ~ScalingSettings(); | 82 ~ScalingSettings(); |
81 | 83 |
82 const bool enabled; | 84 const bool enabled; |
83 const rtc::Optional<QpThresholds> thresholds; | 85 const rtc::Optional<QpThresholds> thresholds; |
| 86 |
| 87 // We will never ask for a resolution lower than this. |
| 88 // TODO(kthelgason): Lower this limit when better testing |
| 89 // on MediaCodec and fallback implementations are in place. |
| 90 // See https://bugs.chromium.org/p/webrtc/issues/detail?id=7206 |
| 91 const int min_pixels_per_frame = 320 * 180; |
84 }; | 92 }; |
85 | 93 |
86 static VideoCodecVP8 GetDefaultVp8Settings(); | 94 static VideoCodecVP8 GetDefaultVp8Settings(); |
87 static VideoCodecVP9 GetDefaultVp9Settings(); | 95 static VideoCodecVP9 GetDefaultVp9Settings(); |
88 static VideoCodecH264 GetDefaultH264Settings(); | 96 static VideoCodecH264 GetDefaultH264Settings(); |
89 | 97 |
90 virtual ~VideoEncoder() {} | 98 virtual ~VideoEncoder() {} |
91 | 99 |
92 // Initialize the encoder with the information from the codecSettings | 100 // Initialize the encoder with the information from the codecSettings |
93 // | 101 // |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // Any encoder implementation wishing to use the WebRTC provided | 174 // Any encoder implementation wishing to use the WebRTC provided |
167 // quality scaler must implement this method. | 175 // quality scaler must implement this method. |
168 virtual ScalingSettings GetScalingSettings() const; | 176 virtual ScalingSettings GetScalingSettings() const; |
169 | 177 |
170 virtual int32_t SetPeriodicKeyFrames(bool enable); | 178 virtual int32_t SetPeriodicKeyFrames(bool enable); |
171 virtual bool SupportsNativeHandle() const; | 179 virtual bool SupportsNativeHandle() const; |
172 virtual const char* ImplementationName() const; | 180 virtual const char* ImplementationName() const; |
173 }; | 181 }; |
174 } // namespace webrtc | 182 } // namespace webrtc |
175 #endif // WEBRTC_API_VIDEO_CODECS_VIDEO_ENCODER_H_ | 183 #endif // WEBRTC_API_VIDEO_CODECS_VIDEO_ENCODER_H_ |
OLD | NEW |