| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 return; | 219 return; |
| 220 | 220 |
| 221 FlushCommandBuffer(); | 221 FlushCommandBuffer(); |
| 222 platform_video_decoder_->Destroy(); | 222 platform_video_decoder_->Destroy(); |
| 223 ::ppapi::PPB_VideoDecoder_Shared::Destroy(); | 223 ::ppapi::PPB_VideoDecoder_Shared::Destroy(); |
| 224 platform_video_decoder_ = NULL; | 224 platform_video_decoder_ = NULL; |
| 225 ppp_videodecoder_ = NULL; | 225 ppp_videodecoder_ = NULL; |
| 226 } | 226 } |
| 227 | 227 |
| 228 void PPB_VideoDecoder_Impl::ProvidePictureBuffers( | 228 void PPB_VideoDecoder_Impl::ProvidePictureBuffers( |
| 229 uint32 requested_num_of_buffers, const gfx::Size& dimensions) { | 229 uint32 requested_num_of_buffers, |
| 230 const gfx::Size& dimensions, |
| 231 media::VideoDecodeAccelerator::TextureTarget texture_target) { |
| 230 if (!ppp_videodecoder_) | 232 if (!ppp_videodecoder_) |
| 231 return; | 233 return; |
| 232 | 234 |
| 233 PP_Size out_dim = PP_MakeSize(dimensions.width(), dimensions.height()); | 235 PP_Size out_dim = PP_MakeSize(dimensions.width(), dimensions.height()); |
| 234 ppp_videodecoder_->ProvidePictureBuffers(pp_instance(), pp_resource(), | 236 ppp_videodecoder_->ProvidePictureBuffers(pp_instance(), pp_resource(), |
| 235 requested_num_of_buffers, &out_dim); | 237 requested_num_of_buffers, &out_dim, |
| 238 static_cast<PP_VideoDecoder_TextureTarget_Dev>(texture_target)); |
| 236 } | 239 } |
| 237 | 240 |
| 238 void PPB_VideoDecoder_Impl::PictureReady(const media::Picture& picture) { | 241 void PPB_VideoDecoder_Impl::PictureReady(const media::Picture& picture) { |
| 239 if (!ppp_videodecoder_) | 242 if (!ppp_videodecoder_) |
| 240 return; | 243 return; |
| 241 | 244 |
| 242 PP_Picture_Dev output; | 245 PP_Picture_Dev output; |
| 243 output.picture_buffer_id = picture.picture_buffer_id(); | 246 output.picture_buffer_id = picture.picture_buffer_id(); |
| 244 output.bitstream_buffer_id = picture.bitstream_buffer_id(); | 247 output.bitstream_buffer_id = picture.bitstream_buffer_id(); |
| 245 ppp_videodecoder_->PictureReady(pp_instance(), pp_resource(), &output); | 248 ppp_videodecoder_->PictureReady(pp_instance(), pp_resource(), &output); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 void PPB_VideoDecoder_Impl::NotifyFlushDone() { | 280 void PPB_VideoDecoder_Impl::NotifyFlushDone() { |
| 278 RunFlushCallback(PP_OK); | 281 RunFlushCallback(PP_OK); |
| 279 } | 282 } |
| 280 | 283 |
| 281 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { | 284 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { |
| 282 NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; | 285 NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; |
| 283 } | 286 } |
| 284 | 287 |
| 285 } // namespace ppapi | 288 } // namespace ppapi |
| 286 } // namespace webkit | 289 } // namespace webkit |
| OLD | NEW |