OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 void LocalAudioSinkAdapter::SetSink(cricket::AudioRenderer::Sink* sink) { | 55 void LocalAudioSinkAdapter::SetSink(cricket::AudioRenderer::Sink* sink) { |
56 rtc::CritScope lock(&lock_); | 56 rtc::CritScope lock(&lock_); |
57 ASSERT(!sink || !sink_); | 57 ASSERT(!sink || !sink_); |
58 sink_ = sink; | 58 sink_ = sink; |
59 } | 59 } |
60 | 60 |
61 AudioRtpSender::AudioRtpSender(AudioTrackInterface* track, | 61 AudioRtpSender::AudioRtpSender(AudioTrackInterface* track, |
62 uint32 ssrc, | 62 uint32_t ssrc, |
63 AudioProviderInterface* provider) | 63 AudioProviderInterface* provider) |
64 : id_(track->id()), | 64 : id_(track->id()), |
65 track_(track), | 65 track_(track), |
66 ssrc_(ssrc), | 66 ssrc_(ssrc), |
67 provider_(provider), | 67 provider_(provider), |
68 cached_track_enabled_(track->enabled()), | 68 cached_track_enabled_(track->enabled()), |
69 sink_adapter_(new LocalAudioSinkAdapter()) { | 69 sink_adapter_(new LocalAudioSinkAdapter()) { |
70 track_->RegisterObserver(this); | 70 track_->RegisterObserver(this); |
71 track_->AddSink(sink_adapter_.get()); | 71 track_->AddSink(sink_adapter_.get()); |
72 Reconfigure(); | 72 Reconfigure(); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 129 |
130 // Use the renderer if the audio track has one, otherwise use the sink | 130 // Use the renderer if the audio track has one, otherwise use the sink |
131 // adapter owned by this class. | 131 // adapter owned by this class. |
132 cricket::AudioRenderer* renderer = | 132 cricket::AudioRenderer* renderer = |
133 track_->GetRenderer() ? track_->GetRenderer() : sink_adapter_.get(); | 133 track_->GetRenderer() ? track_->GetRenderer() : sink_adapter_.get(); |
134 ASSERT(renderer != nullptr); | 134 ASSERT(renderer != nullptr); |
135 provider_->SetAudioSend(ssrc_, track_->enabled(), options, renderer); | 135 provider_->SetAudioSend(ssrc_, track_->enabled(), options, renderer); |
136 } | 136 } |
137 | 137 |
138 VideoRtpSender::VideoRtpSender(VideoTrackInterface* track, | 138 VideoRtpSender::VideoRtpSender(VideoTrackInterface* track, |
139 uint32 ssrc, | 139 uint32_t ssrc, |
140 VideoProviderInterface* provider) | 140 VideoProviderInterface* provider) |
141 : id_(track->id()), | 141 : id_(track->id()), |
142 track_(track), | 142 track_(track), |
143 ssrc_(ssrc), | 143 ssrc_(ssrc), |
144 provider_(provider), | 144 provider_(provider), |
145 cached_track_enabled_(track->enabled()) { | 145 cached_track_enabled_(track->enabled()) { |
146 track_->RegisterObserver(this); | 146 track_->RegisterObserver(this); |
147 VideoSourceInterface* source = track_->GetSource(); | 147 VideoSourceInterface* source = track_->GetSource(); |
148 if (source) { | 148 if (source) { |
149 provider_->SetCaptureDevice(ssrc_, source->GetVideoCapturer()); | 149 provider_->SetCaptureDevice(ssrc_, source->GetVideoCapturer()); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 198 } |
199 const cricket::VideoOptions* options = nullptr; | 199 const cricket::VideoOptions* options = nullptr; |
200 VideoSourceInterface* source = track_->GetSource(); | 200 VideoSourceInterface* source = track_->GetSource(); |
201 if (track_->enabled() && source) { | 201 if (track_->enabled() && source) { |
202 options = source->options(); | 202 options = source->options(); |
203 } | 203 } |
204 provider_->SetVideoSend(ssrc_, track_->enabled(), options); | 204 provider_->SetVideoSend(ssrc_, track_->enabled(), options); |
205 } | 205 } |
206 | 206 |
207 } // namespace webrtc | 207 } // namespace webrtc |
OLD | NEW |