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..a387b8dabd5e8cf9f689efc88bcce8b43d363f9c 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 BACKING_STRATEGY AndroidDeferredRenderingBackingStrategy |
+#else |
+#define BACKING_STRATEGY 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 BACKING_STRATEGY()), |
weak_this_factory_(this) {} |
AndroidVideoDecodeAccelerator::~AndroidVideoDecodeAccelerator() { |
@@ -629,9 +634,10 @@ void AndroidVideoDecodeAccelerator::NotifyError( |
} |
// static |
-media::VideoDecodeAccelerator::SupportedProfiles |
-AndroidVideoDecodeAccelerator::GetSupportedProfiles() { |
- SupportedProfiles profiles; |
+media::VideoDecodeAccelerator::Capabilities |
+AndroidVideoDecodeAccelerator::GetCapabilities() { |
+ Capabilities capabilities; |
+ SupportedProfiles& profiles = capabilities.supported_profiles; |
if (!media::VideoCodecBridge::IsKnownUnaccelerated( |
media::kCodecVP8, media::MEDIA_CODEC_DECODER)) { |
@@ -664,7 +670,9 @@ AndroidVideoDecodeAccelerator::GetSupportedProfiles() { |
} |
#endif |
- return profiles; |
+ capabilities.flags = BACKING_STRATEGY::GetCapabilitiesFlags(); |
+ |
+ return capabilities; |
} |
} // namespace content |