| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/video_encoder.h" | 5 #include "ppapi/cpp/video_encoder.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
| 8 #include "ppapi/c/ppb_video_encoder.h" | 8 #include "ppapi/c/ppb_video_encoder.h" |
| 9 #include "ppapi/cpp/completion_callback.h" | 9 #include "ppapi/cpp/completion_callback.h" |
| 10 #include "ppapi/cpp/instance_handle.h" | 10 #include "ppapi/cpp/instance_handle.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 if (has_interface<PPB_VideoEncoder_0_1>()) { | 29 if (has_interface<PPB_VideoEncoder_0_1>()) { |
| 30 PassRefFromConstructor( | 30 PassRefFromConstructor( |
| 31 get_interface<PPB_VideoEncoder_0_1>()->Create(instance.pp_instance())); | 31 get_interface<PPB_VideoEncoder_0_1>()->Create(instance.pp_instance())); |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 | 34 |
| 35 VideoEncoder::VideoEncoder(const VideoEncoder& other) : Resource(other) { | 35 VideoEncoder::VideoEncoder(const VideoEncoder& other) : Resource(other) { |
| 36 } | 36 } |
| 37 | 37 |
| 38 int32_t VideoEncoder::GetSupportedProfiles(const CompletionCallbackWithOutput< | 38 int32_t VideoEncoder::GetSupportedProfiles(const CompletionCallbackWithOutput< |
| 39 std::vector<PP_VideoProfileDescription>>& cc) { | 39 std::vector<PP_VideoProfileDescription> >& cc) { |
| 40 if (has_interface<PPB_VideoEncoder_0_1>()) { | 40 if (has_interface<PPB_VideoEncoder_0_1>()) { |
| 41 return get_interface<PPB_VideoEncoder_0_1>()->GetSupportedProfiles( | 41 return get_interface<PPB_VideoEncoder_0_1>()->GetSupportedProfiles( |
| 42 pp_resource(), cc.output(), cc.pp_completion_callback()); | 42 pp_resource(), cc.output(), cc.pp_completion_callback()); |
| 43 } | 43 } |
| 44 return cc.MayForce(PP_ERROR_NOINTERFACE); | 44 return cc.MayForce(PP_ERROR_NOINTERFACE); |
| 45 } | 45 } |
| 46 | 46 |
| 47 int32_t VideoEncoder::Initialize(const PP_VideoFrame_Format& input_format, | 47 int32_t VideoEncoder::Initialize(const PP_VideoFrame_Format& input_format, |
| 48 const PP_Size& input_visible_size, | 48 const PP_Size& input_visible_size, |
| 49 const PP_VideoProfile& output_profile, | 49 const PP_VideoProfile& output_profile, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 void VideoEncoder::Close() { | 122 void VideoEncoder::Close() { |
| 123 if (has_interface<PPB_VideoEncoder_0_1>()) { | 123 if (has_interface<PPB_VideoEncoder_0_1>()) { |
| 124 get_interface<PPB_VideoEncoder_0_1>()->Close(pp_resource()); | 124 get_interface<PPB_VideoEncoder_0_1>()->Close(pp_resource()); |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace pp | 128 } // namespace pp |
| OLD | NEW |