| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 void RunUntilIdle() { | 73 void RunUntilIdle() { |
| 74 DVLOG(3) << __FUNCTION__; | 74 DVLOG(3) << __FUNCTION__; |
| 75 encoder_thread_.task_runner()->PostTask( | 75 encoder_thread_.task_runner()->PostTask( |
| 76 FROM_HERE, base::Bind(&base::WaitableEvent::Signal, | 76 FROM_HERE, base::Bind(&base::WaitableEvent::Signal, |
| 77 base::Unretained(&idle_waiter_))); | 77 base::Unretained(&idle_waiter_))); |
| 78 idle_waiter_.Wait(); | 78 idle_waiter_.Wait(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void CreateEncoder(webrtc::VideoCodecType codec_type) { | 81 void CreateEncoder(webrtc::VideoCodecType codec_type) { |
| 82 DVLOG(3) << __FUNCTION__; | 82 DVLOG(3) << __FUNCTION__; |
| 83 rtc_encoder_ = base::WrapUnique( | 83 rtc_encoder_ = base::MakeUnique<RTCVideoEncoder>(codec_type, |
| 84 new RTCVideoEncoder(codec_type, mock_gpu_factories_.get())); | 84 mock_gpu_factories_.get()); |
| 85 } | 85 } |
| 86 | 86 |
| 87 // media::VideoEncodeAccelerator implementation. | 87 // media::VideoEncodeAccelerator implementation. |
| 88 bool Initialize(media::VideoPixelFormat input_format, | 88 bool Initialize(media::VideoPixelFormat input_format, |
| 89 const gfx::Size& input_visible_size, | 89 const gfx::Size& input_visible_size, |
| 90 media::VideoCodecProfile output_profile, | 90 media::VideoCodecProfile output_profile, |
| 91 uint32_t initial_bitrate, | 91 uint32_t initial_bitrate, |
| 92 media::VideoEncodeAccelerator::Client* client) { | 92 media::VideoEncodeAccelerator::Client* client) { |
| 93 DVLOG(3) << __FUNCTION__; | 93 DVLOG(3) << __FUNCTION__; |
| 94 client->RequireBitstreamBuffers(0, input_visible_size, | 94 client->RequireBitstreamBuffers(0, input_visible_size, |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 rtc_encoder_->Encode(webrtc::VideoFrame(upscaled_buffer, 0, 0, | 171 rtc_encoder_->Encode(webrtc::VideoFrame(upscaled_buffer, 0, 0, |
| 172 webrtc::kVideoRotation_0), | 172 webrtc::kVideoRotation_0), |
| 173 nullptr, &frame_types)); | 173 nullptr, &frame_types)); |
| 174 } | 174 } |
| 175 | 175 |
| 176 INSTANTIATE_TEST_CASE_P(CodecProfiles, | 176 INSTANTIATE_TEST_CASE_P(CodecProfiles, |
| 177 RTCVideoEncoderTest, | 177 RTCVideoEncoderTest, |
| 178 Values(webrtc::kVideoCodecVP8, | 178 Values(webrtc::kVideoCodecVP8, |
| 179 webrtc::kVideoCodecH264)); | 179 webrtc::kVideoCodecH264)); |
| 180 } // namespace content | 180 } // namespace content |
| OLD | NEW |