OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/media_stream_track_resource_base.h" | 5 #include "ppapi/proxy/media_stream_track_resource_base.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 Post(RENDERER, PpapiHostMsg_MediaStreamTrack_Close()); | 63 Post(RENDERER, PpapiHostMsg_MediaStreamTrack_Close()); |
64 has_ended_ = true; | 64 has_ended_ = true; |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 void MediaStreamTrackResourceBase::OnPluginMsgInitBuffers( | 68 void MediaStreamTrackResourceBase::OnPluginMsgInitBuffers( |
69 const ResourceMessageReplyParams& params, | 69 const ResourceMessageReplyParams& params, |
70 int32_t number_of_buffers, | 70 int32_t number_of_buffers, |
71 int32_t buffer_size, | 71 int32_t buffer_size, |
72 bool readonly) { | 72 bool readonly) { |
73 base::SharedMemoryHandle shm_handle = base::SharedMemory::NULLHandle(); | 73 base::SharedMemoryHandle shm_handle; |
74 params.TakeSharedMemoryHandleAtIndex(0, &shm_handle); | 74 params.TakeSharedMemoryHandleAtIndex(0, &shm_handle); |
75 buffer_manager_.SetBuffers(number_of_buffers, buffer_size, | 75 buffer_manager_.SetBuffers(number_of_buffers, buffer_size, |
76 std::unique_ptr<base::SharedMemory>( | 76 std::unique_ptr<base::SharedMemory>( |
77 new base::SharedMemory(shm_handle, readonly)), | 77 new base::SharedMemory(shm_handle, readonly)), |
78 false); | 78 false); |
79 } | 79 } |
80 | 80 |
81 void MediaStreamTrackResourceBase::OnPluginMsgEnqueueBuffer( | 81 void MediaStreamTrackResourceBase::OnPluginMsgEnqueueBuffer( |
82 const ResourceMessageReplyParams& params, | 82 const ResourceMessageReplyParams& params, |
83 int32_t index) { | 83 int32_t index) { |
84 buffer_manager_.EnqueueBuffer(index); | 84 buffer_manager_.EnqueueBuffer(index); |
85 } | 85 } |
86 | 86 |
87 void MediaStreamTrackResourceBase::OnPluginMsgEnqueueBuffers( | 87 void MediaStreamTrackResourceBase::OnPluginMsgEnqueueBuffers( |
88 const ResourceMessageReplyParams& params, | 88 const ResourceMessageReplyParams& params, |
89 const std::vector<int32_t>& indices) { | 89 const std::vector<int32_t>& indices) { |
90 for (size_t i = 0; i < indices.size(); ++i) | 90 for (size_t i = 0; i < indices.size(); ++i) |
91 buffer_manager_.EnqueueBuffer(indices[i]); | 91 buffer_manager_.EnqueueBuffer(indices[i]); |
92 } | 92 } |
93 | 93 |
94 } // namespace proxy | 94 } // namespace proxy |
95 } // namespace ppapi | 95 } // namespace ppapi |
OLD | NEW |