OLD | NEW |
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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 codec_thread_->SetName("MediaCodecVideoEncoder", NULL); | 271 codec_thread_->SetName("MediaCodecVideoEncoder", NULL); |
272 RTC_CHECK(codec_thread_->Start()) << "Failed to start MediaCodecVideoEncoder"; | 272 RTC_CHECK(codec_thread_->Start()) << "Failed to start MediaCodecVideoEncoder"; |
273 codec_thread_checker_.DetachFromThread(); | 273 codec_thread_checker_.DetachFromThread(); |
274 jclass j_output_buffer_info_class = | 274 jclass j_output_buffer_info_class = |
275 FindClass(jni, "org/webrtc/MediaCodecVideoEncoder$OutputBufferInfo"); | 275 FindClass(jni, "org/webrtc/MediaCodecVideoEncoder$OutputBufferInfo"); |
276 j_init_encode_method_ = GetMethodID( | 276 j_init_encode_method_ = GetMethodID( |
277 jni, | 277 jni, |
278 *j_media_codec_video_encoder_class_, | 278 *j_media_codec_video_encoder_class_, |
279 "initEncode", | 279 "initEncode", |
280 "(Lorg/webrtc/MediaCodecVideoEncoder$VideoCodecType;" | 280 "(Lorg/webrtc/MediaCodecVideoEncoder$VideoCodecType;" |
281 "IIIILorg/webrtc/EglBase$Context;)Z"); | 281 "IIIILorg/webrtc/EglBase14$Context;)Z"); |
282 j_get_input_buffers_method_ = GetMethodID( | 282 j_get_input_buffers_method_ = GetMethodID( |
283 jni, | 283 jni, |
284 *j_media_codec_video_encoder_class_, | 284 *j_media_codec_video_encoder_class_, |
285 "getInputBuffers", | 285 "getInputBuffers", |
286 "()[Ljava/nio/ByteBuffer;"); | 286 "()[Ljava/nio/ByteBuffer;"); |
287 j_dequeue_input_buffer_method_ = GetMethodID( | 287 j_dequeue_input_buffer_method_ = GetMethodID( |
288 jni, *j_media_codec_video_encoder_class_, "dequeueInputBuffer", "()I"); | 288 jni, *j_media_codec_video_encoder_class_, "dequeueInputBuffer", "()I"); |
289 j_encode_buffer_method_ = GetMethodID( | 289 j_encode_buffer_method_ = GetMethodID( |
290 jni, *j_media_codec_video_encoder_class_, "encodeBuffer", "(ZIIJ)Z"); | 290 jni, *j_media_codec_video_encoder_class_, "encodeBuffer", "(ZIIJ)Z"); |
291 j_encode_texture_method_ = GetMethodID( | 291 j_encode_texture_method_ = GetMethodID( |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 jni->DeleteGlobalRef(egl_context_); | 1115 jni->DeleteGlobalRef(egl_context_); |
1116 egl_context_ = NULL; | 1116 egl_context_ = NULL; |
1117 } | 1117 } |
1118 if (!IsNull(jni, render_egl_context)) { | 1118 if (!IsNull(jni, render_egl_context)) { |
1119 egl_context_ = jni->NewGlobalRef(render_egl_context); | 1119 egl_context_ = jni->NewGlobalRef(render_egl_context); |
1120 if (CheckException(jni)) { | 1120 if (CheckException(jni)) { |
1121 ALOGE << "error calling NewGlobalRef for EGL Context."; | 1121 ALOGE << "error calling NewGlobalRef for EGL Context."; |
1122 egl_context_ = NULL; | 1122 egl_context_ = NULL; |
1123 } else { | 1123 } else { |
1124 jclass j_egl_context_class = | 1124 jclass j_egl_context_class = |
1125 FindClass(jni, "org/webrtc/EglBase$Context"); | 1125 FindClass(jni, "org/webrtc/EglBase14$Context"); |
1126 if (!jni->IsInstanceOf(egl_context_, j_egl_context_class)) { | 1126 if (!jni->IsInstanceOf(egl_context_, j_egl_context_class)) { |
1127 ALOGE << "Wrong EGL Context."; | 1127 ALOGE << "Wrong EGL Context."; |
1128 jni->DeleteGlobalRef(egl_context_); | 1128 jni->DeleteGlobalRef(egl_context_); |
1129 egl_context_ = NULL; | 1129 egl_context_ = NULL; |
1130 } | 1130 } |
1131 } | 1131 } |
1132 } | 1132 } |
1133 if (egl_context_ == NULL) { | 1133 if (egl_context_ == NULL) { |
1134 ALOGW << "NULL VideoDecoder EGL context - HW surface encoding is disabled."; | 1134 ALOGW << "NULL VideoDecoder EGL context - HW surface encoding is disabled."; |
1135 } | 1135 } |
(...skipping 24 matching lines...) Expand all Loading... |
1160 } | 1160 } |
1161 | 1161 |
1162 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1162 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
1163 webrtc::VideoEncoder* encoder) { | 1163 webrtc::VideoEncoder* encoder) { |
1164 ALOGD << "Destroy video encoder."; | 1164 ALOGD << "Destroy video encoder."; |
1165 delete encoder; | 1165 delete encoder; |
1166 } | 1166 } |
1167 | 1167 |
1168 } // namespace webrtc_jni | 1168 } // namespace webrtc_jni |
1169 | 1169 |
OLD | NEW |