| 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_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/dev/context_3d_dev.h" | 10 #include "ppapi/cpp/dev/context_3d_dev.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 VideoDecoder_Dev::VideoDecoder_Dev(PP_Resource resource) : Resource(resource) { | 32 VideoDecoder_Dev::VideoDecoder_Dev(PP_Resource resource) : Resource(resource) { |
| 33 } | 33 } |
| 34 | 34 |
| 35 VideoDecoder_Dev::~VideoDecoder_Dev() { | 35 VideoDecoder_Dev::~VideoDecoder_Dev() { |
| 36 get_interface<PPB_VideoDecoder_Dev>()->Destroy(pp_resource()); | 36 get_interface<PPB_VideoDecoder_Dev>()->Destroy(pp_resource()); |
| 37 } | 37 } |
| 38 | 38 |
| 39 | 39 |
| 40 int32_t VideoDecoder_Dev::Initialize(const PP_VideoConfigElement* config, | 40 int32_t VideoDecoder_Dev::Initialize(const PP_VideoConfigElement* config, |
| 41 const Context3D_Dev& context, | 41 const Context3D_Dev& context) { |
| 42 CompletionCallback callback) { | |
| 43 if (!has_interface<PPB_VideoDecoder_Dev>()) | 42 if (!has_interface<PPB_VideoDecoder_Dev>()) |
| 44 return callback.MayForce(PP_ERROR_NOINTERFACE); | 43 return PP_ERROR_NOINTERFACE; |
| 45 return get_interface<PPB_VideoDecoder_Dev>()->Initialize( | 44 return get_interface<PPB_VideoDecoder_Dev>()->Initialize( |
| 46 pp_resource(), context.pp_resource(), config, | 45 pp_resource(), context.pp_resource(), config); |
| 47 callback.pp_completion_callback()); | |
| 48 } | 46 } |
| 49 | 47 |
| 50 void VideoDecoder_Dev::AssignPictureBuffers( | 48 void VideoDecoder_Dev::AssignPictureBuffers( |
| 51 const std::vector<PP_PictureBuffer_Dev>& buffers) { | 49 const std::vector<PP_PictureBuffer_Dev>& buffers) { |
| 52 if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource()) | 50 if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource()) |
| 53 return; | 51 return; |
| 54 get_interface<PPB_VideoDecoder_Dev>()->AssignPictureBuffers( | 52 get_interface<PPB_VideoDecoder_Dev>()->AssignPictureBuffers( |
| 55 pp_resource(), buffers.size(), &buffers[0]); | 53 pp_resource(), buffers.size(), &buffers[0]); |
| 56 } | 54 } |
| 57 | 55 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 79 } | 77 } |
| 80 | 78 |
| 81 int32_t VideoDecoder_Dev::Reset(CompletionCallback callback) { | 79 int32_t VideoDecoder_Dev::Reset(CompletionCallback callback) { |
| 82 if (!has_interface<PPB_VideoDecoder_Dev>()) | 80 if (!has_interface<PPB_VideoDecoder_Dev>()) |
| 83 return callback.MayForce(PP_ERROR_NOINTERFACE); | 81 return callback.MayForce(PP_ERROR_NOINTERFACE); |
| 84 return get_interface<PPB_VideoDecoder_Dev>()->Reset( | 82 return get_interface<PPB_VideoDecoder_Dev>()->Reset( |
| 85 pp_resource(), callback.pp_completion_callback()); | 83 pp_resource(), callback.pp_completion_callback()); |
| 86 } | 84 } |
| 87 | 85 |
| 88 } // namespace pp | 86 } // namespace pp |
| OLD | NEW |