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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 return; | 145 return; |
146 } | 146 } |
147 | 147 |
148 scoped_refptr<media::VideoFrame> frame = | 148 scoped_refptr<media::VideoFrame> frame = |
149 media::VideoFrame::WrapExternalSharedMemory( | 149 media::VideoFrame::WrapExternalSharedMemory( |
150 media::VideoFrame::I420, | 150 media::VideoFrame::I420, |
151 input_coded_size_, | 151 input_coded_size_, |
152 gfx::Rect(input_visible_size_), | 152 gfx::Rect(input_visible_size_), |
153 input_visible_size_, | 153 input_visible_size_, |
154 reinterpret_cast<uint8*>(shm->memory()), | 154 reinterpret_cast<uint8*>(shm->memory()), |
| 155 buffer_size, |
155 buffer_handle, | 156 buffer_handle, |
156 base::TimeDelta(), | 157 base::TimeDelta(), |
157 // It's turtles all the way down... | 158 // It's turtles all the way down... |
158 base::Bind(base::IgnoreResult(&base::MessageLoopProxy::PostTask), | 159 base::Bind(base::IgnoreResult(&base::MessageLoopProxy::PostTask), |
159 base::MessageLoopProxy::current(), | 160 base::MessageLoopProxy::current(), |
160 FROM_HERE, | 161 FROM_HERE, |
161 base::Bind(&GpuVideoEncodeAccelerator::EncodeFrameFinished, | 162 base::Bind(&GpuVideoEncodeAccelerator::EncodeFrameFinished, |
162 weak_this_factory_.GetWeakPtr(), | 163 weak_this_factory_.GetWeakPtr(), |
163 frame_id, | 164 frame_id, |
164 base::Passed(&shm)))); | 165 base::Passed(&shm)))); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 return; | 224 return; |
224 } else if (!channel_->Send(message)) { | 225 } else if (!channel_->Send(message)) { |
225 DLOG(ERROR) << "GpuVideoEncodeAccelerator::Send(): sending failed: " | 226 DLOG(ERROR) << "GpuVideoEncodeAccelerator::Send(): sending failed: " |
226 "message->type()=" << message->type(); | 227 "message->type()=" << message->type(); |
227 NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError); | 228 NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError); |
228 return; | 229 return; |
229 } | 230 } |
230 } | 231 } |
231 | 232 |
232 } // namespace content | 233 } // namespace content |
OLD | NEW |