Skip to content

Commit

Permalink
Enable RTCVideoDecoder SW H264 fallback only when it is available
Browse files Browse the repository at this point in the history
Extensions have HW H264 encode enabled in 51. However SW implementations
of H264 isn't enabled by default. So, we need to be careful about SW fallback
as we cannot do it when it isn't available.

BUG=615513

Review-Url: https://codereview.chromium.org/2024303003
Cr-Commit-Position: refs/heads/master@{#397856}
(cherry picked from commit 177cc1d)

NOTRY=true
NOPRESUBMIT=true
[email protected]

Review-Url: https://codereview.chromium.org/2044643002
Cr-Commit-Position: refs/branch-heads/2743@{crosswalk-project#249}
Cr-Branched-From: 2b3ae3b-refs/heads/master@{#394939}
  • Loading branch information
uysalere authored and Commit bot committed Jun 6, 2016
1 parent 0dd7cb9 commit 58387c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion content/renderer/media/rtc_video_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/webrtc/base/bind.h"
#include "third_party/webrtc/base/refcount.h"
#include "third_party/webrtc/modules/video_coding/codecs/h264/include/h264.h"
#include "third_party/webrtc/video_frame.h"

#if defined(OS_WIN)
Expand Down Expand Up @@ -179,7 +180,10 @@ int32_t RTCVideoDecoder::Decode(
if (state_ == DECODE_ERROR) {
LOG(ERROR) << "Decoding error occurred.";
// Try reseting the session up to |kNumVDAErrorsHandled| times.
if (vda_error_counter_ > kNumVDAErrorsBeforeSWFallback) {
// Check if SW H264 implementation is available before falling back.
if (vda_error_counter_ > kNumVDAErrorsBeforeSWFallback &&
(video_codec_type_ != webrtc::kVideoCodecH264 ||
webrtc::H264Decoder::IsSupported())) {
DLOG(ERROR) << vda_error_counter_
<< " errors reported by VDA, falling back to software decode";
return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE;
Expand Down

0 comments on commit 58387c5

Please sign in to comment.