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

Side by Side Diff: media/cast/sender/video_encoder_impl_unittest.cc

Issue 339743002: Cast: Make vp8 3-buffer mode work (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor test fix Created 6 years, 3 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 | « media/cast/receiver/frame_receiver.cc ('k') | media/cast/sender/vp8_encoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <vector> 5 #include <vector>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "media/base/video_frame.h" 10 #include "media/base/video_frame.h"
(...skipping 18 matching lines...) Expand all
29 void SetExpectedResult(uint32 expected_frame_id, 29 void SetExpectedResult(uint32 expected_frame_id,
30 uint32 expected_last_referenced_frame_id, 30 uint32 expected_last_referenced_frame_id,
31 const base::TimeTicks& expected_capture_time) { 31 const base::TimeTicks& expected_capture_time) {
32 expected_frame_id_ = expected_frame_id; 32 expected_frame_id_ = expected_frame_id;
33 expected_last_referenced_frame_id_ = expected_last_referenced_frame_id; 33 expected_last_referenced_frame_id_ = expected_last_referenced_frame_id;
34 expected_capture_time_ = expected_capture_time; 34 expected_capture_time_ = expected_capture_time;
35 } 35 }
36 36
37 void DeliverEncodedVideoFrame( 37 void DeliverEncodedVideoFrame(
38 scoped_ptr<EncodedFrame> encoded_frame) { 38 scoped_ptr<EncodedFrame> encoded_frame) {
39 if (expected_frame_id_ == expected_last_referenced_frame_id_) { 39 if (expected_frame_id_ != expected_last_referenced_frame_id_) {
40 EXPECT_EQ(EncodedFrame::KEY, encoded_frame->dependency);
41 } else {
42 EXPECT_EQ(EncodedFrame::DEPENDENT, 40 EXPECT_EQ(EncodedFrame::DEPENDENT,
43 encoded_frame->dependency); 41 encoded_frame->dependency);
44 } 42 }
45 EXPECT_EQ(expected_frame_id_, encoded_frame->frame_id); 43 EXPECT_EQ(expected_frame_id_, encoded_frame->frame_id);
46 EXPECT_EQ(expected_last_referenced_frame_id_, 44 EXPECT_EQ(expected_last_referenced_frame_id_,
47 encoded_frame->referenced_frame_id); 45 encoded_frame->referenced_frame_id)
46 << "frame id: " << expected_frame_id_;
48 EXPECT_EQ(expected_capture_time_, encoded_frame->reference_time); 47 EXPECT_EQ(expected_capture_time_, encoded_frame->reference_time);
49 } 48 }
50 49
51 protected: 50 protected:
52 virtual ~TestVideoEncoderCallback() {} 51 virtual ~TestVideoEncoderCallback() {}
53 52
54 private: 53 private:
55 friend class base::RefCountedThreadSafe<TestVideoEncoderCallback>; 54 friend class base::RefCountedThreadSafe<TestVideoEncoderCallback>;
56 55
57 uint32 expected_frame_id_; 56 uint32 expected_frame_id_;
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 for (int i = 5; i < 17; ++i) { 250 for (int i = 5; i < 17; ++i) {
252 test_video_encoder_callback_->SetExpectedResult(i, 4, capture_time); 251 test_video_encoder_callback_->SetExpectedResult(i, 4, capture_time);
253 EXPECT_TRUE(video_encoder_->EncodeVideoFrame( 252 EXPECT_TRUE(video_encoder_->EncodeVideoFrame(
254 video_frame_, capture_time, frame_encoded_callback)); 253 video_frame_, capture_time, frame_encoded_callback));
255 task_runner_->RunTasks(); 254 task_runner_->RunTasks();
256 } 255 }
257 } 256 }
258 257
259 } // namespace cast 258 } // namespace cast
260 } // namespace media 259 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/receiver/frame_receiver.cc ('k') | media/cast/sender/vp8_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698