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

Unified Diff: media/capture/video/video_frame_receiver_on_task_runner.h

Issue 2795663002: Change VideoFrameReceiverOnIOThread to VideoFrameReceiverOnTaskRunner (Closed)
Patch Set: Rebase Created 3 years, 8 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
« no previous file with comments | « media/capture/BUILD.gn ('k') | media/capture/video/video_frame_receiver_on_task_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/video_frame_receiver_on_task_runner.h
diff --git a/media/capture/video/video_frame_receiver_on_task_runner.h b/media/capture/video/video_frame_receiver_on_task_runner.h
new file mode 100644
index 0000000000000000000000000000000000000000..3ee757d52e3900725a30a50545cd07040d196c01
--- /dev/null
+++ b/media/capture/video/video_frame_receiver_on_task_runner.h
@@ -0,0 +1,50 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_CAPTURE_VIDEO_VIDEO_FRAME_RECEIVER_ON_TASK_RUNNER_H_
+#define MEDIA_CAPTURE_VIDEO_VIDEO_FRAME_RECEIVER_ON_TASK_RUNNER_H_
+
+#include "media/capture/video/video_frame_receiver.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+}
+
+namespace media {
+
+// Decorator for VideoFrameReceiver that forwards all incoming calls to the
+// given |task_runner|.
+class CAPTURE_EXPORT VideoFrameReceiverOnTaskRunner
+ : public VideoFrameReceiver {
+ public:
+ explicit VideoFrameReceiverOnTaskRunner(
+ const base::WeakPtr<VideoFrameReceiver>& receiver,
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner);
+ ~VideoFrameReceiverOnTaskRunner() override;
+
+ void OnNewBufferHandle(
+ int buffer_id,
+ std::unique_ptr<VideoCaptureDevice::Client::Buffer::HandleProvider>
+ handle_provider) override;
+ void OnFrameReadyInBuffer(
+ int buffer_id,
+ int frame_feedback_id,
+ std::unique_ptr<
+ VideoCaptureDevice::Client::Buffer::ScopedAccessPermission>
+ buffer_read_permission,
+ mojom::VideoFrameInfoPtr frame_info) override;
+ void OnBufferRetired(int buffer_id) override;
+ void OnError() override;
+ void OnLog(const std::string& message) override;
+ void OnStarted() override;
+ void OnStartedUsingGpuDecode() override;
+
+ private:
+ const base::WeakPtr<VideoFrameReceiver> receiver_;
+ const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+};
+
+} // namespace media
+
+#endif // MEDIA_CAPTURE_VIDEO_VIDEO_FRAME_RECEIVER_ON_TASK_RUNNER_H_
« no previous file with comments | « media/capture/BUILD.gn ('k') | media/capture/video/video_frame_receiver_on_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698