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

Side by Side Diff: webrtc/api/java/jni/androidmediaencoder_jni.cc

Issue 1707933003: Change PeerConnectionFactory.setVideoHwAccelerationOptions to be able to replace Egl context. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 months 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 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 ALOGD << "MediaCodecVideoEncoderFactory dtor"; 1206 ALOGD << "MediaCodecVideoEncoderFactory dtor";
1207 if (egl_context_) { 1207 if (egl_context_) {
1208 JNIEnv* jni = AttachCurrentThreadIfNeeded(); 1208 JNIEnv* jni = AttachCurrentThreadIfNeeded();
1209 jni->DeleteGlobalRef(egl_context_); 1209 jni->DeleteGlobalRef(egl_context_);
1210 } 1210 }
1211 } 1211 }
1212 1212
1213 void MediaCodecVideoEncoderFactory::SetEGLContext( 1213 void MediaCodecVideoEncoderFactory::SetEGLContext(
1214 JNIEnv* jni, jobject egl_context) { 1214 JNIEnv* jni, jobject egl_context) {
1215 ALOGD << "MediaCodecVideoEncoderFactory::SetEGLContext"; 1215 ALOGD << "MediaCodecVideoEncoderFactory::SetEGLContext";
1216 RTC_DCHECK(!egl_context_); 1216 if (egl_context_) {
1217 jni->DeleteGlobalRef(egl_context_);
1218 egl_context_ = nullptr;
1219 }
1217 egl_context_ = jni->NewGlobalRef(egl_context); 1220 egl_context_ = jni->NewGlobalRef(egl_context);
1218 if (CheckException(jni)) { 1221 if (CheckException(jni)) {
1219 ALOGE << "error calling NewGlobalRef for EGL Context."; 1222 ALOGE << "error calling NewGlobalRef for EGL Context.";
1220 } 1223 }
1221 } 1224 }
1222 1225
1223 webrtc::VideoEncoder* MediaCodecVideoEncoderFactory::CreateVideoEncoder( 1226 webrtc::VideoEncoder* MediaCodecVideoEncoderFactory::CreateVideoEncoder(
1224 VideoCodecType type) { 1227 VideoCodecType type) {
1225 if (supported_codecs_.empty()) { 1228 if (supported_codecs_.empty()) {
1226 ALOGW << "No HW video encoder for type " << (int)type; 1229 ALOGW << "No HW video encoder for type " << (int)type;
(...skipping 18 matching lines...) Expand all
1245 } 1248 }
1246 1249
1247 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( 1250 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder(
1248 webrtc::VideoEncoder* encoder) { 1251 webrtc::VideoEncoder* encoder) {
1249 ALOGD << "Destroy video encoder."; 1252 ALOGD << "Destroy video encoder.";
1250 delete encoder; 1253 delete encoder;
1251 } 1254 }
1252 1255
1253 } // namespace webrtc_jni 1256 } // namespace webrtc_jni
1254 1257
OLDNEW
« no previous file with comments | « webrtc/api/java/jni/androidmediadecoder_jni.cc ('k') | webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698