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

Unified Diff: media/video/video_encode_accelerator.h

Issue 2427053002: Move video encode accelerator IPC messages to GPU IO thread (Closed)
Patch Set: posciak@ comments. Created 4 years, 1 month 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
« no previous file with comments | « media/gpu/video_encode_accelerator_unittest.cc ('k') | media/video/video_encode_accelerator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/video_encode_accelerator.h
diff --git a/media/video/video_encode_accelerator.h b/media/video/video_encode_accelerator.h
index ac1ffd56dfa8a1f51a54c5e7d7284a7584c174fc..2d10da73982f025f1f218a055fb2c4cb622e9c64 100644
--- a/media/video/video_encode_accelerator.h
+++ b/media/video/video_encode_accelerator.h
@@ -12,6 +12,8 @@
#include <vector>
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "base/single_thread_task_runner.h"
#include "media/base/bitstream_buffer.h"
#include "media/base/media_export.h"
#include "media/base/video_decoder_config.h"
@@ -147,11 +149,29 @@ class MEDIA_EXPORT VideoEncodeAccelerator {
// Destroys the encoder: all pending inputs and outputs are dropped
// immediately and the component is freed. This call may asynchronously free
- // system resources, but its client-visible effects are synchronous. After
- // this method returns no more callbacks will be made on the client. Deletes
+ // system resources, but its client-visible effects are synchronous. After
+ // this method returns no more callbacks will be made on the client. Deletes
// |this| unconditionally, so make sure to drop all pointers to it!
virtual void Destroy() = 0;
+ // Encode tasks include these methods that are used frequently during the
+ // session: Encode(), UseOutputBitstreamBuffer(),
+ // RequestEncodingParametersChange(), Client::BitstreamBufferReady().
+ // If the Client can support running these on a separate thread, it may
+ // call this method to try to set up the VEA implementation to do so.
+ //
+ // If the VEA can support this as well, return true, otherwise return false.
+ // If true is returned, the client may submit each of these calls on
+ // |encode_task_runner|, and then expect Client::BitstreamBufferReady() to be
+ // called on |encode_task_runner| as well; called on |encode_client|, instead
+ // of |client| provided to Initialize().
+ //
+ // One application of this is offloading the GPU main thread. This helps
+ // reduce latency and jitter by avoiding the wait.
+ virtual bool TryToSetupEncodeOnSeparateThread(
+ const base::WeakPtr<Client>& encode_client,
+ const scoped_refptr<base::SingleThreadTaskRunner>& encode_task_runner);
+
protected:
// Do not delete directly; use Destroy() or own it with a scoped_ptr, which
// will Destroy() it properly by default.
« no previous file with comments | « media/gpu/video_encode_accelerator_unittest.cc ('k') | media/video/video_encode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698