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

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

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/native_handle_impl.h ('k') | talk/app/webrtc/java/jni/peerconnection_jni.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.cc
diff --git a/talk/app/webrtc/java/jni/native_handle_impl.cc b/talk/app/webrtc/java/jni/native_handle_impl.cc
index ed9ad8e8918ad1d6e5adb21c42fbb30c82960802..ac3e0455df876b4a68d6afa6d6d46a52edabddd1 100644
--- a/talk/app/webrtc/java/jni/native_handle_impl.cc
+++ b/talk/app/webrtc/java/jni/native_handle_impl.cc
@@ -31,9 +31,9 @@
namespace webrtc_jni {
-NativeHandleImpl::NativeHandleImpl(JNIEnv* jni,
- jint j_oes_texture_id,
- jfloatArray j_transform_matrix)
+NativeTextureHandleImpl::NativeTextureHandleImpl(JNIEnv* jni,
+ jint j_oes_texture_id,
+ jfloatArray j_transform_matrix)
: oes_texture_id(j_oes_texture_id) {
RTC_CHECK_EQ(16, jni->GetArrayLength(j_transform_matrix));
jfloat* transform_matrix_ptr =
@@ -44,10 +44,38 @@ NativeHandleImpl::NativeHandleImpl(JNIEnv* jni,
jni->ReleaseFloatArrayElements(j_transform_matrix, transform_matrix_ptr, 0);
}
+NativeHandleImpl::NativeHandleImpl() : texture_object_(NULL), texture_id_(-1) {}
+
+void* NativeHandleImpl::GetHandle() {
+ return texture_object_;
+}
+
+int NativeHandleImpl::GetTextureId() {
+ return texture_id_;
+}
+
+void NativeHandleImpl::SetTextureObject(void* texture_object, int texture_id) {
+ texture_object_ = reinterpret_cast<jobject>(texture_object);
+ texture_id_ = texture_id;
+}
+
+JniNativeHandleBuffer::JniNativeHandleBuffer(void* native_handle,
+ int width,
+ int height)
+ : NativeHandleBuffer(native_handle, width, height) {}
+
+rtc::scoped_refptr<webrtc::VideoFrameBuffer>
+JniNativeHandleBuffer::NativeToI420Buffer() {
+ // TODO(pbos): Implement before using this in the encoder pipeline (or
+ // remove the RTC_CHECK() in VideoCapture).
+ RTC_NOTREACHED();
+ return nullptr;
+}
+
AndroidTextureBuffer::AndroidTextureBuffer(
int width,
int height,
- const NativeHandleImpl& native_handle,
+ const NativeTextureHandleImpl& native_handle,
const rtc::Callback0<void>& no_longer_used)
: webrtc::NativeHandleBuffer(&native_handle_, width, height),
native_handle_(native_handle),
« no previous file with comments | « talk/app/webrtc/java/jni/native_handle_impl.h ('k') | talk/app/webrtc/java/jni/peerconnection_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698