Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 rtc::CritScope lock(&crit_); | 72 rtc::CritScope lock(&crit_); |
| 73 started_ = true; | 73 started_ = true; |
| 74 } | 74 } |
| 75 | 75 |
| 76 void VcmCapturer::Stop() { | 76 void VcmCapturer::Stop() { |
| 77 rtc::CritScope lock(&crit_); | 77 rtc::CritScope lock(&crit_); |
| 78 started_ = false; | 78 started_ = false; |
| 79 } | 79 } |
| 80 | 80 |
| 81 void VcmCapturer::Destroy() { | 81 void VcmCapturer::Destroy() { |
| 82 if (vcm_ == NULL) { | 82 if (!vcm_) |
| 83 return; | 83 return; |
| 84 } | |
| 85 | 84 |
| 86 vcm_->StopCapture(); | 85 vcm_->StopCapture(); |
| 87 vcm_->DeRegisterCaptureDataCallback(); | 86 vcm_->DeRegisterCaptureDataCallback(); |
| 88 vcm_->Release(); | 87 // Release reference to VCM. |
| 89 | 88 vcm_ = nullptr; |
| 90 // TODO(pbos): How do I destroy the VideoCaptureModule? This still leaves | |
|
tommi
2016/03/17 09:15:12
is this still true? (if so, please leave the comme
pbos-webrtc
2016/03/17 15:04:00
Not true anymore, since the creation does AddRef()
tommi
2016/03/17 15:10:56
I'm not following... the previous code already did
pbos-webrtc
2016/03/21 10:04:31
That it did not do AddRef() which is now done impl
tommi
2016/03/21 11:23:21
Oh I see! Yikes, that could also be an invite to
| |
| 91 // non-freed memory. | |
| 92 vcm_ = NULL; | |
| 93 } | 89 } |
| 94 | 90 |
| 95 VcmCapturer::~VcmCapturer() { Destroy(); } | 91 VcmCapturer::~VcmCapturer() { Destroy(); } |
| 96 | 92 |
| 97 void VcmCapturer::OnIncomingCapturedFrame(const int32_t id, | 93 void VcmCapturer::OnIncomingCapturedFrame(const int32_t id, |
| 98 const VideoFrame& frame) { | 94 const VideoFrame& frame) { |
| 99 rtc::CritScope lock(&crit_); | 95 rtc::CritScope lock(&crit_); |
| 100 if (started_) | 96 if (started_) |
| 101 input_->IncomingCapturedFrame(frame); | 97 input_->IncomingCapturedFrame(frame); |
| 102 } | 98 } |
| 103 | 99 |
| 104 void VcmCapturer::OnCaptureDelayChanged(const int32_t id, const int32_t delay) { | 100 void VcmCapturer::OnCaptureDelayChanged(const int32_t id, const int32_t delay) { |
| 105 } | 101 } |
| 106 } // test | 102 } // test |
| 107 } // webrtc | 103 } // webrtc |
| OLD | NEW |