OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |