| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ppapi/proxy/video_encoder_resource.h" | 5 #include "ppapi/proxy/video_encoder_resource.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 if (error) { | 344 if (error) { |
| 345 NotifyError(error); | 345 NotifyError(error); |
| 346 return; | 346 return; |
| 347 } | 347 } |
| 348 | 348 |
| 349 base::SharedMemoryHandle buffer_handle; | 349 base::SharedMemoryHandle buffer_handle; |
| 350 params.TakeSharedMemoryHandleAtIndex(0, &buffer_handle); | 350 params.TakeSharedMemoryHandleAtIndex(0, &buffer_handle); |
| 351 | 351 |
| 352 if (!buffer_manager_.SetBuffers( | 352 if (!buffer_manager_.SetBuffers( |
| 353 frame_count, frame_length, | 353 frame_count, frame_length, |
| 354 base::WrapUnique(new base::SharedMemory(buffer_handle, false)), | 354 base::MakeUnique<base::SharedMemory>(buffer_handle, false), true)) { |
| 355 true)) { | |
| 356 NotifyError(PP_ERROR_FAILED); | 355 NotifyError(PP_ERROR_FAILED); |
| 357 return; | 356 return; |
| 358 } | 357 } |
| 359 | 358 |
| 360 if (TrackedCallback::IsPending(get_video_frame_callback_)) | 359 if (TrackedCallback::IsPending(get_video_frame_callback_)) |
| 361 TryWriteVideoFrame(); | 360 TryWriteVideoFrame(); |
| 362 } | 361 } |
| 363 | 362 |
| 364 void VideoEncoderResource::OnPluginMsgEncodeReply( | 363 void VideoEncoderResource::OnPluginMsgEncodeReply( |
| 365 PP_Resource video_frame, | 364 PP_Resource video_frame, |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 for (VideoFrameMap::iterator it = video_frames_.begin(); | 476 for (VideoFrameMap::iterator it = video_frames_.begin(); |
| 478 it != video_frames_.end(); ++it) { | 477 it != video_frames_.end(); ++it) { |
| 479 it->second->Invalidate(); | 478 it->second->Invalidate(); |
| 480 it->second = nullptr; | 479 it->second = nullptr; |
| 481 } | 480 } |
| 482 video_frames_.clear(); | 481 video_frames_.clear(); |
| 483 } | 482 } |
| 484 | 483 |
| 485 } // namespace proxy | 484 } // namespace proxy |
| 486 } // namespace ppapi | 485 } // namespace ppapi |
| OLD | NEW |