| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ppp_video_decoder_proxy.h" | 5 #include "ppapi/proxy/ppp_video_decoder_proxy.h" |
| 6 | 6 |
| 7 #include "ppapi/proxy/host_dispatcher.h" | 7 #include "ppapi/proxy/host_dispatcher.h" |
| 8 #include "ppapi/proxy/plugin_globals.h" | 8 #include "ppapi/proxy/plugin_globals.h" |
| 9 #include "ppapi/proxy/plugin_resource_tracker.h" | 9 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 return handled; | 118 return handled; |
| 119 } | 119 } |
| 120 | 120 |
| 121 void PPP_VideoDecoder_Proxy::OnMsgProvidePictureBuffers( | 121 void PPP_VideoDecoder_Proxy::OnMsgProvidePictureBuffers( |
| 122 const HostResource& decoder, | 122 const HostResource& decoder, |
| 123 uint32_t req_num_of_bufs, | 123 uint32_t req_num_of_bufs, |
| 124 const PP_Size& dimensions, | 124 const PP_Size& dimensions, |
| 125 uint32_t texture_target) { | 125 uint32_t texture_target) { |
| 126 PP_Resource plugin_decoder = PluginGlobals::Get()->plugin_resource_tracker()-> | 126 PP_Resource plugin_decoder = PluginGlobals::Get()->plugin_resource_tracker()-> |
| 127 PluginResourceForHostResource(decoder); | 127 PluginResourceForHostResource(decoder); |
| 128 if (!plugin_decoder) |
| 129 return; |
| 128 CallWhileUnlocked(ppp_video_decoder_impl_->ProvidePictureBuffers, | 130 CallWhileUnlocked(ppp_video_decoder_impl_->ProvidePictureBuffers, |
| 129 decoder.instance(), | 131 decoder.instance(), |
| 130 plugin_decoder, | 132 plugin_decoder, |
| 131 req_num_of_bufs, | 133 req_num_of_bufs, |
| 132 &dimensions, | 134 &dimensions, |
| 133 texture_target); | 135 texture_target); |
| 134 } | 136 } |
| 135 | 137 |
| 136 void PPP_VideoDecoder_Proxy::OnMsgDismissPictureBuffer( | 138 void PPP_VideoDecoder_Proxy::OnMsgDismissPictureBuffer( |
| 137 const HostResource& decoder, int32_t picture_id) { | 139 const HostResource& decoder, int32_t picture_id) { |
| 138 PP_Resource plugin_decoder = PluginGlobals::Get()->plugin_resource_tracker()-> | 140 PP_Resource plugin_decoder = PluginGlobals::Get()->plugin_resource_tracker()-> |
| 139 PluginResourceForHostResource(decoder); | 141 PluginResourceForHostResource(decoder); |
| 142 if (!plugin_decoder) |
| 143 return; |
| 140 CallWhileUnlocked(ppp_video_decoder_impl_->DismissPictureBuffer, | 144 CallWhileUnlocked(ppp_video_decoder_impl_->DismissPictureBuffer, |
| 141 decoder.instance(), | 145 decoder.instance(), |
| 142 plugin_decoder, | 146 plugin_decoder, |
| 143 picture_id); | 147 picture_id); |
| 144 } | 148 } |
| 145 | 149 |
| 146 void PPP_VideoDecoder_Proxy::OnMsgPictureReady( | 150 void PPP_VideoDecoder_Proxy::OnMsgPictureReady( |
| 147 const HostResource& decoder, const PP_Picture_Dev& picture) { | 151 const HostResource& decoder, const PP_Picture_Dev& picture) { |
| 148 PP_Resource plugin_decoder = PluginGlobals::Get()->plugin_resource_tracker()-> | 152 PP_Resource plugin_decoder = PluginGlobals::Get()->plugin_resource_tracker()-> |
| 149 PluginResourceForHostResource(decoder); | 153 PluginResourceForHostResource(decoder); |
| 154 if (!plugin_decoder) |
| 155 return; |
| 150 CallWhileUnlocked(ppp_video_decoder_impl_->PictureReady, | 156 CallWhileUnlocked(ppp_video_decoder_impl_->PictureReady, |
| 151 decoder.instance(), | 157 decoder.instance(), |
| 152 plugin_decoder, | 158 plugin_decoder, |
| 153 &picture); | 159 &picture); |
| 154 } | 160 } |
| 155 | 161 |
| 156 void PPP_VideoDecoder_Proxy::OnMsgNotifyError( | 162 void PPP_VideoDecoder_Proxy::OnMsgNotifyError( |
| 157 const HostResource& decoder, PP_VideoDecodeError_Dev error) { | 163 const HostResource& decoder, PP_VideoDecodeError_Dev error) { |
| 158 PP_Resource plugin_decoder = PluginGlobals::Get()->plugin_resource_tracker()-> | 164 PP_Resource plugin_decoder = PluginGlobals::Get()->plugin_resource_tracker()-> |
| 159 PluginResourceForHostResource(decoder); | 165 PluginResourceForHostResource(decoder); |
| 166 if (!plugin_decoder) |
| 167 return; |
| 160 CallWhileUnlocked(ppp_video_decoder_impl_->NotifyError, | 168 CallWhileUnlocked(ppp_video_decoder_impl_->NotifyError, |
| 161 decoder.instance(), | 169 decoder.instance(), |
| 162 plugin_decoder, | 170 plugin_decoder, |
| 163 error); | 171 error); |
| 164 } | 172 } |
| 165 | 173 |
| 166 } // namespace proxy | 174 } // namespace proxy |
| 167 } // namespace ppapi | 175 } // namespace ppapi |
| OLD | NEW |