OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/media/rtc_video_capture_delegate.h" | 5 #include "content/renderer/media/rtc_video_capture_delegate.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void RtcVideoCaptureDelegate::OnBufferReadyOnCaptureThread( | 91 void RtcVideoCaptureDelegate::OnBufferReadyOnCaptureThread( |
92 media::VideoCapture* capture, | 92 media::VideoCapture* capture, |
93 scoped_refptr<media::VideoCapture::VideoFrameBuffer> buf) { | 93 scoped_refptr<media::VideoCapture::VideoFrameBuffer> buf) { |
94 if (!captured_callback_.is_null()) { | 94 if (!captured_callback_.is_null()) { |
95 if (!got_first_frame_) { | 95 if (!got_first_frame_) { |
96 got_first_frame_ = true; | 96 got_first_frame_ = true; |
97 if (!state_callback_.is_null()) | 97 if (!state_callback_.is_null()) |
98 state_callback_.Run(CAPTURE_RUNNING); | 98 state_callback_.Run(CAPTURE_RUNNING); |
99 } | 99 } |
100 | 100 |
101 captured_callback_.Run(*buf); | 101 captured_callback_.Run(*buf.get()); |
102 } | 102 } |
103 capture->FeedBuffer(buf); | 103 capture->FeedBuffer(buf); |
104 } | 104 } |
105 | 105 |
106 void RtcVideoCaptureDelegate::OnErrorOnCaptureThread( | 106 void RtcVideoCaptureDelegate::OnErrorOnCaptureThread( |
107 media::VideoCapture* capture, int error_code) { | 107 media::VideoCapture* capture, int error_code) { |
108 if (!state_callback_.is_null()) | 108 if (!state_callback_.is_null()) |
109 state_callback_.Run(got_first_frame_ ? CAPTURE_STOPPED : CAPTURE_FAILED); | 109 state_callback_.Run(got_first_frame_ ? CAPTURE_STOPPED : CAPTURE_FAILED); |
110 } | 110 } |
111 | 111 |
112 } // namespace content | 112 } // namespace content |
OLD | NEW |