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

Side by Side Diff: talk/app/webrtc/java/jni/surfacetexturehelper_jni.cc

Issue 1422963003: Android MediaCodecVideoDecoder: Manage lifetime of texture frames (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 void SurfaceTextureHelper::ReturnTextureFrame() const { 61 void SurfaceTextureHelper::ReturnTextureFrame() const {
62 JNIEnv* jni = AttachCurrentThreadIfNeeded(); 62 JNIEnv* jni = AttachCurrentThreadIfNeeded();
63 jni->CallVoidMethod(*j_surface_texture_helper_, j_return_texture_method_); 63 jni->CallVoidMethod(*j_surface_texture_helper_, j_return_texture_method_);
64 64
65 CHECK_EXCEPTION( 65 CHECK_EXCEPTION(
66 jni) << "error during SurfaceTextureHelper.returnTextureFrame"; 66 jni) << "error during SurfaceTextureHelper.returnTextureFrame";
67 } 67 }
68 68
69 rtc::scoped_refptr<webrtc::VideoFrameBuffer> 69 rtc::scoped_refptr<webrtc::VideoFrameBuffer>
70 SurfaceTextureHelper::CreateTextureFrame(int width, int height, 70 SurfaceTextureHelper::CreateTextureFrame(int width, int height,
71 const NativeTextureHandleImpl& native_handle) { 71 const NativeHandleImpl& native_handle) {
72 return new rtc::RefCountedObject<AndroidTextureBuffer>( 72 return new rtc::RefCountedObject<AndroidTextureBuffer>(
73 width, height, native_handle, 73 width, height, native_handle,
74 rtc::Bind(&SurfaceTextureHelper::ReturnTextureFrame, this)); 74 rtc::Bind(&SurfaceTextureHelper::ReturnTextureFrame, this));
75 } 75 }
76 76
77 } // namespace webrtc_jni 77 } // namespace webrtc_jni
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698