| 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 "ppapi/cpp/dev/video_decoder_client_dev.h" | 5 #include "ppapi/cpp/dev/video_decoder_client_dev.h" |
| 6 | 6 |
| 7 #include "ppapi/c/dev/ppp_video_decoder_dev.h" | 7 #include "ppapi/c/dev/ppp_video_decoder_dev.h" |
| 8 #include "ppapi/cpp/dev/video_decoder_dev.h" | 8 #include "ppapi/cpp/dev/video_decoder_dev.h" |
| 9 #include "ppapi/cpp/instance.h" | 9 #include "ppapi/cpp/instance.h" |
| 10 #include "ppapi/cpp/module.h" | 10 #include "ppapi/cpp/module.h" |
| 11 #include "ppapi/cpp/module_impl.h" | 11 #include "ppapi/cpp/module_impl.h" |
| 12 | 12 |
| 13 namespace pp { | 13 namespace pp { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 const char kPPPVideoDecoderInterface[] = PPP_VIDEODECODER_DEV_INTERFACE; | 17 const char kPPPVideoDecoderInterface[] = PPP_VIDEODECODER_DEV_INTERFACE; |
| 18 | 18 |
| 19 // Callback to provide buffers for the decoded output pictures. | 19 // Callback to provide buffers for the decoded output pictures. |
| 20 void ProvidePictureBuffers(PP_Instance instance, | 20 void ProvidePictureBuffers(PP_Instance instance, |
| 21 uint32_t req_num_of_bufs, | 21 uint32_t req_num_of_bufs, |
| 22 struct PP_Size dimensions, | 22 struct PP_Size dimensions) { |
| 23 enum PP_PictureBufferType_Dev type) { | |
| 24 void* object = pp::Instance::GetPerInstanceObject( | 23 void* object = pp::Instance::GetPerInstanceObject( |
| 25 instance, kPPPVideoDecoderInterface); | 24 instance, kPPPVideoDecoderInterface); |
| 26 if (!object) | 25 if (!object) |
| 27 return; | 26 return; |
| 28 static_cast<VideoDecoderClient_Dev*>(object)->ProvidePictureBuffers( | 27 static_cast<VideoDecoderClient_Dev*>(object)->ProvidePictureBuffers( |
| 29 req_num_of_bufs, dimensions, type); | 28 req_num_of_bufs, dimensions); |
| 30 } | 29 } |
| 31 | 30 |
| 32 void DismissPictureBuffer(PP_Instance instance, | 31 void DismissPictureBuffer(PP_Instance instance, |
| 33 int32_t picture_buffer_id) { | 32 int32_t picture_buffer_id) { |
| 34 void* object = pp::Instance::GetPerInstanceObject( | 33 void* object = pp::Instance::GetPerInstanceObject( |
| 35 instance, kPPPVideoDecoderInterface); | 34 instance, kPPPVideoDecoderInterface); |
| 36 if (!object) | 35 if (!object) |
| 37 return; | 36 return; |
| 38 static_cast<VideoDecoderClient_Dev*>(object)->DismissPictureBuffer( | 37 static_cast<VideoDecoderClient_Dev*>(object)->DismissPictureBuffer( |
| 39 picture_buffer_id); | 38 picture_buffer_id); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 associated_instance_->AddPerInstanceObject( | 79 associated_instance_->AddPerInstanceObject( |
| 81 kPPPVideoDecoderInterface, this); | 80 kPPPVideoDecoderInterface, this); |
| 82 } | 81 } |
| 83 | 82 |
| 84 VideoDecoderClient_Dev::~VideoDecoderClient_Dev() { | 83 VideoDecoderClient_Dev::~VideoDecoderClient_Dev() { |
| 85 associated_instance_->RemovePerInstanceObject( | 84 associated_instance_->RemovePerInstanceObject( |
| 86 kPPPVideoDecoderInterface, this); | 85 kPPPVideoDecoderInterface, this); |
| 87 } | 86 } |
| 88 | 87 |
| 89 } // namespace pp | 88 } // namespace pp |
| OLD | NEW |