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

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

Issue 1840193007: Android: Handle SurfaceTextureHelper ctor failure for decoder and capturer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressing perkj@s comments Created 4 years, 7 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 int ret_val = ReleaseOnCodecThread(); 338 int ret_val = ReleaseOnCodecThread();
339 if (ret_val < 0) { 339 if (ret_val < 0) {
340 ALOGE << "Release failure: " << ret_val << " - fallback to SW codec"; 340 ALOGE << "Release failure: " << ret_val << " - fallback to SW codec";
341 sw_fallback_required_ = true; 341 sw_fallback_required_ = true;
342 return WEBRTC_VIDEO_CODEC_ERROR; 342 return WEBRTC_VIDEO_CODEC_ERROR;
343 } 343 }
344 344
345 ResetVariables(); 345 ResetVariables();
346 346
347 if (use_surface_) { 347 if (use_surface_) {
348 surface_texture_helper_ = new rtc::RefCountedObject<SurfaceTextureHelper>( 348 surface_texture_helper_ = SurfaceTextureHelper::create(
349 jni, "Decoder SurfaceTextureHelper", render_egl_context_); 349 jni, "Decoder SurfaceTextureHelper", render_egl_context_);
350 if (!surface_texture_helper_) {
351 ALOGE << "Couldn't create SurfaceTextureHelper - fallback to SW codec";
352 sw_fallback_required_ = true;
353 return WEBRTC_VIDEO_CODEC_ERROR;
354 }
350 } 355 }
351 356
352 jobject j_video_codec_enum = JavaEnumFromIndexAndClassName( 357 jobject j_video_codec_enum = JavaEnumFromIndexAndClassName(
353 jni, "MediaCodecVideoDecoder$VideoCodecType", codecType_); 358 jni, "MediaCodecVideoDecoder$VideoCodecType", codecType_);
354 bool success = jni->CallBooleanMethod( 359 bool success = jni->CallBooleanMethod(
355 *j_media_codec_video_decoder_, 360 *j_media_codec_video_decoder_,
356 j_init_decode_method_, 361 j_init_decode_method_,
357 j_video_codec_enum, 362 j_video_codec_enum,
358 codec_.width, 363 codec_.width,
359 codec_.height, 364 codec_.height,
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 ALOGD << "Destroy video decoder."; 987 ALOGD << "Destroy video decoder.";
983 delete decoder; 988 delete decoder;
984 } 989 }
985 990
986 const char* MediaCodecVideoDecoder::ImplementationName() const { 991 const char* MediaCodecVideoDecoder::ImplementationName() const {
987 return "MediaCodec"; 992 return "MediaCodec";
988 } 993 }
989 994
990 } // namespace webrtc_jni 995 } // namespace webrtc_jni
991 996
OLDNEW
« no previous file with comments | « webrtc/api/java/android/org/webrtc/VideoCapturerAndroid.java ('k') | webrtc/api/java/jni/androidvideocapturer_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698