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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
337 int ret_val = ReleaseOnCodecThread(); | 337 int ret_val = ReleaseOnCodecThread(); |
338 if (ret_val < 0) { | 338 if (ret_val < 0) { |
339 ALOGE << "Release failure: " << ret_val << " - fallback to SW codec"; | 339 ALOGE << "Release failure: " << ret_val << " - fallback to SW codec"; |
340 sw_fallback_required_ = true; | 340 sw_fallback_required_ = true; |
341 return WEBRTC_VIDEO_CODEC_ERROR; | 341 return WEBRTC_VIDEO_CODEC_ERROR; |
342 } | 342 } |
343 | 343 |
344 ResetVariables(); | 344 ResetVariables(); |
345 | 345 |
346 if (use_surface_) { | 346 if (use_surface_) { |
347 surface_texture_helper_ = new rtc::RefCountedObject<SurfaceTextureHelper>( | 347 surface_texture_helper_ = SurfaceTextureHelper::create( |
348 jni, "Decoder SurfaceTextureHelper", render_egl_context_); | 348 jni, "Decoder SurfaceTextureHelper", render_egl_context_); |
349 if (!surface_texture_helper_) { | |
AlexG
2016/03/31 23:03:22
Better to fallback to SW codec in this case - byte
magjed_webrtc
2016/05/04 09:51:51
Done.
| |
350 ALOGE << "Couldn't create SurfaceTextureHelper -" | |
351 " falling back to byte buffer output"; | |
352 use_surface_ = false; | |
353 } | |
349 } | 354 } |
350 | 355 |
351 jobject j_video_codec_enum = JavaEnumFromIndexAndClassName( | 356 jobject j_video_codec_enum = JavaEnumFromIndexAndClassName( |
352 jni, "MediaCodecVideoDecoder$VideoCodecType", codecType_); | 357 jni, "MediaCodecVideoDecoder$VideoCodecType", codecType_); |
353 bool success = jni->CallBooleanMethod( | 358 bool success = jni->CallBooleanMethod( |
354 *j_media_codec_video_decoder_, | 359 *j_media_codec_video_decoder_, |
355 j_init_decode_method_, | 360 j_init_decode_method_, |
356 j_video_codec_enum, | 361 j_video_codec_enum, |
357 codec_.width, | 362 codec_.width, |
358 codec_.height, | 363 codec_.height, |
(...skipping 623 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 |