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 3f1e8774a3e52614484cf38de512a1c384f3eb80..6888bc79cbbe3d9ed0a5747c8d8e8240648b2b21 100644 |
| --- a/content/common/gpu/media/android_video_decode_accelerator.cc |
| +++ b/content/common/gpu/media/android_video_decode_accelerator.cc |
| @@ -10,6 +10,8 @@ |
| #include "base/metrics/histogram.h" |
| #include "base/trace_event/trace_event.h" |
| #include "content/common/gpu/gpu_channel.h" |
| +#include "content/common/gpu/media/android_copying_backing_strategy.h" |
| +#include "content/common/gpu/media/android_deferred_rendering_backing_strategy.h" |
| #include "content/common/gpu/media/avda_return_on_failure.h" |
| #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| #include "media/base/bitstream_buffer.h" |
| @@ -50,6 +52,10 @@ static const media::VideoCodecProfile kSupportedH264Profiles[] = { |
| media::H264PROFILE_STEREOHIGH, |
| media::H264PROFILE_MULTIVIEWHIGH |
| }; |
| + |
| +#define kBackingStrategy AndroidDeferredRenderingBackingStrategy |
|
DaleCurtis
2015/12/03 21:59:46
ALL_CAPS
liberato (no reviews please)
2015/12/04 18:28:58
DONE
|
| +#else |
| +#define kBackingStrategy AndroidCopyingBackingStrategy |
| #endif |
| // Because MediaCodec is thread-hostile (must be poked on a single thread) and |
| @@ -76,15 +82,14 @@ static inline const base::TimeDelta NoWaitTimeOut() { |
| AndroidVideoDecodeAccelerator::AndroidVideoDecodeAccelerator( |
| const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder, |
| - const base::Callback<bool(void)>& make_context_current, |
| - scoped_ptr<BackingStrategy> strategy) |
| + const base::Callback<bool(void)>& make_context_current) |
| : client_(NULL), |
| make_context_current_(make_context_current), |
| codec_(media::kCodecH264), |
| state_(NO_ERROR), |
| picturebuffers_requested_(false), |
| gl_decoder_(decoder), |
| - strategy_(strategy.Pass()), |
| + strategy_(new kBackingStrategy()), |
|
liberato (no reviews please)
2015/12/03 21:21:01
interesting aside: this isn't, and wasn't before,
|
| weak_this_factory_(this) {} |
| AndroidVideoDecodeAccelerator::~AndroidVideoDecodeAccelerator() { |
| @@ -664,6 +669,11 @@ AndroidVideoDecodeAccelerator::GetSupportedProfiles() { |
| } |
| #endif |
| + // Allow the backing strategy to set the flags for each profile. |
| + for (auto& profile : profiles) { |
| + profile.flags = kBackingStrategy::GetProfileFlags(); |
| + } |
| + |
| return profiles; |
| } |