| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 j_info_buffer_field_ = GetFieldID( | 368 j_info_buffer_field_ = GetFieldID( |
| 369 jni, j_output_buffer_info_class, "buffer", "Ljava/nio/ByteBuffer;"); | 369 jni, j_output_buffer_info_class, "buffer", "Ljava/nio/ByteBuffer;"); |
| 370 j_info_is_key_frame_field_ = | 370 j_info_is_key_frame_field_ = |
| 371 GetFieldID(jni, j_output_buffer_info_class, "isKeyFrame", "Z"); | 371 GetFieldID(jni, j_output_buffer_info_class, "isKeyFrame", "Z"); |
| 372 j_info_presentation_timestamp_us_field_ = GetFieldID( | 372 j_info_presentation_timestamp_us_field_ = GetFieldID( |
| 373 jni, j_output_buffer_info_class, "presentationTimestampUs", "J"); | 373 jni, j_output_buffer_info_class, "presentationTimestampUs", "J"); |
| 374 if (CheckException(jni)) { | 374 if (CheckException(jni)) { |
| 375 ALOGW << "MediaCodecVideoEncoder ctor failed."; | 375 ALOGW << "MediaCodecVideoEncoder ctor failed."; |
| 376 ProcessHWError(true /* reset_if_fallback_unavailable */); | 376 ProcessHWError(true /* reset_if_fallback_unavailable */); |
| 377 } | 377 } |
| 378 srand(time(NULL)); | 378 srand(rtc::Time32()); |
| 379 } | 379 } |
| 380 | 380 |
| 381 int32_t MediaCodecVideoEncoder::InitEncode( | 381 int32_t MediaCodecVideoEncoder::InitEncode( |
| 382 const webrtc::VideoCodec* codec_settings, | 382 const webrtc::VideoCodec* codec_settings, |
| 383 int32_t /* number_of_cores */, | 383 int32_t /* number_of_cores */, |
| 384 size_t /* max_payload_size */) { | 384 size_t /* max_payload_size */) { |
| 385 RTC_DCHECK_CALLED_SEQUENTIALLY(&encoder_queue_checker_); | 385 RTC_DCHECK_CALLED_SEQUENTIALLY(&encoder_queue_checker_); |
| 386 if (codec_settings == NULL) { | 386 if (codec_settings == NULL) { |
| 387 ALOGE << "NULL VideoCodec instance"; | 387 ALOGE << "NULL VideoCodec instance"; |
| 388 return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; | 388 return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1348 } | 1348 } |
| 1349 } | 1349 } |
| 1350 | 1350 |
| 1351 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1351 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
| 1352 webrtc::VideoEncoder* encoder) { | 1352 webrtc::VideoEncoder* encoder) { |
| 1353 ALOGD << "Destroy video encoder."; | 1353 ALOGD << "Destroy video encoder."; |
| 1354 delete encoder; | 1354 delete encoder; |
| 1355 } | 1355 } |
| 1356 | 1356 |
| 1357 } // namespace webrtc_jni | 1357 } // namespace webrtc_jni |
| OLD | NEW |