| OLD | NEW |
| 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 "content/common/gpu/media/vaapi_video_encode_accelerator.h" | 5 #include "content/common/gpu/media/vaapi_video_encode_accelerator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 DCHECK_EQ(visible_size_.width() % 2, 0); | 207 DCHECK_EQ(visible_size_.width() % 2, 0); |
| 208 DCHECK_EQ(visible_size_.height() % 2, 0); | 208 DCHECK_EQ(visible_size_.height() % 2, 0); |
| 209 coded_size_ = gfx::Size(RoundUpToPowerOf2(visible_size_.width(), 16), | 209 coded_size_ = gfx::Size(RoundUpToPowerOf2(visible_size_.width(), 16), |
| 210 RoundUpToPowerOf2(visible_size_.height(), 16)); | 210 RoundUpToPowerOf2(visible_size_.height(), 16)); |
| 211 mb_width_ = coded_size_.width() / 16; | 211 mb_width_ = coded_size_.width() / 16; |
| 212 mb_height_ = coded_size_.height() / 16; | 212 mb_height_ = coded_size_.height() / 16; |
| 213 output_buffer_byte_size_ = coded_size_.GetArea(); | 213 output_buffer_byte_size_ = coded_size_.GetArea(); |
| 214 | 214 |
| 215 UpdateRates(initial_bitrate, kDefaultFramerate); | 215 UpdateRates(initial_bitrate, kDefaultFramerate); |
| 216 | 216 |
| 217 vaapi_wrapper_ = VaapiWrapper::Create(VaapiWrapper::kEncode, | 217 vaapi_wrapper_ = |
| 218 output_profile, | 218 VaapiWrapper::CreateForVideoCodec(VaapiWrapper::kEncode, output_profile, |
| 219 base::Bind(&ReportToUMA, VAAPI_ERROR)); | 219 base::Bind(&ReportToUMA, VAAPI_ERROR)); |
| 220 if (!vaapi_wrapper_.get()) { | 220 if (!vaapi_wrapper_.get()) { |
| 221 LOG(ERROR) << "Failed initializing VAAPI"; | 221 LOG(ERROR) << "Failed initializing VAAPI"; |
| 222 return false; | 222 return false; |
| 223 } | 223 } |
| 224 | 224 |
| 225 if (!encoder_thread_.Start()) { | 225 if (!encoder_thread_.Start()) { |
| 226 LOG(ERROR) << "Failed to start encoder thread"; | 226 LOG(ERROR) << "Failed to start encoder thread"; |
| 227 return false; | 227 return false; |
| 228 } | 228 } |
| (...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1080 } | 1080 } |
| 1081 | 1081 |
| 1082 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() | 1082 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() |
| 1083 : coded_buffer(VA_INVALID_ID), keyframe(false) { | 1083 : coded_buffer(VA_INVALID_ID), keyframe(false) { |
| 1084 } | 1084 } |
| 1085 | 1085 |
| 1086 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() { | 1086 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() { |
| 1087 } | 1087 } |
| 1088 | 1088 |
| 1089 } // namespace content | 1089 } // namespace content |
| OLD | NEW |