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

Unified Diff: content/common/gpu/media/android_video_decode_accelerator.cc

Issue 1530063002: Switch from build-time to run-time flags for Project Spitzer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
Index: content/common/gpu/media/android_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/android_video_decode_accelerator.cc b/content/common/gpu/media/android_video_decode_accelerator.cc
index 6b381f3be33c7eb8293910b9b2890bd84c2f9f0f..f960ba664d6960beca0a120a91b8d19da67441db 100644
--- a/content/common/gpu/media/android_video_decode_accelerator.cc
+++ b/content/common/gpu/media/android_video_decode_accelerator.cc
@@ -41,7 +41,6 @@ enum { kNumPictureBuffers = media::limits::kMaxVideoFrames + 1 };
// NotifyEndOfBitstreamBuffer() before getting output from the bitstream.
enum { kMaxBitstreamsNotifiedInAdvance = 32 };
-#if defined(ENABLE_MEDIA_PIPELINE_ON_ANDROID)
// MediaCodec is only guaranteed to support baseline, but some devices may
// support others. Advertise support for all H264 profiles and let the
// MediaCodec fail when decoding if it's not actually supported. It's assumed
@@ -60,11 +59,6 @@ static const media::VideoCodecProfile kSupportedH264Profiles[] = {
media::H264PROFILE_MULTIVIEWHIGH
};
-#define BACKING_STRATEGY AndroidDeferredRenderingBackingStrategy
-#else
-#define BACKING_STRATEGY AndroidCopyingBackingStrategy
-#endif
-
// Because MediaCodec is thread-hostile (must be poked on a single thread) and
// has no callback mechanism (b/11990118), we must drive it by polling for
// complete frames (and available input buffers, when the codec is fully
@@ -97,7 +91,9 @@ AndroidVideoDecodeAccelerator::AndroidVideoDecodeAccelerator(
state_(NO_ERROR),
picturebuffers_requested_(false),
gl_decoder_(decoder),
- strategy_(new BACKING_STRATEGY()),
+ // TODO(liberato): This should be based on the command line flags present
DaleCurtis 2015/12/16 00:06:40 liberato@, approved your CL here: https://coderevi
DaleCurtis 2015/12/17 01:50:48 Rebased on Frank's changes.
+ // until we can make it work for WebRTC as well.
+ strategy_(new AndroidCopyingBackingStrategy()),
weak_this_factory_(this) {}
AndroidVideoDecodeAccelerator::~AndroidVideoDecodeAccelerator() {
@@ -117,11 +113,9 @@ bool AndroidVideoDecodeAccelerator::Initialize(const Config& config,
codec_ = VideoCodecProfileToVideoCodec(config.profile);
is_encrypted_ = config.is_encrypted;
- bool profile_supported = codec_ == media::kCodecVP8;
-#if defined(ENABLE_MEDIA_PIPELINE_ON_ANDROID)
- profile_supported |=
- (codec_ == media::kCodecVP9 || codec_ == media::kCodecH264);
-#endif
+ bool profile_supported = codec_ == media::kCodecVP8 ||
+ codec_ == media::kCodecVP9 ||
+ codec_ == media::kCodecH264;
if (!profile_supported) {
LOG(ERROR) << "Unsupported profile: " << config.profile;
@@ -659,7 +653,6 @@ AndroidVideoDecodeAccelerator::GetCapabilities() {
profiles.push_back(profile);
}
-#if defined(ENABLE_MEDIA_PIPELINE_ON_ANDROID)
if (!media::VideoCodecBridge::IsKnownUnaccelerated(
media::kCodecVP9, media::MEDIA_CODEC_DECODER)) {
SupportedProfile profile;
@@ -679,9 +672,9 @@ AndroidVideoDecodeAccelerator::GetCapabilities() {
profile.max_resolution.SetSize(3840, 2160);
profiles.push_back(profile);
}
-#endif
- capabilities.flags = BACKING_STRATEGY::GetCapabilitiesFlags();
+ // TODO(liberato): Needs to be based on command line flag...
+ capabilities.flags = AndroidCopyingBackingStrategy::GetCapabilitiesFlags();
return capabilities;
}

Powered by Google App Engine
This is Rietveld 408576698