Chromium Code Reviews| 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; |
| } |