OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 virtual bool SetPlayout(bool playout) { | 268 virtual bool SetPlayout(bool playout) { |
269 set_playout(playout); | 269 set_playout(playout); |
270 return true; | 270 return true; |
271 } | 271 } |
272 virtual bool SetSend(SendFlags flag) { | 272 virtual bool SetSend(SendFlags flag) { |
273 if (fail_set_send_) { | 273 if (fail_set_send_) { |
274 return false; | 274 return false; |
275 } | 275 } |
276 return set_sending(flag != SEND_NOTHING); | 276 return set_sending(flag != SEND_NOTHING); |
277 } | 277 } |
278 virtual bool SetAudioSend(uint32 ssrc, bool mute, | 278 virtual bool SetAudioSend(uint32 ssrc, bool enable, |
279 const AudioOptions* options, | 279 const AudioOptions* options, |
280 AudioRenderer* renderer) { | 280 AudioRenderer* renderer) { |
281 if (!SetLocalRenderer(ssrc, renderer)) { | 281 if (!SetLocalRenderer(ssrc, renderer)) { |
282 return false; | 282 return false; |
283 } | 283 } |
284 if (!RtpHelper<VoiceMediaChannel>::MuteStream(ssrc, mute)) { | 284 if (!RtpHelper<VoiceMediaChannel>::MuteStream(ssrc, !enable)) { |
285 return false; | 285 return false; |
286 } | 286 } |
287 if (!mute && options) { | 287 if (enable && options) { |
288 return SetOptions(*options); | 288 return SetOptions(*options); |
289 } | 289 } |
290 return true; | 290 return true; |
291 } | 291 } |
292 virtual bool AddRecvStream(const StreamParams& sp) { | 292 virtual bool AddRecvStream(const StreamParams& sp) { |
293 if (!RtpHelper<VoiceMediaChannel>::AddRecvStream(sp)) | 293 if (!RtpHelper<VoiceMediaChannel>::AddRecvStream(sp)) |
294 return false; | 294 return false; |
295 output_scalings_[sp.first_ssrc()] = OutputScaling(); | 295 output_scalings_[sp.first_ssrc()] = OutputScaling(); |
296 return true; | 296 return true; |
297 } | 297 } |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 if (ssrc != 0 && renderers_.find(ssrc) == renderers_.end()) { | 543 if (ssrc != 0 && renderers_.find(ssrc) == renderers_.end()) { |
544 return false; | 544 return false; |
545 } | 545 } |
546 if (ssrc != 0) { | 546 if (ssrc != 0) { |
547 renderers_[ssrc] = r; | 547 renderers_[ssrc] = r; |
548 } | 548 } |
549 return true; | 549 return true; |
550 } | 550 } |
551 | 551 |
552 virtual bool SetSend(bool send) { return set_sending(send); } | 552 virtual bool SetSend(bool send) { return set_sending(send); } |
553 virtual bool SetVideoSend(uint32 ssrc, bool mute, | 553 virtual bool SetVideoSend(uint32 ssrc, bool enable, |
554 const VideoOptions* options) { | 554 const VideoOptions* options) { |
555 if (!RtpHelper<VideoMediaChannel>::MuteStream(ssrc, mute)) { | 555 if (!RtpHelper<VideoMediaChannel>::MuteStream(ssrc, !enable)) { |
556 return false; | 556 return false; |
557 } | 557 } |
558 if (!mute && options) { | 558 if (enable && options) { |
559 return SetOptions(*options); | 559 return SetOptions(*options); |
560 } | 560 } |
561 return true; | 561 return true; |
562 } | 562 } |
563 virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) { | 563 virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) { |
564 capturers_[ssrc] = capturer; | 564 capturers_[ssrc] = capturer; |
565 return true; | 565 return true; |
566 } | 566 } |
567 bool HasCapturer(uint32 ssrc) const { | 567 bool HasCapturer(uint32 ssrc) const { |
568 return capturers_.find(ssrc) != capturers_.end(); | 568 return capturers_.find(ssrc) != capturers_.end(); |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 | 1019 |
1020 private: | 1020 private: |
1021 std::vector<FakeDataMediaChannel*> channels_; | 1021 std::vector<FakeDataMediaChannel*> channels_; |
1022 std::vector<DataCodec> data_codecs_; | 1022 std::vector<DataCodec> data_codecs_; |
1023 DataChannelType last_channel_type_; | 1023 DataChannelType last_channel_type_; |
1024 }; | 1024 }; |
1025 | 1025 |
1026 } // namespace cricket | 1026 } // namespace cricket |
1027 | 1027 |
1028 #endif // TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_ | 1028 #endif // TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_ |
OLD | NEW |