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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 return false; | 546 return false; |
547 } | 547 } |
548 | 548 |
549 int32_t MediaCodecVideoEncoder::ProcessHWErrorOnEncode() { | 549 int32_t MediaCodecVideoEncoder::ProcessHWErrorOnEncode() { |
550 ProcessHWError(true /* reset_if_fallback_unavailable */); | 550 ProcessHWError(true /* reset_if_fallback_unavailable */); |
551 return sw_fallback_required_ ? WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE | 551 return sw_fallback_required_ ? WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE |
552 : WEBRTC_VIDEO_CODEC_ERROR; | 552 : WEBRTC_VIDEO_CODEC_ERROR; |
553 } | 553 } |
554 | 554 |
555 VideoCodecType MediaCodecVideoEncoder::GetCodecType() const { | 555 VideoCodecType MediaCodecVideoEncoder::GetCodecType() const { |
556 return webrtc::PayloadNameToCodecType(codec_.name) | 556 return webrtc::PayloadStringToCodecType(codec_.name); |
557 .value_or(webrtc::kVideoCodecUnknown); | |
558 } | 557 } |
559 | 558 |
560 int32_t MediaCodecVideoEncoder::InitEncodeInternal(int width, | 559 int32_t MediaCodecVideoEncoder::InitEncodeInternal(int width, |
561 int height, | 560 int height, |
562 int kbps, | 561 int kbps, |
563 int fps, | 562 int fps, |
564 bool use_surface) { | 563 bool use_surface) { |
565 RTC_DCHECK_CALLED_SEQUENTIALLY(&encoder_queue_checker_); | 564 RTC_DCHECK_CALLED_SEQUENTIALLY(&encoder_queue_checker_); |
566 if (sw_fallback_required_) { | 565 if (sw_fallback_required_) { |
567 return WEBRTC_VIDEO_CODEC_OK; | 566 return WEBRTC_VIDEO_CODEC_OK; |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 static_cast<uint8_t*>(jni->GetDirectBufferAddress(j_buffer_u)); | 1492 static_cast<uint8_t*>(jni->GetDirectBufferAddress(j_buffer_u)); |
1494 uint8_t* buffer_v = | 1493 uint8_t* buffer_v = |
1495 static_cast<uint8_t*>(jni->GetDirectBufferAddress(j_buffer_v)); | 1494 static_cast<uint8_t*>(jni->GetDirectBufferAddress(j_buffer_v)); |
1496 | 1495 |
1497 reinterpret_cast<MediaCodecVideoEncoder*>(native_encoder) | 1496 reinterpret_cast<MediaCodecVideoEncoder*>(native_encoder) |
1498 ->FillInputBuffer(jni, input_buffer, buffer_y, stride_y, buffer_u, | 1497 ->FillInputBuffer(jni, input_buffer, buffer_y, stride_y, buffer_u, |
1499 stride_u, buffer_v, stride_v); | 1498 stride_u, buffer_v, stride_v); |
1500 } | 1499 } |
1501 | 1500 |
1502 } // namespace webrtc_jni | 1501 } // namespace webrtc_jni |
OLD | NEW |