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

Unified Diff: talk/app/webrtc/java/jni/native_handle_impl.h

Issue 1441363002: Revert of Android MediaCodecVideoDecoder: Manage lifetime of texture frames (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Manual revert. Created 5 years, 1 month 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
« no previous file with comments | « talk/app/webrtc/java/jni/classreferenceholder.cc ('k') | talk/app/webrtc/java/jni/native_handle_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/java/jni/native_handle_impl.h
diff --git a/talk/app/webrtc/java/jni/native_handle_impl.h b/talk/app/webrtc/java/jni/native_handle_impl.h
index 16d3d7cdde5e5300eb521c9727beaedda5c16048..dd04bc20b131833b376ca8828255e6fafcc38a9e 100644
--- a/talk/app/webrtc/java/jni/native_handle_impl.h
+++ b/talk/app/webrtc/java/jni/native_handle_impl.h
@@ -36,26 +36,51 @@
namespace webrtc_jni {
// Wrapper for texture object.
-struct NativeHandleImpl {
- NativeHandleImpl(JNIEnv* jni,
- jint j_oes_texture_id,
- jfloatArray j_transform_matrix);
+struct NativeTextureHandleImpl {
+ NativeTextureHandleImpl(JNIEnv* jni,
+ jint j_oes_texture_id,
+ jfloatArray j_transform_matrix);
const int oes_texture_id;
float sampling_matrix[16];
};
+// Native handle for SurfaceTexture + texture id.
+class NativeHandleImpl {
+ public:
+ NativeHandleImpl();
+
+ void* GetHandle();
+ int GetTextureId();
+ void SetTextureObject(void* texture_object, int texture_id);
+
+ private:
+ jobject texture_object_;
+ int32_t texture_id_;
+};
+
+class JniNativeHandleBuffer : public webrtc::NativeHandleBuffer {
+ public:
+ JniNativeHandleBuffer(void* native_handle, int width, int height);
+
+ // TODO(pbos): Override destructor to release native handle, at the moment the
+ // native handle is not released based on refcount.
+
+ private:
+ rtc::scoped_refptr<webrtc::VideoFrameBuffer> NativeToI420Buffer() override;
+};
+
class AndroidTextureBuffer : public webrtc::NativeHandleBuffer {
public:
AndroidTextureBuffer(int width,
int height,
- const NativeHandleImpl& native_handle,
+ const NativeTextureHandleImpl& native_handle,
const rtc::Callback0<void>& no_longer_used);
~AndroidTextureBuffer();
rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override;
private:
- NativeHandleImpl native_handle_;
+ NativeTextureHandleImpl native_handle_;
rtc::Callback0<void> no_longer_used_cb_;
};
« no previous file with comments | « talk/app/webrtc/java/jni/classreferenceholder.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