Index: content/common/gpu/media/v4l2_video_decode_accelerator.h |
diff --git a/content/common/gpu/media/v4l2_video_decode_accelerator.h b/content/common/gpu/media/v4l2_video_decode_accelerator.h |
index 3d06665e344a27f0d490c34ed0dd7ae359b8529e..cb749569241b18280472da85064ef3b4bf3e1236 100644 |
--- a/content/common/gpu/media/v4l2_video_decode_accelerator.h |
+++ b/content/common/gpu/media/v4l2_video_decode_accelerator.h |
@@ -23,6 +23,7 @@ |
#include "base/synchronization/waitable_event.h" |
#include "base/threading/thread.h" |
#include "content/common/content_export.h" |
+#include "content/common/gpu/media/gpu_video_decode_accelerator_helpers.h" |
#include "content/common/gpu/media/v4l2_device.h" |
#include "media/base/limits.h" |
#include "media/base/video_decoder_config.h" |
@@ -78,11 +79,9 @@ class CONTENT_EXPORT V4L2VideoDecodeAccelerator |
public: |
V4L2VideoDecodeAccelerator( |
EGLDisplay egl_display, |
- EGLContext egl_context, |
- const base::WeakPtr<Client>& io_client_, |
- const base::Callback<bool(void)>& make_context_current, |
- const scoped_refptr<V4L2Device>& device, |
- const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner); |
+ const GetGLContextCallback& get_gl_context_cb, |
+ const MakeGLContextCurrentCallback& make_context_current_cb, |
+ const scoped_refptr<V4L2Device>& device); |
~V4L2VideoDecodeAccelerator() override; |
// media::VideoDecodeAccelerator implementation. |
@@ -95,7 +94,10 @@ class CONTENT_EXPORT V4L2VideoDecodeAccelerator |
void Flush() override; |
void Reset() override; |
void Destroy() override; |
- bool CanDecodeOnIOThread() override; |
+ bool TryToSetupDecodeOnSeparateThread( |
+ const base::WeakPtr<Client>& decode_client, |
+ const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) |
+ override; |
static media::VideoDecodeAccelerator::SupportedProfiles |
GetSupportedProfiles(); |
@@ -316,8 +318,8 @@ class CONTENT_EXPORT V4L2VideoDecodeAccelerator |
// Our original calling task runner for the child thread. |
scoped_refptr<base::SingleThreadTaskRunner> child_task_runner_; |
- // Task runner of the IO thread. |
- scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
+ // Task runner Decode() and PictureReady() run on. |
+ scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner_; |
// WeakPtr<> pointing to |this| for use in posting tasks from the decoder or |
// device worker threads back to the child thread. Because the worker threads |
@@ -332,8 +334,8 @@ class CONTENT_EXPORT V4L2VideoDecodeAccelerator |
// child_task_runner_. |
scoped_ptr<base::WeakPtrFactory<Client> > client_ptr_factory_; |
base::WeakPtr<Client> client_; |
- // Callbacks to |io_client_| must be executed on |io_task_runner_|. |
- base::WeakPtr<Client> io_client_; |
+ // Callbacks to |decode_client_| must be executed on |decode_task_runner_|. |
+ base::WeakPtr<Client> decode_client_; |
// |
// Decoder state, owned and operated by decoder_thread_. |
@@ -438,12 +440,13 @@ class CONTENT_EXPORT V4L2VideoDecodeAccelerator |
// Other state, held by the child (main) thread. |
// |
- // Make our context current before running any EGL entry points. |
- base::Callback<bool(void)> make_context_current_; |
- |
// EGL state |
EGLDisplay egl_display_; |
- EGLContext egl_context_; |
+ |
+ // Callback to get current GLContext. |
+ GetGLContextCallback get_gl_context_cb_; |
+ // Callback to set the correct gl context. |
+ MakeGLContextCurrentCallback make_context_current_cb_; |
// The codec we'll be decoding for. |
media::VideoCodecProfile video_profile_; |