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

Side by Side Diff: content/renderer/media/rtc_video_decoder_unittest.cc

Issue 1490333005: Don't require VDAs to return all PictureBuffers at once. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cl feedback. Created 5 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
« no previous file with comments | « content/renderer/media/rtc_video_decoder.cc ('k') | gpu/config/gpu_info.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/location.h" 6 #include "base/location.h"
7 #include "base/single_thread_task_runner.h" 7 #include "base/single_thread_task_runner.h"
8 #include "base/synchronization/waitable_event.h" 8 #include "base/synchronization/waitable_event.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 25 matching lines...) Expand all
36 36
37 void SetUp() override { 37 void SetUp() override {
38 ASSERT_TRUE(vda_thread_.Start()); 38 ASSERT_TRUE(vda_thread_.Start());
39 vda_task_runner_ = vda_thread_.task_runner(); 39 vda_task_runner_ = vda_thread_.task_runner();
40 mock_vda_ = new media::MockVideoDecodeAccelerator; 40 mock_vda_ = new media::MockVideoDecodeAccelerator;
41 41
42 media::VideoDecodeAccelerator::SupportedProfile supported_profile; 42 media::VideoDecodeAccelerator::SupportedProfile supported_profile;
43 supported_profile.min_resolution.SetSize(16, 16); 43 supported_profile.min_resolution.SetSize(16, 16);
44 supported_profile.max_resolution.SetSize(1920, 1088); 44 supported_profile.max_resolution.SetSize(1920, 1088);
45 supported_profile.profile = media::H264PROFILE_MAIN; 45 supported_profile.profile = media::H264PROFILE_MAIN;
46 supported_profiles_.push_back(supported_profile); 46 capabilities_.supported_profiles.push_back(supported_profile);
47 supported_profile.profile = media::VP8PROFILE_ANY; 47 supported_profile.profile = media::VP8PROFILE_ANY;
48 supported_profiles_.push_back(supported_profile); 48 capabilities_.supported_profiles.push_back(supported_profile);
49 49
50 EXPECT_CALL(*mock_gpu_factories_.get(), GetTaskRunner()) 50 EXPECT_CALL(*mock_gpu_factories_.get(), GetTaskRunner())
51 .WillRepeatedly(Return(vda_task_runner_)); 51 .WillRepeatedly(Return(vda_task_runner_));
52 EXPECT_CALL(*mock_gpu_factories_.get(), 52 EXPECT_CALL(*mock_gpu_factories_.get(),
53 GetVideoDecodeAcceleratorSupportedProfiles()) 53 GetVideoDecodeAcceleratorCapabilities())
54 .WillRepeatedly(Return(supported_profiles_)); 54 .WillRepeatedly(Return(capabilities_));
55 EXPECT_CALL(*mock_gpu_factories_.get(), DoCreateVideoDecodeAccelerator()) 55 EXPECT_CALL(*mock_gpu_factories_.get(), DoCreateVideoDecodeAccelerator())
56 .WillRepeatedly(Return(mock_vda_)); 56 .WillRepeatedly(Return(mock_vda_));
57 EXPECT_CALL(*mock_vda_, Initialize(_, _)) 57 EXPECT_CALL(*mock_vda_, Initialize(_, _))
58 .Times(1) 58 .Times(1)
59 .WillRepeatedly(Return(true)); 59 .WillRepeatedly(Return(true));
60 EXPECT_CALL(*mock_vda_, Destroy()).Times(1); 60 EXPECT_CALL(*mock_vda_, Destroy()).Times(1);
61 } 61 }
62 62
63 void TearDown() override { 63 void TearDown() override {
64 DVLOG(2) << "TearDown"; 64 DVLOG(2) << "TearDown";
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 base::Unretained(&idle_waiter_))); 105 base::Unretained(&idle_waiter_)));
106 idle_waiter_.Wait(); 106 idle_waiter_.Wait();
107 } 107 }
108 108
109 protected: 109 protected:
110 scoped_ptr<media::MockGpuVideoAcceleratorFactories> mock_gpu_factories_; 110 scoped_ptr<media::MockGpuVideoAcceleratorFactories> mock_gpu_factories_;
111 media::MockVideoDecodeAccelerator* mock_vda_; 111 media::MockVideoDecodeAccelerator* mock_vda_;
112 scoped_ptr<RTCVideoDecoder> rtc_decoder_; 112 scoped_ptr<RTCVideoDecoder> rtc_decoder_;
113 webrtc::VideoCodec codec_; 113 webrtc::VideoCodec codec_;
114 base::Thread vda_thread_; 114 base::Thread vda_thread_;
115 media::VideoDecodeAccelerator::SupportedProfiles supported_profiles_; 115 media::VideoDecodeAccelerator::Capabilities capabilities_;
116 116
117 private: 117 private:
118 scoped_refptr<base::SingleThreadTaskRunner> vda_task_runner_; 118 scoped_refptr<base::SingleThreadTaskRunner> vda_task_runner_;
119 119
120 base::Lock lock_; 120 base::Lock lock_;
121 base::WaitableEvent idle_waiter_; 121 base::WaitableEvent idle_waiter_;
122 }; 122 };
123 123
124 TEST_F(RTCVideoDecoderTest, CreateReturnsNullOnUnsupportedCodec) { 124 TEST_F(RTCVideoDecoderTest, CreateReturnsNullOnUnsupportedCodec) {
125 CreateDecoder(webrtc::kVideoCodecVP8); 125 CreateDecoder(webrtc::kVideoCodecVP8);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 EXPECT_FALSE(rtc_decoder_->IsFirstBufferAfterReset(RTCVideoDecoder::ID_LAST, 237 EXPECT_FALSE(rtc_decoder_->IsFirstBufferAfterReset(RTCVideoDecoder::ID_LAST,
238 RTCVideoDecoder::ID_LAST)); 238 RTCVideoDecoder::ID_LAST));
239 EXPECT_TRUE( 239 EXPECT_TRUE(
240 rtc_decoder_->IsFirstBufferAfterReset(0, RTCVideoDecoder::ID_LAST)); 240 rtc_decoder_->IsFirstBufferAfterReset(0, RTCVideoDecoder::ID_LAST));
241 EXPECT_FALSE( 241 EXPECT_FALSE(
242 rtc_decoder_->IsFirstBufferAfterReset(1, RTCVideoDecoder::ID_LAST)); 242 rtc_decoder_->IsFirstBufferAfterReset(1, RTCVideoDecoder::ID_LAST));
243 } 243 }
244 244
245 } // content 245 } // content
OLDNEW
« no previous file with comments | « content/renderer/media/rtc_video_decoder.cc ('k') | gpu/config/gpu_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698