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

Side by Side Diff: webrtc/modules/video_coding/generic_encoder.cc

Issue 2574123002: Revert of Delete VideoFrame default constructor, and IsZeroSize method. (Closed)
Patch Set: Created 4 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 117
118 int32_t VCMGenericEncoder::SetPeriodicKeyFrames(bool enable) { 118 int32_t VCMGenericEncoder::SetPeriodicKeyFrames(bool enable) {
119 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); 119 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_);
120 return encoder_->SetPeriodicKeyFrames(enable); 120 return encoder_->SetPeriodicKeyFrames(enable);
121 } 121 }
122 122
123 int32_t VCMGenericEncoder::RequestFrame( 123 int32_t VCMGenericEncoder::RequestFrame(
124 const std::vector<FrameType>& frame_types) { 124 const std::vector<FrameType>& frame_types) {
125 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); 125 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_);
126 126 VideoFrame image;
127 // TODO(nisse): Used only with internal source. Delete as soon as 127 return encoder_->Encode(image, NULL, &frame_types);
128 // that feature is removed. The only implementation I've been able
129 // to find ignores what's in the frame.
130 return encoder_->Encode(VideoFrame(I420Buffer::Create(1, 1),
131 kVideoRotation_0, 0),
132 NULL, &frame_types);
133 return 0;
134 } 128 }
135 129
136 bool VCMGenericEncoder::InternalSource() const { 130 bool VCMGenericEncoder::InternalSource() const {
137 return internal_source_; 131 return internal_source_;
138 } 132 }
139 133
140 bool VCMGenericEncoder::SupportsNativeHandle() const { 134 bool VCMGenericEncoder::SupportsNativeHandle() const {
141 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); 135 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_);
142 return encoder_->SupportsNativeHandle(); 136 return encoder_->SupportsNativeHandle();
143 } 137 }
(...skipping 22 matching lines...) Expand all
166 media_opt_->UpdateWithEncodedData(encoded_image); 160 media_opt_->UpdateWithEncodedData(encoded_image);
167 if (internal_source_) { 161 if (internal_source_) {
168 // Signal to encoder to drop next frame. 162 // Signal to encoder to drop next frame.
169 result.drop_next_frame = media_opt_->DropFrame(); 163 result.drop_next_frame = media_opt_->DropFrame();
170 } 164 }
171 } 165 }
172 return result; 166 return result;
173 } 167 }
174 168
175 } // namespace webrtc 169 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc ('k') | webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_encoder.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698