Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Side by Side Diff: webrtc/api/video_codecs/video_encoder.h

Issue 3000693003: Move kMinPixelsPerFrame constant in VideoStreamEncoder to VideoEncoder::ScalingSettings. (Closed)
Patch Set: rebase Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/api/video_codecs/video_encoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/video_codecs/video_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698