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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 __android_log_print(ANDROID_LOG_VERBOSE, TAG_ENCODER, __VA_ARGS__) | 77 __android_log_print(ANDROID_LOG_VERBOSE, TAG_ENCODER, __VA_ARGS__) |
78 #else | 78 #else |
79 #define ALOGV(...) | 79 #define ALOGV(...) |
80 #endif | 80 #endif |
81 #define ALOGD LOG_TAG(rtc::LS_INFO, TAG_ENCODER) | 81 #define ALOGD LOG_TAG(rtc::LS_INFO, TAG_ENCODER) |
82 #define ALOGW LOG_TAG(rtc::LS_WARNING, TAG_ENCODER) | 82 #define ALOGW LOG_TAG(rtc::LS_WARNING, TAG_ENCODER) |
83 #define ALOGE LOG_TAG(rtc::LS_ERROR, TAG_ENCODER) | 83 #define ALOGE LOG_TAG(rtc::LS_ERROR, TAG_ENCODER) |
84 | 84 |
85 namespace { | 85 namespace { |
86 // Maximum time limit between incoming frames before requesting a key frame. | 86 // Maximum time limit between incoming frames before requesting a key frame. |
87 const size_t kFrameDiffThresholdMs = 1100; | 87 const size_t kFrameDiffThresholdMs = 350; |
88 const int kMinKeyFrameInterval = 2; | 88 const int kMinKeyFrameInterval = 6; |
89 } // namespace | 89 } // namespace |
90 | 90 |
91 // MediaCodecVideoEncoder is a webrtc::VideoEncoder implementation that uses | 91 // MediaCodecVideoEncoder is a webrtc::VideoEncoder implementation that uses |
92 // Android's MediaCodec SDK API behind the scenes to implement (hopefully) | 92 // Android's MediaCodec SDK API behind the scenes to implement (hopefully) |
93 // HW-backed video encode. This C++ class is implemented as a very thin shim, | 93 // HW-backed video encode. This C++ class is implemented as a very thin shim, |
94 // delegating all of the interesting work to org.webrtc.MediaCodecVideoEncoder. | 94 // delegating all of the interesting work to org.webrtc.MediaCodecVideoEncoder. |
95 // MediaCodecVideoEncoder is created, operated, and destroyed on a single | 95 // MediaCodecVideoEncoder is created, operated, and destroyed on a single |
96 // thread, currently the libjingle Worker thread. | 96 // thread, currently the libjingle Worker thread. |
97 class MediaCodecVideoEncoder : public webrtc::VideoEncoder, | 97 class MediaCodecVideoEncoder : public webrtc::VideoEncoder, |
98 public rtc::MessageHandler { | 98 public rtc::MessageHandler { |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1380 return supported_codecs_; | 1380 return supported_codecs_; |
1381 } | 1381 } |
1382 | 1382 |
1383 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1383 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
1384 webrtc::VideoEncoder* encoder) { | 1384 webrtc::VideoEncoder* encoder) { |
1385 ALOGD << "Destroy video encoder."; | 1385 ALOGD << "Destroy video encoder."; |
1386 delete encoder; | 1386 delete encoder; |
1387 } | 1387 } |
1388 | 1388 |
1389 } // namespace webrtc_jni | 1389 } // namespace webrtc_jni |
OLD | NEW |