Implement NativeToI420Buffer in C++, calling java SurfaceTextureHelper, new method .textureToYUV, to

do the conversion using an opengl fragment shader.

BUG=webrtc:4993

Review URL: https://codereview.webrtc.org/1460703002

Cr-Commit-Position: refs/heads/master@{#10972}
This commit is contained in:
nisse
2015-12-10 06:23:33 -08:00
committed by Commit bot
parent b8b6fbb7a5
commit c490e01bd1
10 changed files with 432 additions and 22 deletions

View File

@ -50,6 +50,7 @@ class AndroidTextureBuffer : public webrtc::NativeHandleBuffer {
AndroidTextureBuffer(int width,
int height,
const NativeHandleImpl& native_handle,
jobject surface_texture_helper,
const rtc::Callback0<void>& no_longer_used);
~AndroidTextureBuffer();
rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override;
@ -62,6 +63,12 @@ class AndroidTextureBuffer : public webrtc::NativeHandleBuffer {
private:
NativeHandleImpl native_handle_;
// Raw object pointer, relying on the caller, i.e.,
// AndroidVideoCapturerJni or the C++ SurfaceTextureHelper, to keep
// a global reference. TODO(nisse): Make this a reference to the C++
// SurfaceTextureHelper instead, but that requires some refactoring
// of AndroidVideoCapturerJni.
jobject surface_texture_helper_;
rtc::Callback0<void> no_longer_used_cb_;
};