| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ppapi/proxy/ppapi_messages.h" | 8 #include "ppapi/proxy/ppapi_messages.h" |
| 9 | 9 |
| 10 namespace ppapi { | 10 namespace ppapi { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 void MediaStreamTrackResourceBase::SendEnqueueBufferMessageToHost( | 36 void MediaStreamTrackResourceBase::SendEnqueueBufferMessageToHost( |
| 37 int32_t index) { | 37 int32_t index) { |
| 38 DCHECK_GE(index, 0); | 38 DCHECK_GE(index, 0); |
| 39 DCHECK_LT(index, buffer_manager()->number_of_buffers()); | 39 DCHECK_LT(index, buffer_manager()->number_of_buffers()); |
| 40 Post(RENDERER, PpapiHostMsg_MediaStreamTrack_EnqueueBuffer(index)); | 40 Post(RENDERER, PpapiHostMsg_MediaStreamTrack_EnqueueBuffer(index)); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void MediaStreamTrackResourceBase::OnReplyReceived( | 43 void MediaStreamTrackResourceBase::OnReplyReceived( |
| 44 const ResourceMessageReplyParams& params, | 44 const ResourceMessageReplyParams& params, |
| 45 const IPC::Message& msg) { | 45 const IPC::Message& msg) { |
| 46 IPC_BEGIN_MESSAGE_MAP(MediaStreamTrackResourceBase, msg) | 46 PPAPI_BEGIN_MESSAGE_MAP(MediaStreamTrackResourceBase, msg) |
| 47 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( | 47 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( |
| 48 PpapiPluginMsg_MediaStreamTrack_InitBuffers, OnPluginMsgInitBuffers) | 48 PpapiPluginMsg_MediaStreamTrack_InitBuffers, OnPluginMsgInitBuffers) |
| 49 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( | 49 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( |
| 50 PpapiPluginMsg_MediaStreamTrack_EnqueueBuffer, OnPluginMsgEnqueueBuffer) | 50 PpapiPluginMsg_MediaStreamTrack_EnqueueBuffer, OnPluginMsgEnqueueBuffer) |
| 51 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( | 51 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( |
| 52 PpapiPluginMsg_MediaStreamTrack_EnqueueBuffers, | 52 PpapiPluginMsg_MediaStreamTrack_EnqueueBuffers, |
| 53 OnPluginMsgEnqueueBuffers) | 53 OnPluginMsgEnqueueBuffers) |
| 54 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL_UNHANDLED( | 54 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL_UNHANDLED( |
| 55 PluginResource::OnReplyReceived(params, msg)) | 55 PluginResource::OnReplyReceived(params, msg)) |
| 56 IPC_END_MESSAGE_MAP() | 56 PPAPI_END_MESSAGE_MAP() |
| 57 } | 57 } |
| 58 | 58 |
| 59 void MediaStreamTrackResourceBase::CloseInternal() { | 59 void MediaStreamTrackResourceBase::CloseInternal() { |
| 60 if (!has_ended_) { | 60 if (!has_ended_) { |
| 61 Post(RENDERER, PpapiHostMsg_MediaStreamTrack_Close()); | 61 Post(RENDERER, PpapiHostMsg_MediaStreamTrack_Close()); |
| 62 has_ended_ = true; | 62 has_ended_ = true; |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 void MediaStreamTrackResourceBase::OnPluginMsgInitBuffers( | 66 void MediaStreamTrackResourceBase::OnPluginMsgInitBuffers( |
| (...skipping 17 matching lines...) Expand all Loading... |
| 84 | 84 |
| 85 void MediaStreamTrackResourceBase::OnPluginMsgEnqueueBuffers( | 85 void MediaStreamTrackResourceBase::OnPluginMsgEnqueueBuffers( |
| 86 const ResourceMessageReplyParams& params, | 86 const ResourceMessageReplyParams& params, |
| 87 const std::vector<int32_t>& indices) { | 87 const std::vector<int32_t>& indices) { |
| 88 for (size_t i = 0; i < indices.size(); ++i) | 88 for (size_t i = 0; i < indices.size(); ++i) |
| 89 buffer_manager_.EnqueueBuffer(indices[i]); | 89 buffer_manager_.EnqueueBuffer(indices[i]); |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace proxy | 92 } // namespace proxy |
| 93 } // namespace ppapi | 93 } // namespace ppapi |
| OLD | NEW |