| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 return; | 213 return; |
| 214 | 214 |
| 215 FlushCommandBuffer(); | 215 FlushCommandBuffer(); |
| 216 platform_video_decoder_->Destroy(); | 216 platform_video_decoder_->Destroy(); |
| 217 ::ppapi::PPB_VideoDecoder_Shared::Destroy(); | 217 ::ppapi::PPB_VideoDecoder_Shared::Destroy(); |
| 218 platform_video_decoder_ = NULL; | 218 platform_video_decoder_ = NULL; |
| 219 ppp_videodecoder_ = NULL; | 219 ppp_videodecoder_ = NULL; |
| 220 } | 220 } |
| 221 | 221 |
| 222 void PPB_VideoDecoder_Impl::ProvidePictureBuffers( | 222 void PPB_VideoDecoder_Impl::ProvidePictureBuffers( |
| 223 uint32 requested_num_of_buffers, const gfx::Size& dimensions) { | 223 uint32 requested_num_of_buffers, |
| 224 const gfx::Size& dimensions, |
| 225 uint32 texture_target) { |
| 224 if (!ppp_videodecoder_) | 226 if (!ppp_videodecoder_) |
| 225 return; | 227 return; |
| 226 | 228 |
| 227 PP_Size out_dim = PP_MakeSize(dimensions.width(), dimensions.height()); | 229 PP_Size out_dim = PP_MakeSize(dimensions.width(), dimensions.height()); |
| 228 ppp_videodecoder_->ProvidePictureBuffers(pp_instance(), pp_resource(), | 230 ppp_videodecoder_->ProvidePictureBuffers(pp_instance(), pp_resource(), |
| 229 requested_num_of_buffers, &out_dim); | 231 requested_num_of_buffers, &out_dim, texture_target); |
| 230 } | 232 } |
| 231 | 233 |
| 232 void PPB_VideoDecoder_Impl::PictureReady(const media::Picture& picture) { | 234 void PPB_VideoDecoder_Impl::PictureReady(const media::Picture& picture) { |
| 233 if (!ppp_videodecoder_) | 235 if (!ppp_videodecoder_) |
| 234 return; | 236 return; |
| 235 | 237 |
| 236 PP_Picture_Dev output; | 238 PP_Picture_Dev output; |
| 237 output.picture_buffer_id = picture.picture_buffer_id(); | 239 output.picture_buffer_id = picture.picture_buffer_id(); |
| 238 output.bitstream_buffer_id = picture.bitstream_buffer_id(); | 240 output.bitstream_buffer_id = picture.bitstream_buffer_id(); |
| 239 ppp_videodecoder_->PictureReady(pp_instance(), pp_resource(), &output); | 241 ppp_videodecoder_->PictureReady(pp_instance(), pp_resource(), &output); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 void PPB_VideoDecoder_Impl::NotifyFlushDone() { | 273 void PPB_VideoDecoder_Impl::NotifyFlushDone() { |
| 272 RunFlushCallback(PP_OK); | 274 RunFlushCallback(PP_OK); |
| 273 } | 275 } |
| 274 | 276 |
| 275 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { | 277 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { |
| 276 NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; | 278 NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; |
| 277 } | 279 } |
| 278 | 280 |
| 279 } // namespace ppapi | 281 } // namespace ppapi |
| 280 } // namespace webkit | 282 } // namespace webkit |
| OLD | NEW |