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/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
219 void VaapiVideoEncodeAccelerator::InitializeTask() { | 219 void VaapiVideoEncodeAccelerator::InitializeTask() { |
220 DCHECK(encoder_thread_task_runner_->BelongsToCurrentThread()); | 220 DCHECK(encoder_thread_task_runner_->BelongsToCurrentThread()); |
221 DCHECK_EQ(state_, kUninitialized); | 221 DCHECK_EQ(state_, kUninitialized); |
222 DVLOGF(4); | 222 DVLOGF(4); |
223 | 223 |
224 va_surface_release_cb_ = media::BindToCurrentLoop( | 224 va_surface_release_cb_ = media::BindToCurrentLoop( |
225 base::Bind(&VaapiVideoEncodeAccelerator::RecycleVASurfaceID, | 225 base::Bind(&VaapiVideoEncodeAccelerator::RecycleVASurfaceID, |
226 base::Unretained(this))); | 226 base::Unretained(this))); |
227 | 227 |
228 if (!vaapi_wrapper_->CreateSurfaces( | 228 if (!vaapi_wrapper_->CreateSurfaces(VA_RT_FORMAT_YUV420, coded_size_, |
229 coded_size_, kNumSurfaces, &available_va_surface_ids_)) { | 229 kNumSurfaces, |
| 230 &available_va_surface_ids_)) { |
230 NOTIFY_ERROR(kPlatformFailureError, "Failed creating VASurfaces"); | 231 NOTIFY_ERROR(kPlatformFailureError, "Failed creating VASurfaces"); |
231 return; | 232 return; |
232 } | 233 } |
233 | 234 |
234 UpdateSPS(); | 235 UpdateSPS(); |
235 GeneratePackedSPS(); | 236 GeneratePackedSPS(); |
236 | 237 |
237 UpdatePPS(); | 238 UpdatePPS(); |
238 GeneratePackedPPS(); | 239 GeneratePackedPPS(); |
239 | 240 |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 } | 1049 } |
1049 | 1050 |
1050 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() | 1051 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() |
1051 : coded_buffer(VA_INVALID_ID), keyframe(false) { | 1052 : coded_buffer(VA_INVALID_ID), keyframe(false) { |
1052 } | 1053 } |
1053 | 1054 |
1054 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() { | 1055 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() { |
1055 } | 1056 } |
1056 | 1057 |
1057 } // namespace content | 1058 } // namespace content |
OLD | NEW |