Chromium Code Reviews| Index: webrtc/api/java/jni/native_handle_impl.h |
| diff --git a/webrtc/api/java/jni/native_handle_impl.h b/webrtc/api/java/jni/native_handle_impl.h |
| index b781815718dfd89f2d175060b3ef69a4b4e88e7e..cd2fc9e0532785c3fdd0b5012f0bfde079334f66 100644 |
| --- a/webrtc/api/java/jni/native_handle_impl.h |
| +++ b/webrtc/api/java/jni/native_handle_impl.h |
| @@ -20,12 +20,37 @@ namespace webrtc_jni { |
| // Wrapper for texture object. |
| struct NativeHandleImpl { |
| + // Open gl textre matrix, in column-major order. Operations are |
| + // in-place. |
| + struct Matrix { |
|
magjed_webrtc
2016/05/18 11:41:59
struct's are not allowed to have complex methods.
nisse-webrtc
2016/05/18 12:17:52
I'll make it a class, then. Can it still use the n
|
| + float elem[16]; |
| + // Crop arguments are relative to original size. |
| + void Crop(float cropped_width, |
| + float cropped_height, |
| + float crop_x, |
| + float crop_y); |
| + |
| + void Rotate(webrtc::VideoRotation rotation); |
| + static void Multiply(const Matrix& a, const Matrix& b, Matrix* result); |
| + }; |
| + |
| NativeHandleImpl(JNIEnv* jni, |
| jint j_oes_texture_id, |
| jfloatArray j_transform_matrix); |
| + NativeHandleImpl(int id, const Matrix& matrix); |
| + |
| const int oes_texture_id; |
| - float sampling_matrix[16]; |
| + Matrix sampling_matrix; |
| + |
| + NativeHandleImpl Crop( |
|
magjed_webrtc
2016/05/18 11:41:59
Do we really need Crop and Rotate for NativeHandle
nisse-webrtc
2016/05/18 12:17:52
No, these are leftovers and should be deleted.
|
| + // Relative to original size. |
| + float cropped_width, |
| + float cropped_height, |
| + float crop_x, |
| + float crop_y) const; |
| + |
| + NativeHandleImpl Rotate(webrtc::VideoRotation rotation) const; |
| }; |
| class AndroidTextureBuffer : public webrtc::NativeHandleBuffer { |
| @@ -42,6 +67,8 @@ class AndroidTextureBuffer : public webrtc::NativeHandleBuffer { |
| rtc::scoped_refptr<AndroidTextureBuffer> CropScaleAndRotate( |
| int cropped_width, |
| int cropped_height, |
| + int crop_x, |
| + int crop_y, |
| int dst_width, |
| int dst_height, |
| webrtc::VideoRotation rotation); |