Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: webrtc/api/java/jni/androidmediadecoder_jni.cc

Issue 1879213002: Enable H.264 HW decoder soft rest. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/api/java/jni/androidmediaencoder_jni.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 // Check if encoded frame dimension has changed. 525 // Check if encoded frame dimension has changed.
526 if ((inputImage._encodedWidth * inputImage._encodedHeight > 0) && 526 if ((inputImage._encodedWidth * inputImage._encodedHeight > 0) &&
527 (inputImage._encodedWidth != codec_.width || 527 (inputImage._encodedWidth != codec_.width ||
528 inputImage._encodedHeight != codec_.height)) { 528 inputImage._encodedHeight != codec_.height)) {
529 ALOGW << "Input resolution changed from " << 529 ALOGW << "Input resolution changed from " <<
530 codec_.width << " x " << codec_.height << " to " << 530 codec_.width << " x " << codec_.height << " to " <<
531 inputImage._encodedWidth << " x " << inputImage._encodedHeight; 531 inputImage._encodedWidth << " x " << inputImage._encodedHeight;
532 codec_.width = inputImage._encodedWidth; 532 codec_.width = inputImage._encodedWidth;
533 codec_.height = inputImage._encodedHeight; 533 codec_.height = inputImage._encodedHeight;
534 int32_t ret; 534 int32_t ret;
535 if (use_surface_ && codecType_ == kVideoCodecVP8) { 535 if (use_surface_ &&
536 // Soft codec reset - only for VP8 and surface decoding. 536 (codecType_ == kVideoCodecVP8 || codecType_ == kVideoCodecH264)) {
537 // TODO(glaznev): try to use similar approach for H.264 537 // Soft codec reset - only for surface decoding.
538 // and buffer decoding.
539 ret = codec_thread_->Invoke<int32_t>(Bind( 538 ret = codec_thread_->Invoke<int32_t>(Bind(
540 &MediaCodecVideoDecoder::ResetDecodeOnCodecThread, this)); 539 &MediaCodecVideoDecoder::ResetDecodeOnCodecThread, this));
541 } else { 540 } else {
542 // Hard codec reset. 541 // Hard codec reset.
543 ret = InitDecode(&codec_, 1); 542 ret = InitDecode(&codec_, 1);
544 } 543 }
545 if (ret < 0) { 544 if (ret < 0) {
546 ALOGE << "InitDecode failure: " << ret << " - fallback to SW codec"; 545 ALOGE << "InitDecode failure: " << ret << " - fallback to SW codec";
547 sw_fallback_required_ = true; 546 sw_fallback_required_ = true;
548 return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE; 547 return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE;
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 ALOGD << "Destroy video decoder."; 981 ALOGD << "Destroy video decoder.";
983 delete decoder; 982 delete decoder;
984 } 983 }
985 984
986 const char* MediaCodecVideoDecoder::ImplementationName() const { 985 const char* MediaCodecVideoDecoder::ImplementationName() const {
987 return "MediaCodec"; 986 return "MediaCodec";
988 } 987 }
989 988
990 } // namespace webrtc_jni 989 } // namespace webrtc_jni
991 990
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/java/jni/androidmediaencoder_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698