| OLD | NEW |
| 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 "media/gpu/ipc/service/gpu_video_encode_accelerator.h" | 5 #include "media/gpu/ipc/service/gpu_video_encode_accelerator.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 VideoCodecProfile output_profile, | 196 VideoCodecProfile output_profile, |
| 197 uint32_t initial_bitrate) { | 197 uint32_t initial_bitrate) { |
| 198 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 198 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 199 DVLOG(1) << __func__ | 199 DVLOG(1) << __func__ |
| 200 << " input_format=" << VideoPixelFormatToString(input_format) | 200 << " input_format=" << VideoPixelFormatToString(input_format) |
| 201 << ", input_visible_size=" << input_visible_size.ToString() | 201 << ", input_visible_size=" << input_visible_size.ToString() |
| 202 << ", output_profile=" << GetProfileName(output_profile) | 202 << ", output_profile=" << GetProfileName(output_profile) |
| 203 << ", initial_bitrate=" << initial_bitrate; | 203 << ", initial_bitrate=" << initial_bitrate; |
| 204 DCHECK(!encoder_); | 204 DCHECK(!encoder_); |
| 205 | 205 |
| 206 if (!stub_->channel()->AddRoute(host_route_id_, stub_->stream_id(), this)) { | 206 if (!stub_->channel()->AddRoute(host_route_id_, stub_->sequence_id(), this)) { |
| 207 DLOG(ERROR) << __func__ << " failed to add route"; | 207 DLOG(ERROR) << __func__ << " failed to add route"; |
| 208 return false; | 208 return false; |
| 209 } | 209 } |
| 210 | 210 |
| 211 if (input_visible_size.width() > limits::kMaxDimension || | 211 if (input_visible_size.width() > limits::kMaxDimension || |
| 212 input_visible_size.height() > limits::kMaxDimension || | 212 input_visible_size.height() > limits::kMaxDimension || |
| 213 input_visible_size.GetArea() > limits::kMaxCanvas) { | 213 input_visible_size.GetArea() > limits::kMaxCanvas) { |
| 214 DLOG(ERROR) << __func__ << "too large input_visible_size " | 214 DLOG(ERROR) << __func__ << "too large input_visible_size " |
| 215 << input_visible_size.ToString(); | 215 << input_visible_size.ToString(); |
| 216 return false; | 216 return false; |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 DLOG(ERROR) << __func__ << " failed."; | 536 DLOG(ERROR) << __func__ << " failed."; |
| 537 } | 537 } |
| 538 } | 538 } |
| 539 | 539 |
| 540 bool GpuVideoEncodeAccelerator::CheckIfCalledOnCorrectThread() { | 540 bool GpuVideoEncodeAccelerator::CheckIfCalledOnCorrectThread() { |
| 541 return (filter_ && io_task_runner_->BelongsToCurrentThread()) || | 541 return (filter_ && io_task_runner_->BelongsToCurrentThread()) || |
| 542 (!filter_ && main_task_runner_->BelongsToCurrentThread()); | 542 (!filter_ && main_task_runner_->BelongsToCurrentThread()); |
| 543 } | 543 } |
| 544 | 544 |
| 545 } // namespace media | 545 } // namespace media |
| OLD | NEW |