OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 bool CaptureManager::AddVideoRenderer(VideoCapturer* video_capturer, | 290 bool CaptureManager::AddVideoRenderer(VideoCapturer* video_capturer, |
291 VideoRenderer* video_renderer) { | 291 VideoRenderer* video_renderer) { |
292 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 292 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
293 if (!video_capturer || !video_renderer) { | 293 if (!video_capturer || !video_renderer) { |
294 return false; | 294 return false; |
295 } | 295 } |
296 CaptureRenderAdapter* adapter = GetAdapter(video_capturer); | 296 CaptureRenderAdapter* adapter = GetAdapter(video_capturer); |
297 if (!adapter) { | 297 if (!adapter) { |
298 return false; | 298 return false; |
299 } | 299 } |
300 return adapter->AddRenderer(video_renderer); | 300 adapter->AddRenderer(video_renderer); |
| 301 return true; |
301 } | 302 } |
302 | 303 |
303 bool CaptureManager::RemoveVideoRenderer(VideoCapturer* video_capturer, | 304 bool CaptureManager::RemoveVideoRenderer(VideoCapturer* video_capturer, |
304 VideoRenderer* video_renderer) { | 305 VideoRenderer* video_renderer) { |
305 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 306 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
306 if (!video_capturer || !video_renderer) { | 307 if (!video_capturer || !video_renderer) { |
307 return false; | 308 return false; |
308 } | 309 } |
309 CaptureRenderAdapter* adapter = GetAdapter(video_capturer); | 310 CaptureRenderAdapter* adapter = GetAdapter(video_capturer); |
310 if (!adapter) { | 311 if (!adapter) { |
311 return false; | 312 return false; |
312 } | 313 } |
313 return adapter->RemoveRenderer(video_renderer); | 314 adapter->RemoveRenderer(video_renderer); |
| 315 return true; |
314 } | 316 } |
315 | 317 |
316 bool CaptureManager::IsCapturerRegistered(VideoCapturer* video_capturer) const { | 318 bool CaptureManager::IsCapturerRegistered(VideoCapturer* video_capturer) const { |
317 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 319 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
318 return GetCaptureState(video_capturer) != NULL; | 320 return GetCaptureState(video_capturer) != NULL; |
319 } | 321 } |
320 | 322 |
321 bool CaptureManager::RegisterVideoCapturer(VideoCapturer* video_capturer) { | 323 bool CaptureManager::RegisterVideoCapturer(VideoCapturer* video_capturer) { |
322 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 324 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
323 VideoCapturerState* capture_state = | 325 VideoCapturerState* capture_state = |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 VideoCapturer* video_capturer) const { | 398 VideoCapturer* video_capturer) const { |
397 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 399 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
398 VideoCapturerState* capture_state = GetCaptureState(video_capturer); | 400 VideoCapturerState* capture_state = GetCaptureState(video_capturer); |
399 if (!capture_state) { | 401 if (!capture_state) { |
400 return NULL; | 402 return NULL; |
401 } | 403 } |
402 return capture_state->adapter(); | 404 return capture_state->adapter(); |
403 } | 405 } |
404 | 406 |
405 } // namespace cricket | 407 } // namespace cricket |
OLD | NEW |