Chromium Code Reviews| Index: talk/app/webrtc/java/jni/native_handle_impl.cc |
| diff --git a/talk/app/webrtc/java/jni/native_handle_impl.cc b/talk/app/webrtc/java/jni/native_handle_impl.cc |
| index ed9ad8e8918ad1d6e5adb21c42fbb30c82960802..1ddb0851666f35da01848638300d59f2be8d25bb 100644 |
| --- a/talk/app/webrtc/java/jni/native_handle_impl.cc |
| +++ b/talk/app/webrtc/java/jni/native_handle_impl.cc |
| @@ -28,9 +28,17 @@ |
| #include "talk/app/webrtc/java/jni/native_handle_impl.h" |
| #include "webrtc/base/checks.h" |
| +#include "webrtc/base/bind.h" |
| + |
| +using rtc::scoped_refptr; |
| +using webrtc::NativeHandleBuffer; |
| namespace webrtc_jni { |
| +namespace { |
| +void ScaledFrameNotInUse(scoped_refptr<NativeHandleBuffer> original) {} |
|
magjed_webrtc
2015/11/25 13:38:28
I have seen this dummy function being added a hund
perkj_webrtc
2015/11/25 20:56:20
ok- but I would like to do that in a separate cl.
|
| +} // anonymous namespace |
| + |
| NativeHandleImpl::NativeHandleImpl(JNIEnv* jni, |
| jint j_oes_texture_id, |
| jfloatArray j_transform_matrix) |
| @@ -64,4 +72,19 @@ AndroidTextureBuffer::NativeToI420Buffer() { |
| return nullptr; |
| } |
| +rtc::scoped_refptr<AndroidTextureBuffer> AndroidTextureBuffer::CropAndScale( |
| + int cropped_input_width, |
| + int cropped_input_height, |
| + int dst_widht, |
| + int dst_height) { |
| + // TODO(perkj) Implement cropping. |
| + // Here we use Bind magic to add a reference count to |this| until the newly |
| + // created AndroidTextureBuffer is destructed. ScaledFrameNotInUse will be |
| + // called that happens and when it finishes, the reference count to |this| |
| + // will be decreased by one. |
| + return new rtc::RefCountedObject<AndroidTextureBuffer>( |
| + dst_widht, dst_height, native_handle_, |
| + rtc::Bind(&ScaledFrameNotInUse, this)); |
| +} |
| + |
| } // namespace webrtc_jni |