Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: content/common/gpu/media/v4l2_video_decode_accelerator.h

Issue 1832123002: Revert of Introduce GpuVideoDecodeAcceleratorFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 cb749569241b18280472da85064ef3b4bf3e1236..3d06665e344a27f0d490c34ed0dd7ae359b8529e 100644
--- a/content/common/gpu/media/v4l2_video_decode_accelerator.h
+++ b/content/common/gpu/media/v4l2_video_decode_accelerator.h
@@ -23,7 +23,6 @@
#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"
@@ -79,9 +78,11 @@
public:
V4L2VideoDecodeAccelerator(
EGLDisplay egl_display,
- const GetGLContextCallback& get_gl_context_cb,
- const MakeGLContextCurrentCallback& make_context_current_cb,
- const scoped_refptr<V4L2Device>& device);
+ 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);
~V4L2VideoDecodeAccelerator() override;
// media::VideoDecodeAccelerator implementation.
@@ -94,10 +95,7 @@
void Flush() override;
void Reset() override;
void Destroy() override;
- bool TryToSetupDecodeOnSeparateThread(
- const base::WeakPtr<Client>& decode_client,
- const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner)
- override;
+ bool CanDecodeOnIOThread() override;
static media::VideoDecodeAccelerator::SupportedProfiles
GetSupportedProfiles();
@@ -318,8 +316,8 @@
// Our original calling task runner for the child thread.
scoped_refptr<base::SingleThreadTaskRunner> child_task_runner_;
- // Task runner Decode() and PictureReady() run on.
- scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner_;
+ // Task runner of the IO thread.
+ scoped_refptr<base::SingleThreadTaskRunner> io_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
@@ -334,8 +332,8 @@
// child_task_runner_.
scoped_ptr<base::WeakPtrFactory<Client> > client_ptr_factory_;
base::WeakPtr<Client> client_;
- // Callbacks to |decode_client_| must be executed on |decode_task_runner_|.
- base::WeakPtr<Client> decode_client_;
+ // Callbacks to |io_client_| must be executed on |io_task_runner_|.
+ base::WeakPtr<Client> io_client_;
//
// Decoder state, owned and operated by decoder_thread_.
@@ -440,13 +438,12 @@
// 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_;
-
- // Callback to get current GLContext.
- GetGLContextCallback get_gl_context_cb_;
- // Callback to set the correct gl context.
- MakeGLContextCurrentCallback make_context_current_cb_;
+ EGLContext egl_context_;
// The codec we'll be decoding for.
media::VideoCodecProfile video_profile_;

Powered by Google App Engine
This is Rietveld 408576698