| 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 "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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 reset_callback_ = callback; | 169 reset_callback_ = callback; |
| 170 | 170 |
| 171 platform_video_decoder_->Reset(); | 171 platform_video_decoder_->Reset(); |
| 172 return PP_OK_COMPLETIONPENDING; | 172 return PP_OK_COMPLETIONPENDING; |
| 173 } | 173 } |
| 174 | 174 |
| 175 void PPB_VideoDecoder_Impl::Destroy() { | 175 void PPB_VideoDecoder_Impl::Destroy() { |
| 176 if (!platform_video_decoder_) | 176 if (!platform_video_decoder_) |
| 177 return; | 177 return; |
| 178 platform_video_decoder_->Destroy(); | 178 platform_video_decoder_->Destroy(); |
| 179 platform_video_decoder_ = NULL; |
| 180 ppp_videodecoder_ = NULL; |
| 179 } | 181 } |
| 180 | 182 |
| 181 void PPB_VideoDecoder_Impl::ProvidePictureBuffers( | 183 void PPB_VideoDecoder_Impl::ProvidePictureBuffers( |
| 182 uint32 requested_num_of_buffers, const gfx::Size& dimensions) { | 184 uint32 requested_num_of_buffers, const gfx::Size& dimensions) { |
| 183 if (!ppp_videodecoder_) | 185 if (!ppp_videodecoder_) |
| 184 return; | 186 return; |
| 185 | 187 |
| 186 PP_Size out_dim = PP_MakeSize(dimensions.width(), dimensions.height()); | 188 PP_Size out_dim = PP_MakeSize(dimensions.width(), dimensions.height()); |
| 187 ScopedResourceId resource(this); | 189 ScopedResourceId resource(this); |
| 188 ppp_videodecoder_->ProvidePictureBuffers( | 190 ppp_videodecoder_->ProvidePictureBuffers( |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 263 |
| 262 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { | 264 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { |
| 263 if (initialization_callback_.func == NULL) | 265 if (initialization_callback_.func == NULL) |
| 264 return; | 266 return; |
| 265 | 267 |
| 266 PP_RunAndClearCompletionCallback(&initialization_callback_, PP_OK); | 268 PP_RunAndClearCompletionCallback(&initialization_callback_, PP_OK); |
| 267 } | 269 } |
| 268 | 270 |
| 269 } // namespace ppapi | 271 } // namespace ppapi |
| 270 } // namespace webkit | 272 } // namespace webkit |
| OLD | NEW |