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 "webkit/plugins/ppapi/ppb_video_decoder_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 199 |
200 if (!SetResetCallback(callback)) | 200 if (!SetResetCallback(callback)) |
201 return PP_ERROR_INPROGRESS; | 201 return PP_ERROR_INPROGRESS; |
202 | 202 |
203 FlushCommandBuffer(); | 203 FlushCommandBuffer(); |
204 platform_video_decoder_->Reset(); | 204 platform_video_decoder_->Reset(); |
205 return PP_OK_COMPLETIONPENDING; | 205 return PP_OK_COMPLETIONPENDING; |
206 } | 206 } |
207 | 207 |
208 void PPB_VideoDecoder_Impl::Destroy() { | 208 void PPB_VideoDecoder_Impl::Destroy() { |
209 if (!platform_video_decoder_.get()) | 209 FlushCommandBuffer(); |
210 return; | |
211 | 210 |
212 FlushCommandBuffer(); | 211 if (platform_video_decoder_) |
213 platform_video_decoder_.release()->Destroy(); | 212 platform_video_decoder_.release()->Destroy(); |
| 213 ppp_videodecoder_ = NULL; |
| 214 |
214 ::ppapi::PPB_VideoDecoder_Shared::Destroy(); | 215 ::ppapi::PPB_VideoDecoder_Shared::Destroy(); |
215 ppp_videodecoder_ = NULL; | |
216 } | 216 } |
217 | 217 |
218 void PPB_VideoDecoder_Impl::ProvidePictureBuffers( | 218 void PPB_VideoDecoder_Impl::ProvidePictureBuffers( |
219 uint32 requested_num_of_buffers, | 219 uint32 requested_num_of_buffers, |
220 const gfx::Size& dimensions, | 220 const gfx::Size& dimensions, |
221 uint32 texture_target) { | 221 uint32 texture_target) { |
222 if (!ppp_videodecoder_) | 222 if (!ppp_videodecoder_) |
223 return; | 223 return; |
224 | 224 |
225 PP_Size out_dim = PP_MakeSize(dimensions.width(), dimensions.height()); | 225 PP_Size out_dim = PP_MakeSize(dimensions.width(), dimensions.height()); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 void PPB_VideoDecoder_Impl::NotifyFlushDone() { | 269 void PPB_VideoDecoder_Impl::NotifyFlushDone() { |
270 RunFlushCallback(PP_OK); | 270 RunFlushCallback(PP_OK); |
271 } | 271 } |
272 | 272 |
273 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { | 273 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { |
274 NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; | 274 NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; |
275 } | 275 } |
276 | 276 |
277 } // namespace ppapi | 277 } // namespace ppapi |
278 } // namespace webkit | 278 } // namespace webkit |
OLD | NEW |