Index: content/common/gpu/media/android_video_decode_accelerator.h |
diff --git a/content/common/gpu/media/android_video_decode_accelerator.h b/content/common/gpu/media/android_video_decode_accelerator.h |
index ab2c4da815e9d92c4c8747b7b68feea2295b87e5..e8a5bf07b3ff248085da34c2ac5db9678d3af78e 100644 |
--- a/content/common/gpu/media/android_video_decode_accelerator.h |
+++ b/content/common/gpu/media/android_video_decode_accelerator.h |
@@ -18,6 +18,7 @@ |
#include "base/timer/timer.h" |
#include "content/common/content_export.h" |
#include "content/common/gpu/media/avda_state_provider.h" |
+#include "content/public/common/gpu_video_decode_accelerator_helpers.h" |
#include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
#include "media/base/android/media_drm_bridge.h" |
#include "media/base/android/sdk_media_codec_bridge.h" |
@@ -101,8 +102,8 @@ class CONTENT_EXPORT AndroidVideoDecodeAccelerator |
}; |
AndroidVideoDecodeAccelerator( |
- const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder, |
- const base::Callback<bool(void)>& make_context_current); |
+ const gpu_vda_helpers::GetGLES2DecoderCb& get_gles2_decoder_cb, |
+ const gpu_vda_helpers::MakeGLContextCurrentCb& make_context_current_cb); |
~AndroidVideoDecodeAccelerator() override; |
@@ -116,7 +117,10 @@ class CONTENT_EXPORT AndroidVideoDecodeAccelerator |
void Flush() override; |
void Reset() override; |
void Destroy() override; |
- bool CanDecodeOnIOThread() override; |
+ bool TryInitializeDecodeOnSeparateThread( |
+ const base::WeakPtr<Client>& decode_client, |
+ const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) |
+ override; |
// AVDAStateProvider implementation: |
const gfx::Size& GetSize() const override; |
@@ -227,7 +231,10 @@ class CONTENT_EXPORT AndroidVideoDecodeAccelerator |
Client* client_; |
// Callback to set the correct gl context. |
- base::Callback<bool(void)> make_context_current_; |
+ gpu_vda_helpers::MakeGLContextCurrentCb make_context_current_cb_; |
+ |
+ // Callback to get the GLES2Decoder instance. |
+ gpu_vda_helpers::GetGLES2DecoderCb get_gles2_decoder_cb_; |
// Codec type. Used when we configure media codec. |
media::VideoCodec codec_; |
@@ -285,9 +292,6 @@ class CONTENT_EXPORT AndroidVideoDecodeAccelerator |
// NotifyEndOfBitstreamBuffer() before getting output from the bitstream. |
std::list<int32_t> bitstreams_notified_in_advance_; |
- // Owner of the GL context. Used to restore the context state. |
- base::WeakPtr<gpu::gles2::GLES2Decoder> gl_decoder_; |
- |
// Backing strategy that we'll use to connect PictureBuffers to frames. |
scoped_ptr<BackingStrategy> strategy_; |