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 "content/common/gpu/media/gpu_video_encode_accelerator.h" | 5 #include "content/common/gpu/media/gpu_video_encode_accelerator.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
11 #include "base/message_loop/message_loop_proxy.h" | |
12 #include "base/numerics/safe_math.h" | 11 #include "base/numerics/safe_math.h" |
13 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
14 #include "build/build_config.h" | 13 #include "build/build_config.h" |
15 #include "content/common/gpu/gpu_channel.h" | 14 #include "content/common/gpu/gpu_channel.h" |
16 #include "content/common/gpu/gpu_messages.h" | 15 #include "content/common/gpu/gpu_messages.h" |
17 #include "content/common/gpu/media/gpu_video_accelerator_util.h" | 16 #include "content/common/gpu/media/gpu_video_accelerator_util.h" |
18 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
19 #include "ipc/ipc_message_macros.h" | 18 #include "ipc/ipc_message_macros.h" |
20 #include "media/base/limits.h" | 19 #include "media/base/limits.h" |
21 #include "media/base/video_frame.h" | 20 #include "media/base/video_frame.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 input_format_, | 272 input_format_, |
274 input_coded_size_, | 273 input_coded_size_, |
275 gfx::Rect(input_visible_size_), | 274 gfx::Rect(input_visible_size_), |
276 input_visible_size_, | 275 input_visible_size_, |
277 shm_memory, | 276 shm_memory, |
278 buffer_size, | 277 buffer_size, |
279 buffer_handle, | 278 buffer_handle, |
280 buffer_offset, | 279 buffer_offset, |
281 base::TimeDelta(), | 280 base::TimeDelta(), |
282 // It's turtles all the way down... | 281 // It's turtles all the way down... |
283 base::Bind(base::IgnoreResult(&base::MessageLoopProxy::PostTask), | 282 base::Bind(base::IgnoreResult( |
284 base::MessageLoopProxy::current(), | 283 &base::SingleThreadTaskRunner::PostTask), |
| 284 base::ThreadTaskRunnerHandle::Get(), |
285 FROM_HERE, | 285 FROM_HERE, |
286 base::Bind(&GpuVideoEncodeAccelerator::EncodeFrameFinished, | 286 base::Bind(&GpuVideoEncodeAccelerator::EncodeFrameFinished, |
287 weak_this_factory_.GetWeakPtr(), | 287 weak_this_factory_.GetWeakPtr(), |
288 frame_id, | 288 frame_id, |
289 base::Passed(&shm)))); | 289 base::Passed(&shm)))); |
290 | 290 |
291 if (!frame.get()) { | 291 if (!frame.get()) { |
292 DLOG(ERROR) << "GpuVideoEncodeAccelerator::OnEncode(): " | 292 DLOG(ERROR) << "GpuVideoEncodeAccelerator::OnEncode(): " |
293 "could not create VideoFrame for frame_id=" << frame_id; | 293 "could not create VideoFrame for frame_id=" << frame_id; |
294 NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError); | 294 NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 stub_->channel()->Send(message); | 351 stub_->channel()->Send(message); |
352 } | 352 } |
353 | 353 |
354 void GpuVideoEncodeAccelerator::SendCreateEncoderReply(IPC::Message* message, | 354 void GpuVideoEncodeAccelerator::SendCreateEncoderReply(IPC::Message* message, |
355 bool succeeded) { | 355 bool succeeded) { |
356 GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(message, succeeded); | 356 GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(message, succeeded); |
357 Send(message); | 357 Send(message); |
358 } | 358 } |
359 | 359 |
360 } // namespace content | 360 } // namespace content |
OLD | NEW |