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" |
(...skipping 24 matching lines...) Expand all Loading... |
35 } | 35 } |
36 | 36 |
37 VideoDecoder_Dev::~VideoDecoder_Dev() { | 37 VideoDecoder_Dev::~VideoDecoder_Dev() { |
38 } | 38 } |
39 | 39 |
40 void VideoDecoder_Dev::AssignPictureBuffers( | 40 void VideoDecoder_Dev::AssignPictureBuffers( |
41 const std::vector<PP_PictureBuffer_Dev>& buffers) { | 41 const std::vector<PP_PictureBuffer_Dev>& buffers) { |
42 if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource()) | 42 if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource()) |
43 return; | 43 return; |
44 get_interface<PPB_VideoDecoder_Dev>()->AssignPictureBuffers( | 44 get_interface<PPB_VideoDecoder_Dev>()->AssignPictureBuffers( |
45 pp_resource(), buffers.size(), &buffers[0]); | 45 pp_resource(), static_cast<uint32_t>(buffers.size()), &buffers[0]); |
46 } | 46 } |
47 | 47 |
48 int32_t VideoDecoder_Dev::Decode( | 48 int32_t VideoDecoder_Dev::Decode( |
49 const PP_VideoBitstreamBuffer_Dev& bitstream_buffer, | 49 const PP_VideoBitstreamBuffer_Dev& bitstream_buffer, |
50 const CompletionCallback& callback) { | 50 const CompletionCallback& callback) { |
51 if (!has_interface<PPB_VideoDecoder_Dev>()) | 51 if (!has_interface<PPB_VideoDecoder_Dev>()) |
52 return callback.MayForce(PP_ERROR_NOINTERFACE); | 52 return callback.MayForce(PP_ERROR_NOINTERFACE); |
53 return get_interface<PPB_VideoDecoder_Dev>()->Decode( | 53 return get_interface<PPB_VideoDecoder_Dev>()->Decode( |
54 pp_resource(), &bitstream_buffer, callback.pp_completion_callback()); | 54 pp_resource(), &bitstream_buffer, callback.pp_completion_callback()); |
55 } | 55 } |
(...skipping 13 matching lines...) Expand all Loading... |
69 } | 69 } |
70 | 70 |
71 int32_t VideoDecoder_Dev::Reset(const CompletionCallback& callback) { | 71 int32_t VideoDecoder_Dev::Reset(const CompletionCallback& callback) { |
72 if (!has_interface<PPB_VideoDecoder_Dev>()) | 72 if (!has_interface<PPB_VideoDecoder_Dev>()) |
73 return callback.MayForce(PP_ERROR_NOINTERFACE); | 73 return callback.MayForce(PP_ERROR_NOINTERFACE); |
74 return get_interface<PPB_VideoDecoder_Dev>()->Reset( | 74 return get_interface<PPB_VideoDecoder_Dev>()->Reset( |
75 pp_resource(), callback.pp_completion_callback()); | 75 pp_resource(), callback.pp_completion_callback()); |
76 } | 76 } |
77 | 77 |
78 } // namespace pp | 78 } // namespace pp |
OLD | NEW |