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