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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 new base::SharedMemory(buffer_handle, true)); | 262 new base::SharedMemory(buffer_handle, true)); |
263 if (!shm->MapAt(map_offset.ValueOrDie(), map_size.ValueOrDie())) { | 263 if (!shm->MapAt(map_offset.ValueOrDie(), map_size.ValueOrDie())) { |
264 DLOG(ERROR) << "GpuVideoEncodeAccelerator::OnEncode(): " | 264 DLOG(ERROR) << "GpuVideoEncodeAccelerator::OnEncode(): " |
265 "could not map frame_id=" << frame_id; | 265 "could not map frame_id=" << frame_id; |
266 NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError); | 266 NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError); |
267 return; | 267 return; |
268 } | 268 } |
269 | 269 |
270 uint8* shm_memory = reinterpret_cast<uint8*>(shm->memory()) + aligned_offset; | 270 uint8* shm_memory = reinterpret_cast<uint8*>(shm->memory()) + aligned_offset; |
271 scoped_refptr<media::VideoFrame> frame = | 271 scoped_refptr<media::VideoFrame> frame = |
272 media::VideoFrame::WrapExternalPackedMemory( | 272 media::VideoFrame::WrapExternalSharedMemory( |
273 input_format_, | 273 input_format_, |
274 input_coded_size_, | 274 input_coded_size_, |
275 gfx::Rect(input_visible_size_), | 275 gfx::Rect(input_visible_size_), |
276 input_visible_size_, | 276 input_visible_size_, |
277 shm_memory, | 277 shm_memory, |
278 buffer_size, | 278 buffer_size, |
279 buffer_handle, | 279 buffer_handle, |
280 buffer_offset, | 280 buffer_offset, |
281 base::TimeDelta()); | 281 base::TimeDelta()); |
282 frame->AddDestructionObserver( | 282 frame->AddDestructionObserver( |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 stub_->channel()->Send(message); | 349 stub_->channel()->Send(message); |
350 } | 350 } |
351 | 351 |
352 void GpuVideoEncodeAccelerator::SendCreateEncoderReply(IPC::Message* message, | 352 void GpuVideoEncodeAccelerator::SendCreateEncoderReply(IPC::Message* message, |
353 bool succeeded) { | 353 bool succeeded) { |
354 GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(message, succeeded); | 354 GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(message, succeeded); |
355 Send(message); | 355 Send(message); |
356 } | 356 } |
357 | 357 |
358 } // namespace content | 358 } // namespace content |
OLD | NEW |