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

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: . Created 4 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
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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 public EncodedImageCallback { 235 public EncodedImageCallback {
236 public: 236 public:
237 TestSimulcastEncoderAdapterFake() 237 TestSimulcastEncoderAdapterFake()
238 : helper_(new TestSimulcastEncoderAdapterFakeHelper()), 238 : helper_(new TestSimulcastEncoderAdapterFakeHelper()),
239 adapter_(helper_->CreateMockEncoderAdapter()), 239 adapter_(helper_->CreateMockEncoderAdapter()),
240 last_encoded_image_width_(-1), 240 last_encoded_image_width_(-1),
241 last_encoded_image_height_(-1), 241 last_encoded_image_height_(-1),
242 last_encoded_image_simulcast_index_(-1) {} 242 last_encoded_image_simulcast_index_(-1) {}
243 virtual ~TestSimulcastEncoderAdapterFake() {} 243 virtual ~TestSimulcastEncoderAdapterFake() {}
244 244
245 int32_t Encoded(const EncodedImage& encodedImage, 245 Result OnEncodedImage(const EncodedImage& encoded_image,
246 const CodecSpecificInfo* codecSpecificInfo = NULL, 246 const CodecSpecificInfo* codec_specific_info,
247 const RTPFragmentationHeader* fragmentation = NULL) override { 247 const RTPFragmentationHeader* fragmentation) override {
248 last_encoded_image_width_ = encodedImage._encodedWidth; 248 last_encoded_image_width_ = encoded_image._encodedWidth;
249 last_encoded_image_height_ = encodedImage._encodedHeight; 249 last_encoded_image_height_ = encoded_image._encodedHeight;
250 if (codecSpecificInfo) { 250 if (codec_specific_info) {
251 last_encoded_image_simulcast_index_ = 251 last_encoded_image_simulcast_index_ =
252 codecSpecificInfo->codecSpecific.VP8.simulcastIdx; 252 codec_specific_info->codecSpecific.VP8.simulcastIdx;
253 } 253 }
254 return 0; 254 return Result(Result::OK, encoded_image._timeStamp);
255 } 255 }
256 256
257 bool GetLastEncodedImageInfo(int* out_width, 257 bool GetLastEncodedImageInfo(int* out_width,
258 int* out_height, 258 int* out_height,
259 int* out_simulcast_index) { 259 int* out_simulcast_index) {
260 if (last_encoded_image_width_ == -1) { 260 if (last_encoded_image_width_ == -1) {
261 return false; 261 return false;
262 } 262 }
263 *out_width = last_encoded_image_width_; 263 *out_width = last_encoded_image_width_;
264 *out_height = last_encoded_image_height_; 264 *out_height = last_encoded_image_height_;
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 memset(input_frame.video_frame_buffer()->MutableDataV(), 0, 522 memset(input_frame.video_frame_buffer()->MutableDataV(), 0,
523 input_frame.allocated_size(kVPlane)); 523 input_frame.allocated_size(kVPlane));
524 524
525 std::vector<FrameType> frame_types(3, kVideoFrameKey); 525 std::vector<FrameType> frame_types(3, kVideoFrameKey);
526 EXPECT_EQ(WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE, 526 EXPECT_EQ(WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE,
527 adapter_->Encode(input_frame, nullptr, &frame_types)); 527 adapter_->Encode(input_frame, nullptr, &frame_types));
528 } 528 }
529 529
530 } // namespace testing 530 } // namespace testing
531 } // namespace webrtc 531 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698