| 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 "ppapi/cpp/dev/video_decoder_dev.h" | 5 #include "ppapi/cpp/dev/video_decoder_dev.h" |
| 6 | 6 |
| 7 #include "ppapi/c/dev/ppb_video_decoder_dev.h" | 7 #include "ppapi/c/dev/ppb_video_decoder_dev.h" |
| 8 #include "ppapi/c/dev/ppp_video_decoder_dev.h" | 8 #include "ppapi/c/dev/ppp_video_decoder_dev.h" |
| 9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
| 10 #include "ppapi/cpp/graphics_3d.h" | 10 #include "ppapi/cpp/graphics_3d.h" |
| 11 #include "ppapi/cpp/instance_handle.h" | 11 #include "ppapi/cpp/instance_handle.h" |
| 12 #include "ppapi/cpp/module.h" | 12 #include "ppapi/cpp/module.h" |
| 13 #include "ppapi/cpp/module_impl.h" | 13 #include "ppapi/cpp/module_impl.h" |
| 14 | 14 |
| 15 namespace pp { | 15 namespace pp { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 template <> const char* interface_name<PPB_VideoDecoder_Dev>() { | 19 template <> const char* interface_name<PPB_VideoDecoder_Dev>() { |
| 20 return PPB_VIDEODECODER_DEV_INTERFACE; | 20 return PPB_VIDEODECODER_DEV_INTERFACE; |
| 21 } | 21 } |
| 22 | 22 |
| 23 } // namespace | 23 } // namespace |
| 24 | 24 |
| 25 VideoDecoder_Dev::VideoDecoder_Dev(const InstanceHandle& instance, | 25 VideoDecoder_Dev::VideoDecoder_Dev(const InstanceHandle& instance, |
| 26 const Graphics3D& context, | 26 const Graphics3D& context, |
| 27 PP_VideoDecoder_Profile profile) { | 27 PP_VideoDecoder_Profile profile, |
| 28 const PP_Size& frame_size, |
| 29 const std::vector<uint8_t>& extra_data) { |
| 28 if (!has_interface<PPB_VideoDecoder_Dev>()) | 30 if (!has_interface<PPB_VideoDecoder_Dev>()) |
| 29 return; | 31 return; |
| 30 PassRefFromConstructor(get_interface<PPB_VideoDecoder_Dev>()->Create( | 32 PassRefFromConstructor(get_interface<PPB_VideoDecoder_Dev>()->Create( |
| 31 instance.pp_instance(), context.pp_resource(), profile)); | 33 instance.pp_instance(), context.pp_resource(), profile, &frame_size, |
| 34 extra_data.empty() ? NULL : &extra_data[0], extra_data.size())); |
| 32 } | 35 } |
| 33 | 36 |
| 34 VideoDecoder_Dev::VideoDecoder_Dev(PP_Resource resource) : Resource(resource) { | 37 VideoDecoder_Dev::VideoDecoder_Dev(PP_Resource resource) : Resource(resource) { |
| 35 } | 38 } |
| 36 | 39 |
| 37 VideoDecoder_Dev::~VideoDecoder_Dev() { | 40 VideoDecoder_Dev::~VideoDecoder_Dev() { |
| 38 get_interface<PPB_VideoDecoder_Dev>()->Destroy(pp_resource()); | 41 get_interface<PPB_VideoDecoder_Dev>()->Destroy(pp_resource()); |
| 39 } | 42 } |
| 40 | 43 |
| 41 void VideoDecoder_Dev::AssignPictureBuffers( | 44 void VideoDecoder_Dev::AssignPictureBuffers( |
| (...skipping 28 matching lines...) Expand all Loading... |
| 70 } | 73 } |
| 71 | 74 |
| 72 int32_t VideoDecoder_Dev::Reset(const CompletionCallback& callback) { | 75 int32_t VideoDecoder_Dev::Reset(const CompletionCallback& callback) { |
| 73 if (!has_interface<PPB_VideoDecoder_Dev>()) | 76 if (!has_interface<PPB_VideoDecoder_Dev>()) |
| 74 return callback.MayForce(PP_ERROR_NOINTERFACE); | 77 return callback.MayForce(PP_ERROR_NOINTERFACE); |
| 75 return get_interface<PPB_VideoDecoder_Dev>()->Reset( | 78 return get_interface<PPB_VideoDecoder_Dev>()->Reset( |
| 76 pp_resource(), callback.pp_completion_callback()); | 79 pp_resource(), callback.pp_completion_callback()); |
| 77 } | 80 } |
| 78 | 81 |
| 79 } // namespace pp | 82 } // namespace pp |
| OLD | NEW |