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

Unified Diff: content/renderer/media/rtc_video_decoder.cc

Issue 2024303003: Enable RTCVideoDecoder SW H264 fallback only when it is available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/rtc_video_decoder.cc
diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc
index d0d0387957c6c07795450b2b343c40dd393c2b42..32de1175114e0f0df463af6f4871546682d36b87 100644
--- a/content/renderer/media/rtc_video_decoder.cc
+++ b/content/renderer/media/rtc_video_decoder.cc
@@ -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)
@@ -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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698