OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
mcasas
2017/04/03 17:14:23
s/2016/2017/
Chandan
2017/04/04 07:27:09
Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "media/capture/video/video_frame_receiver_on_task_runner.h" | |
6 | |
7 namespace media { | |
8 | |
9 VideoFrameReceiverOnTaskRunner::VideoFrameReceiverOnTaskRunner( | |
10 const base::WeakPtr<VideoFrameReceiver>& receiver, | |
11 scoped_refptr<base::SingleThreadTaskRunner> task_runner) | |
12 : receiver_(receiver), task_runner_(std::move(task_runner)) {} | |
13 | |
14 VideoFrameReceiverOnTaskRunner::~VideoFrameReceiverOnTaskRunner() = default; | |
15 | |
16 void VideoFrameReceiverOnTaskRunner::OnNewBufferHandle( | |
17 int buffer_id, | |
18 std::unique_ptr<VideoCaptureDevice::Client::Buffer::HandleProvider> | |
19 handle_provider) { | |
20 task_runner_->PostTask( | |
21 FROM_HERE, | |
22 base::Bind(&VideoFrameReceiver::OnNewBufferHandle, receiver_, buffer_id, | |
23 base::Passed(std::move(handle_provider)))); | |
24 } | |
25 | |
26 void VideoFrameReceiverOnTaskRunner::OnFrameReadyInBuffer( | |
27 int buffer_id, | |
28 int frame_feedback_id, | |
29 std::unique_ptr<VideoCaptureDevice::Client::Buffer::ScopedAccessPermission> | |
30 buffer_read_permission, | |
31 mojom::VideoFrameInfoPtr frame_info) { | |
32 task_runner_->PostTask(FROM_HERE, | |
33 base::Bind(&VideoFrameReceiver::OnFrameReadyInBuffer, | |
34 receiver_, buffer_id, frame_feedback_id, | |
35 base::Passed(&buffer_read_permission), | |
36 base::Passed(&frame_info))); | |
37 } | |
38 | |
39 void VideoFrameReceiverOnTaskRunner::OnBufferRetired(int buffer_id) { | |
40 task_runner_->PostTask( | |
41 FROM_HERE, | |
42 base::Bind(&VideoFrameReceiver::OnBufferRetired, receiver_, buffer_id)); | |
43 } | |
44 | |
45 void VideoFrameReceiverOnTaskRunner::OnError() { | |
46 task_runner_->PostTask(FROM_HERE, | |
47 base::Bind(&VideoFrameReceiver::OnError, receiver_)); | |
48 } | |
49 | |
50 void VideoFrameReceiverOnTaskRunner::OnLog(const std::string& message) { | |
51 task_runner_->PostTask( | |
52 FROM_HERE, base::Bind(&VideoFrameReceiver::OnLog, receiver_, message)); | |
53 } | |
54 | |
55 void VideoFrameReceiverOnTaskRunner::OnStarted() { | |
56 task_runner_->PostTask(FROM_HERE, | |
57 base::Bind(&VideoFrameReceiver::OnStarted, receiver_)); | |
58 } | |
59 | |
60 } // namespace content | |
OLD | NEW |