| 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/graphics_3d.h" | 10 #include "ppapi/cpp/graphics_3d.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 void VideoDecoder_Dev::AssignPictureBuffers( | 41 void VideoDecoder_Dev::AssignPictureBuffers( |
| 42 const std::vector<PP_PictureBuffer_Dev>& buffers) { | 42 const std::vector<PP_PictureBuffer_Dev>& buffers) { |
| 43 if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource()) | 43 if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource()) |
| 44 return; | 44 return; |
| 45 get_interface<PPB_VideoDecoder_Dev>()->AssignPictureBuffers( | 45 get_interface<PPB_VideoDecoder_Dev>()->AssignPictureBuffers( |
| 46 pp_resource(), buffers.size(), &buffers[0]); | 46 pp_resource(), buffers.size(), &buffers[0]); |
| 47 } | 47 } |
| 48 | 48 |
| 49 int32_t VideoDecoder_Dev::Decode( | 49 int32_t VideoDecoder_Dev::Decode( |
| 50 const PP_VideoBitstreamBuffer_Dev& bitstream_buffer, | 50 const PP_VideoBitstreamBuffer_Dev& bitstream_buffer, |
| 51 CompletionCallback callback) { | 51 const CompletionCallback& callback) { |
| 52 if (!has_interface<PPB_VideoDecoder_Dev>()) | 52 if (!has_interface<PPB_VideoDecoder_Dev>()) |
| 53 return callback.MayForce(PP_ERROR_NOINTERFACE); | 53 return callback.MayForce(PP_ERROR_NOINTERFACE); |
| 54 return get_interface<PPB_VideoDecoder_Dev>()->Decode( | 54 return get_interface<PPB_VideoDecoder_Dev>()->Decode( |
| 55 pp_resource(), &bitstream_buffer, callback.pp_completion_callback()); | 55 pp_resource(), &bitstream_buffer, callback.pp_completion_callback()); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void VideoDecoder_Dev::ReusePictureBuffer(int32_t picture_buffer_id) { | 58 void VideoDecoder_Dev::ReusePictureBuffer(int32_t picture_buffer_id) { |
| 59 if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource()) | 59 if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource()) |
| 60 return; | 60 return; |
| 61 get_interface<PPB_VideoDecoder_Dev>()->ReusePictureBuffer( | 61 get_interface<PPB_VideoDecoder_Dev>()->ReusePictureBuffer( |
| 62 pp_resource(), picture_buffer_id); | 62 pp_resource(), picture_buffer_id); |
| 63 } | 63 } |
| 64 | 64 |
| 65 int32_t VideoDecoder_Dev::Flush(CompletionCallback callback) { | 65 int32_t VideoDecoder_Dev::Flush(const CompletionCallback& callback) { |
| 66 if (!has_interface<PPB_VideoDecoder_Dev>()) | 66 if (!has_interface<PPB_VideoDecoder_Dev>()) |
| 67 return callback.MayForce(PP_ERROR_NOINTERFACE); | 67 return callback.MayForce(PP_ERROR_NOINTERFACE); |
| 68 return get_interface<PPB_VideoDecoder_Dev>()->Flush( | 68 return get_interface<PPB_VideoDecoder_Dev>()->Flush( |
| 69 pp_resource(), callback.pp_completion_callback()); | 69 pp_resource(), callback.pp_completion_callback()); |
| 70 } | 70 } |
| 71 | 71 |
| 72 int32_t VideoDecoder_Dev::Reset(const CompletionCallback& callback) { | 72 int32_t VideoDecoder_Dev::Reset(const CompletionCallback& callback) { |
| 73 if (!has_interface<PPB_VideoDecoder_Dev>()) | 73 if (!has_interface<PPB_VideoDecoder_Dev>()) |
| 74 return callback.MayForce(PP_ERROR_NOINTERFACE); | 74 return callback.MayForce(PP_ERROR_NOINTERFACE); |
| 75 return get_interface<PPB_VideoDecoder_Dev>()->Reset( | 75 return get_interface<PPB_VideoDecoder_Dev>()->Reset( |
| 76 pp_resource(), callback.pp_completion_callback()); | 76 pp_resource(), callback.pp_completion_callback()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace pp | 79 } // namespace pp |
| OLD | NEW |