OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_resource_tracker.h" | 9 #include "ppapi/proxy/plugin_resource_tracker.h" |
9 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
10 #include "ppapi/proxy/ppb_video_decoder_proxy.h" | 11 #include "ppapi/proxy/ppb_video_decoder_proxy.h" |
11 #include "ppapi/thunk/enter.h" | 12 #include "ppapi/thunk/enter.h" |
12 #include "ppapi/thunk/ppb_video_decoder_api.h" | 13 #include "ppapi/thunk/ppb_video_decoder_api.h" |
13 #include "ppapi/thunk/thunk.h" | 14 #include "ppapi/thunk/thunk.h" |
14 | 15 |
15 using ppapi::thunk::PPB_VideoDecoder_API; | 16 using ppapi::thunk::PPB_VideoDecoder_API; |
16 | 17 |
17 namespace ppapi { | 18 namespace ppapi { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 OnMsgNotifyError) | 125 OnMsgNotifyError) |
125 IPC_MESSAGE_UNHANDLED(handled = false) | 126 IPC_MESSAGE_UNHANDLED(handled = false) |
126 IPC_END_MESSAGE_MAP() | 127 IPC_END_MESSAGE_MAP() |
127 DCHECK(handled); | 128 DCHECK(handled); |
128 return handled; | 129 return handled; |
129 } | 130 } |
130 | 131 |
131 void PPP_VideoDecoder_Proxy::OnMsgProvidePictureBuffers( | 132 void PPP_VideoDecoder_Proxy::OnMsgProvidePictureBuffers( |
132 const HostResource& decoder, uint32_t req_num_of_bufs, | 133 const HostResource& decoder, uint32_t req_num_of_bufs, |
133 const PP_Size& dimensions) { | 134 const PP_Size& dimensions) { |
134 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()-> | 135 PP_Resource plugin_decoder = PluginGlobals::Get()->plugin_resource_tracker()-> |
135 PluginResourceForHostResource(decoder); | 136 PluginResourceForHostResource(decoder); |
136 ppp_video_decoder_impl_->ProvidePictureBuffers( | 137 ppp_video_decoder_impl_->ProvidePictureBuffers( |
137 decoder.instance(), plugin_decoder, req_num_of_bufs, &dimensions); | 138 decoder.instance(), plugin_decoder, req_num_of_bufs, &dimensions); |
138 } | 139 } |
139 | 140 |
140 void PPP_VideoDecoder_Proxy::OnMsgDismissPictureBuffer( | 141 void PPP_VideoDecoder_Proxy::OnMsgDismissPictureBuffer( |
141 const HostResource& decoder, int32_t picture_id) { | 142 const HostResource& decoder, int32_t picture_id) { |
142 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()-> | 143 PP_Resource plugin_decoder = PluginGlobals::Get()->plugin_resource_tracker()-> |
143 PluginResourceForHostResource(decoder); | 144 PluginResourceForHostResource(decoder); |
144 ppp_video_decoder_impl_->DismissPictureBuffer( | 145 ppp_video_decoder_impl_->DismissPictureBuffer( |
145 decoder.instance(), plugin_decoder, picture_id); | 146 decoder.instance(), plugin_decoder, picture_id); |
146 } | 147 } |
147 | 148 |
148 void PPP_VideoDecoder_Proxy::OnMsgPictureReady( | 149 void PPP_VideoDecoder_Proxy::OnMsgPictureReady( |
149 const HostResource& decoder, const PP_Picture_Dev& picture) { | 150 const HostResource& decoder, const PP_Picture_Dev& picture) { |
150 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()-> | 151 PP_Resource plugin_decoder = PluginGlobals::Get()->plugin_resource_tracker()-> |
151 PluginResourceForHostResource(decoder); | 152 PluginResourceForHostResource(decoder); |
152 ppp_video_decoder_impl_->PictureReady( | 153 ppp_video_decoder_impl_->PictureReady( |
153 decoder.instance(), plugin_decoder, &picture); | 154 decoder.instance(), plugin_decoder, &picture); |
154 } | 155 } |
155 | 156 |
156 void PPP_VideoDecoder_Proxy::OnMsgNotifyEndOfStream( | 157 void PPP_VideoDecoder_Proxy::OnMsgNotifyEndOfStream( |
157 const HostResource& decoder) { | 158 const HostResource& decoder) { |
158 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()-> | 159 PP_Resource plugin_decoder = PluginGlobals::Get()->plugin_resource_tracker()-> |
159 PluginResourceForHostResource(decoder); | 160 PluginResourceForHostResource(decoder); |
160 ppp_video_decoder_impl_->EndOfStream(decoder.instance(), | 161 ppp_video_decoder_impl_->EndOfStream(decoder.instance(), |
161 plugin_decoder); | 162 plugin_decoder); |
162 } | 163 } |
163 | 164 |
164 void PPP_VideoDecoder_Proxy::OnMsgNotifyError( | 165 void PPP_VideoDecoder_Proxy::OnMsgNotifyError( |
165 const HostResource& decoder, PP_VideoDecodeError_Dev error) { | 166 const HostResource& decoder, PP_VideoDecodeError_Dev error) { |
166 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()-> | 167 PP_Resource plugin_decoder = PluginGlobals::Get()->plugin_resource_tracker()-> |
167 PluginResourceForHostResource(decoder); | 168 PluginResourceForHostResource(decoder); |
168 ppp_video_decoder_impl_->NotifyError( | 169 ppp_video_decoder_impl_->NotifyError( |
169 decoder.instance(), plugin_decoder, error); | 170 decoder.instance(), plugin_decoder, error); |
170 } | 171 } |
171 | 172 |
172 } // namespace proxy | 173 } // namespace proxy |
173 } // namespace ppapi | 174 } // namespace ppapi |
OLD | NEW |