| 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/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return; | 156 return; |
| 157 } | 157 } |
| 158 | 158 |
| 159 scoped_refptr<media::VideoFrame> frame = | 159 scoped_refptr<media::VideoFrame> frame = |
| 160 media::VideoFrame::WrapExternalSharedMemory( | 160 media::VideoFrame::WrapExternalSharedMemory( |
| 161 input_format_, | 161 input_format_, |
| 162 input_coded_size_, | 162 input_coded_size_, |
| 163 gfx::Rect(input_visible_size_), | 163 gfx::Rect(input_visible_size_), |
| 164 input_visible_size_, | 164 input_visible_size_, |
| 165 reinterpret_cast<uint8*>(shm->memory()), | 165 reinterpret_cast<uint8*>(shm->memory()), |
| 166 buffer_size, |
| 166 buffer_handle, | 167 buffer_handle, |
| 167 base::TimeDelta(), | 168 base::TimeDelta(), |
| 168 // It's turtles all the way down... | 169 // It's turtles all the way down... |
| 169 base::Bind(base::IgnoreResult(&base::MessageLoopProxy::PostTask), | 170 base::Bind(base::IgnoreResult(&base::MessageLoopProxy::PostTask), |
| 170 base::MessageLoopProxy::current(), | 171 base::MessageLoopProxy::current(), |
| 171 FROM_HERE, | 172 FROM_HERE, |
| 172 base::Bind(&GpuVideoEncodeAccelerator::EncodeFrameFinished, | 173 base::Bind(&GpuVideoEncodeAccelerator::EncodeFrameFinished, |
| 173 weak_this_factory_.GetWeakPtr(), | 174 weak_this_factory_.GetWeakPtr(), |
| 174 frame_id, | 175 frame_id, |
| 175 base::Passed(&shm)))); | 176 base::Passed(&shm)))); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 return; | 235 return; |
| 235 } else if (!channel_->Send(message)) { | 236 } else if (!channel_->Send(message)) { |
| 236 DLOG(ERROR) << "GpuVideoEncodeAccelerator::Send(): sending failed: " | 237 DLOG(ERROR) << "GpuVideoEncodeAccelerator::Send(): sending failed: " |
| 237 "message->type()=" << message->type(); | 238 "message->type()=" << message->type(); |
| 238 NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError); | 239 NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError); |
| 239 return; | 240 return; |
| 240 } | 241 } |
| 241 } | 242 } |
| 242 | 243 |
| 243 } // namespace content | 244 } // namespace content |
| OLD | NEW |