| 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" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 base::TimeDelta(), | 238 base::TimeDelta(), |
| 239 // It's turtles all the way down... | 239 // It's turtles all the way down... |
| 240 base::Bind(base::IgnoreResult(&base::MessageLoopProxy::PostTask), | 240 base::Bind(base::IgnoreResult(&base::MessageLoopProxy::PostTask), |
| 241 base::MessageLoopProxy::current(), | 241 base::MessageLoopProxy::current(), |
| 242 FROM_HERE, | 242 FROM_HERE, |
| 243 base::Bind(&GpuVideoEncodeAccelerator::EncodeFrameFinished, | 243 base::Bind(&GpuVideoEncodeAccelerator::EncodeFrameFinished, |
| 244 weak_this_factory_.GetWeakPtr(), | 244 weak_this_factory_.GetWeakPtr(), |
| 245 frame_id, | 245 frame_id, |
| 246 base::Passed(&shm)))); | 246 base::Passed(&shm)))); |
| 247 | 247 |
| 248 if (!frame) { | 248 if (!frame.get()) { |
| 249 DLOG(ERROR) << "GpuVideoEncodeAccelerator::OnEncode(): " | 249 DLOG(ERROR) << "GpuVideoEncodeAccelerator::OnEncode(): " |
| 250 "could not create VideoFrame for frame_id=" << frame_id; | 250 "could not create VideoFrame for frame_id=" << frame_id; |
| 251 NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError); | 251 NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError); |
| 252 return; | 252 return; |
| 253 } | 253 } |
| 254 | 254 |
| 255 encoder_->Encode(frame, force_keyframe); | 255 encoder_->Encode(frame, force_keyframe); |
| 256 } | 256 } |
| 257 | 257 |
| 258 void GpuVideoEncodeAccelerator::OnUseOutputBitstreamBuffer( | 258 void GpuVideoEncodeAccelerator::OnUseOutputBitstreamBuffer( |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 stub_->channel()->Send(message); | 308 stub_->channel()->Send(message); |
| 309 } | 309 } |
| 310 | 310 |
| 311 void GpuVideoEncodeAccelerator::SendCreateEncoderReply(IPC::Message* message, | 311 void GpuVideoEncodeAccelerator::SendCreateEncoderReply(IPC::Message* message, |
| 312 bool succeeded) { | 312 bool succeeded) { |
| 313 GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(message, succeeded); | 313 GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(message, succeeded); |
| 314 Send(message); | 314 Send(message); |
| 315 } | 315 } |
| 316 | 316 |
| 317 } // namespace content | 317 } // namespace content |
| OLD | NEW |