Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: webrtc/api/java/jni/native_handle_impl.h

Issue 1973873003: Delete AndroidVideoCapturer::FrameFactory. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Undo unrelated/unneeded changes. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..0d0153281eac1480a5dd07190cc117b6d976d5d1 100644
--- a/webrtc/api/java/jni/native_handle_impl.h
+++ b/webrtc/api/java/jni/native_handle_impl.h
@@ -18,14 +18,37 @@
namespace webrtc_jni {
+// Open gl texture matrix, in column-major order. Operations are
+// in-place.
+class Matrix {
+ public:
+ Matrix(JNIEnv* jni, jfloatArray a);
+
+ jfloatArray ToJava(JNIEnv* jni);
+
+ // 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);
+
+ private:
+ static void Multiply(const float a[16], const float b[16], float result[16]);
+ float elem_[16];
+};
+
// Wrapper for texture object.
struct NativeHandleImpl {
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;
};
class AndroidTextureBuffer : public webrtc::NativeHandleBuffer {
@@ -42,6 +65,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);

Powered by Google App Engine
This is Rietveld 408576698