| 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..e822d5d9e7b654781a6bee8099f45f431d6b4f37 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,28 @@ 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 all calls, except Initialize() and Destroy(), that are
|
| + // used frequently during the encode session. If the Client can support
|
| + // running these calls 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 methods 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 by avoiding the wait and reduces jitter.
|
| + 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.
|
|
|