| 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 "content/renderer/pepper/ppb_video_decoder_impl.h" | 5 #include "content/renderer/pepper/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/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 return PP_ERROR_INPROGRESS; | 217 return PP_ERROR_INPROGRESS; |
| 218 | 218 |
| 219 FlushCommandBuffer(); | 219 FlushCommandBuffer(); |
| 220 decoder_->Reset(); | 220 decoder_->Reset(); |
| 221 return PP_OK_COMPLETIONPENDING; | 221 return PP_OK_COMPLETIONPENDING; |
| 222 } | 222 } |
| 223 | 223 |
| 224 void PPB_VideoDecoder_Impl::Destroy() { | 224 void PPB_VideoDecoder_Impl::Destroy() { |
| 225 FlushCommandBuffer(); | 225 FlushCommandBuffer(); |
| 226 | 226 |
| 227 if (decoder_) | 227 decoder_.reset(); |
| 228 decoder_.release()->Destroy(); | |
| 229 ppp_videodecoder_ = NULL; | 228 ppp_videodecoder_ = NULL; |
| 230 | 229 |
| 231 ::ppapi::PPB_VideoDecoder_Shared::Destroy(); | 230 ::ppapi::PPB_VideoDecoder_Shared::Destroy(); |
| 232 } | 231 } |
| 233 | 232 |
| 234 void PPB_VideoDecoder_Impl::ProvidePictureBuffers( | 233 void PPB_VideoDecoder_Impl::ProvidePictureBuffers( |
| 235 uint32 requested_num_of_buffers, | 234 uint32 requested_num_of_buffers, |
| 236 const gfx::Size& dimensions, | 235 const gfx::Size& dimensions, |
| 237 uint32 texture_target) { | 236 uint32 texture_target) { |
| 238 DCHECK(RenderThreadImpl::current()); | 237 DCHECK(RenderThreadImpl::current()); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 DCHECK(RenderThreadImpl::current()); | 288 DCHECK(RenderThreadImpl::current()); |
| 290 RunBitstreamBufferCallback(bitstream_buffer_id, PP_OK); | 289 RunBitstreamBufferCallback(bitstream_buffer_id, PP_OK); |
| 291 } | 290 } |
| 292 | 291 |
| 293 void PPB_VideoDecoder_Impl::NotifyFlushDone() { | 292 void PPB_VideoDecoder_Impl::NotifyFlushDone() { |
| 294 DCHECK(RenderThreadImpl::current()); | 293 DCHECK(RenderThreadImpl::current()); |
| 295 RunFlushCallback(PP_OK); | 294 RunFlushCallback(PP_OK); |
| 296 } | 295 } |
| 297 | 296 |
| 298 } // namespace content | 297 } // namespace content |
| OLD | NEW |