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

Side by Side Diff: webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc

Issue 2089773002: Add EncodedImageCallback::OnEncodedImage(). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: sync Created 4 years, 5 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
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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 public EncodedImageCallback { 240 public EncodedImageCallback {
241 public: 241 public:
242 TestSimulcastEncoderAdapterFake() 242 TestSimulcastEncoderAdapterFake()
243 : helper_(new TestSimulcastEncoderAdapterFakeHelper()), 243 : helper_(new TestSimulcastEncoderAdapterFakeHelper()),
244 adapter_(helper_->CreateMockEncoderAdapter()), 244 adapter_(helper_->CreateMockEncoderAdapter()),
245 last_encoded_image_width_(-1), 245 last_encoded_image_width_(-1),
246 last_encoded_image_height_(-1), 246 last_encoded_image_height_(-1),
247 last_encoded_image_simulcast_index_(-1) {} 247 last_encoded_image_simulcast_index_(-1) {}
248 virtual ~TestSimulcastEncoderAdapterFake() {} 248 virtual ~TestSimulcastEncoderAdapterFake() {}
249 249
250 int32_t Encoded(const EncodedImage& encodedImage, 250 Result OnEncodedImage(const EncodedImage& encoded_image,
251 const CodecSpecificInfo* codecSpecificInfo = NULL, 251 const CodecSpecificInfo* codec_specific_info,
252 const RTPFragmentationHeader* fragmentation = NULL) override { 252 const RTPFragmentationHeader* fragmentation) override {
253 last_encoded_image_width_ = encodedImage._encodedWidth; 253 last_encoded_image_width_ = encoded_image._encodedWidth;
254 last_encoded_image_height_ = encodedImage._encodedHeight; 254 last_encoded_image_height_ = encoded_image._encodedHeight;
255 if (codecSpecificInfo) { 255 if (codec_specific_info) {
256 last_encoded_image_simulcast_index_ = 256 last_encoded_image_simulcast_index_ =
257 codecSpecificInfo->codecSpecific.VP8.simulcastIdx; 257 codec_specific_info->codecSpecific.VP8.simulcastIdx;
258 } 258 }
259 return 0; 259 return Result(Result::OK, encoded_image._timeStamp);
260 } 260 }
261 261
262 bool GetLastEncodedImageInfo(int* out_width, 262 bool GetLastEncodedImageInfo(int* out_width,
263 int* out_height, 263 int* out_height,
264 int* out_simulcast_index) { 264 int* out_simulcast_index) {
265 if (last_encoded_image_width_ == -1) { 265 if (last_encoded_image_width_ == -1) {
266 return false; 266 return false;
267 } 267 }
268 *out_width = last_encoded_image_width_; 268 *out_width = last_encoded_image_width_;
269 *out_height = last_encoded_image_height_; 269 *out_height = last_encoded_image_height_;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 memset(input_frame.video_frame_buffer()->MutableDataV(), 0, 489 memset(input_frame.video_frame_buffer()->MutableDataV(), 0,
490 input_frame.allocated_size(kVPlane)); 490 input_frame.allocated_size(kVPlane));
491 491
492 std::vector<FrameType> frame_types(3, kVideoFrameKey); 492 std::vector<FrameType> frame_types(3, kVideoFrameKey);
493 EXPECT_EQ(WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE, 493 EXPECT_EQ(WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE,
494 adapter_->Encode(input_frame, nullptr, &frame_types)); 494 adapter_->Encode(input_frame, nullptr, &frame_types));
495 } 495 }
496 496
497 } // namespace testing 497 } // namespace testing
498 } // namespace webrtc 498 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698