Index: media/gpu/media_foundation_video_encode_accelerator_win.h |
diff --git a/media/gpu/media_foundation_video_encode_accelerator_win.h b/media/gpu/media_foundation_video_encode_accelerator_win.h |
index 3060abb194cdedaa5900e5e63c78e331d8f51ccb..08dcd4d843f014cfd8bf41ef55e700489ebc16e2 100644 |
--- a/media/gpu/media_foundation_video_encode_accelerator_win.h |
+++ b/media/gpu/media_foundation_video_encode_accelerator_win.h |
@@ -28,10 +28,11 @@ namespace media { |
// Media Foundation implementation of the VideoEncodeAccelerator interface for |
// Windows. |
// This class saves the task runner on which it is constructed and returns |
-// encoded data to the client using that same task runner. This class has |
-// DCHECKs to makes sure that methods are called in sequence. It starts an |
-// internal encoder thread on which VideoEncodeAccelerator implementation tasks |
-// are posted. |
+// encoded data to the client using that same task runner. If |
+// TryToSetupEncodeOnSeparateThread() is called, it uses the given |
+// |encode_task_runner| instead. This class has DCHECKs to makes sure that |
+// methods are called in sequence. It starts an internal encoder thread on which |
+// VideoEncodeAccelerator implementation tasks are posted. |
class MEDIA_GPU_EXPORT MediaFoundationVideoEncodeAccelerator |
: public VideoEncodeAccelerator { |
public: |
@@ -50,6 +51,10 @@ class MEDIA_GPU_EXPORT MediaFoundationVideoEncodeAccelerator |
void RequestEncodingParametersChange(uint32_t bitrate, |
uint32_t framerate) override; |
void Destroy() override; |
+ bool TryToSetupEncodeOnSeparateThread( |
+ const base::WeakPtr<Client>& encode_client, |
+ const scoped_refptr<base::SingleThreadTaskRunner>& encode_task_runner) |
+ override; |
// Preload dlls required for encoding. |
static void PreSandboxInitialization(); |
@@ -130,9 +135,15 @@ class MEDIA_GPU_EXPORT MediaFoundationVideoEncodeAccelerator |
std::unique_ptr<base::WeakPtrFactory<Client>> client_ptr_factory_; |
// Our original calling task runner for the child thread. |
- const scoped_refptr<base::SequencedTaskRunner> client_task_runner_; |
- // Sequence checker to enforce that the methods of this object are called in |
- // sequence. |
+ scoped_refptr<base::SequencedTaskRunner> client_task_runner_; |
+ |
+ // Thread checker to enforce that this object created, initialized and |
+ // destroyed on a specific thread. It is pinned on the thread where object is |
+ // created. |
+ base::ThreadChecker thread_checker_; |
+ |
+ // Sequence checker to enforce that the encode tasks of this object are called |
+ // in sequence. |
base::SequenceChecker sequence_checker_; |
// This thread services tasks posted from the VEA API entry points by the |