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

Side by Side Diff: talk/app/webrtc/java/jni/native_handle_impl.h

Issue 1460703002: Implement AndroidTextureBuffer::NativeToI420. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix comment nits. Created 5 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 const int oes_texture_id; 44 const int oes_texture_id;
45 float sampling_matrix[16]; 45 float sampling_matrix[16];
46 }; 46 };
47 47
48 class AndroidTextureBuffer : public webrtc::NativeHandleBuffer { 48 class AndroidTextureBuffer : public webrtc::NativeHandleBuffer {
49 public: 49 public:
50 AndroidTextureBuffer(int width, 50 AndroidTextureBuffer(int width,
51 int height, 51 int height,
52 const NativeHandleImpl& native_handle, 52 const NativeHandleImpl& native_handle,
53 jobject surface_texture_helper,
53 const rtc::Callback0<void>& no_longer_used); 54 const rtc::Callback0<void>& no_longer_used);
54 ~AndroidTextureBuffer(); 55 ~AndroidTextureBuffer();
55 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; 56 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override;
56 57
57 rtc::scoped_refptr<AndroidTextureBuffer> CropAndScale( 58 rtc::scoped_refptr<AndroidTextureBuffer> CropAndScale(
58 int cropped_input_width, 59 int cropped_input_width,
59 int cropped_input_height, 60 int cropped_input_height,
60 int dst_widht, 61 int dst_widht,
61 int dst_height); 62 int dst_height);
62 63
63 private: 64 private:
64 NativeHandleImpl native_handle_; 65 NativeHandleImpl native_handle_;
66 // Raw object pointer, relying on the caller, i.e.,
67 // AndroidVideoCapturerJni or the C++ SurfaceTextureHelper, to keep
68 // a global reference. TODO(nisse): Make this a reference to the C++
69 // SurfaceTextureHelper instead, but that requires some refactoring
70 // of AndroidVideoCapturerJni.
71 jobject surface_texture_helper_;
65 rtc::Callback0<void> no_longer_used_cb_; 72 rtc::Callback0<void> no_longer_used_cb_;
66 }; 73 };
67 74
68 } // namespace webrtc_jni 75 } // namespace webrtc_jni
69 76
70 #endif // TALK_APP_WEBRTC_JAVA_JNI_NATIVE_HANDLE_IMPL_H_ 77 #endif // TALK_APP_WEBRTC_JAVA_JNI_NATIVE_HANDLE_IMPL_H_
OLDNEW
« no previous file with comments | « talk/app/webrtc/java/jni/androidvideocapturer_jni.cc ('k') | talk/app/webrtc/java/jni/native_handle_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698