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

Side by Side Diff: webrtc/api/androidvideocapturer.cc

Issue 1740963002: Revert of Removed unused cricket::VideoCapturer methods (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/api/test/fakeperiodicvideocapturer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 void AndroidVideoCapturer::Stop() { 146 void AndroidVideoCapturer::Stop() {
147 LOG(LS_INFO) << " AndroidVideoCapturer::Stop "; 147 LOG(LS_INFO) << " AndroidVideoCapturer::Stop ";
148 RTC_CHECK(thread_checker_.CalledOnValidThread()); 148 RTC_CHECK(thread_checker_.CalledOnValidThread());
149 RTC_CHECK(running_); 149 RTC_CHECK(running_);
150 running_ = false; 150 running_ = false;
151 SetCaptureFormat(NULL); 151 SetCaptureFormat(NULL);
152 152
153 delegate_->Stop(); 153 delegate_->Stop();
154 current_state_ = cricket::CS_STOPPED; 154 current_state_ = cricket::CS_STOPPED;
155 SetCaptureState(current_state_); 155 SignalStateChange(this, current_state_);
156 } 156 }
157 157
158 bool AndroidVideoCapturer::IsRunning() { 158 bool AndroidVideoCapturer::IsRunning() {
159 RTC_CHECK(thread_checker_.CalledOnValidThread()); 159 RTC_CHECK(thread_checker_.CalledOnValidThread());
160 return running_; 160 return running_;
161 } 161 }
162 162
163 bool AndroidVideoCapturer::GetPreferredFourccs(std::vector<uint32_t>* fourccs) { 163 bool AndroidVideoCapturer::GetPreferredFourccs(std::vector<uint32_t>* fourccs) {
164 RTC_CHECK(thread_checker_.CalledOnValidThread()); 164 RTC_CHECK(thread_checker_.CalledOnValidThread());
165 fourccs->push_back(cricket::FOURCC_YV12); 165 fourccs->push_back(cricket::FOURCC_YV12);
166 return true; 166 return true;
167 } 167 }
168 168
169 void AndroidVideoCapturer::OnCapturerStarted(bool success) { 169 void AndroidVideoCapturer::OnCapturerStarted(bool success) {
170 RTC_CHECK(thread_checker_.CalledOnValidThread()); 170 RTC_CHECK(thread_checker_.CalledOnValidThread());
171 cricket::CaptureState new_state = 171 cricket::CaptureState new_state =
172 success ? cricket::CS_RUNNING : cricket::CS_FAILED; 172 success ? cricket::CS_RUNNING : cricket::CS_FAILED;
173 if (new_state == current_state_) 173 if (new_state == current_state_)
174 return; 174 return;
175 current_state_ = new_state; 175 current_state_ = new_state;
176 SetCaptureState(new_state); 176
177 // TODO(perkj): SetCaptureState can not be used since it posts to |thread_|.
178 // But |thread_ | is currently just the thread that happened to create the
179 // cricket::VideoCapturer.
180 SignalStateChange(this, new_state);
177 } 181 }
178 182
179 void AndroidVideoCapturer::OnIncomingFrame( 183 void AndroidVideoCapturer::OnIncomingFrame(
180 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, 184 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer,
181 int rotation, 185 int rotation,
182 int64_t time_stamp) { 186 int64_t time_stamp) {
183 RTC_CHECK(thread_checker_.CalledOnValidThread()); 187 RTC_CHECK(thread_checker_.CalledOnValidThread());
184 frame_factory_->UpdateCapturedFrame(buffer, rotation, time_stamp); 188 frame_factory_->UpdateCapturedFrame(buffer, rotation, time_stamp);
185 SignalFrameCaptured(this, frame_factory_->GetCapturedFrame()); 189 SignalFrameCaptured(this, frame_factory_->GetCapturedFrame());
186 frame_factory_->ClearCapturedFrame(); 190 frame_factory_->ClearCapturedFrame();
(...skipping 10 matching lines...) Expand all
197 201
198 bool AndroidVideoCapturer::GetBestCaptureFormat( 202 bool AndroidVideoCapturer::GetBestCaptureFormat(
199 const cricket::VideoFormat& desired, 203 const cricket::VideoFormat& desired,
200 cricket::VideoFormat* best_format) { 204 cricket::VideoFormat* best_format) {
201 // Delegate this choice to VideoCapturer.startCapture(). 205 // Delegate this choice to VideoCapturer.startCapture().
202 *best_format = desired; 206 *best_format = desired;
203 return true; 207 return true;
204 } 208 }
205 209
206 } // namespace webrtc 210 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/test/fakeperiodicvideocapturer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698