| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 if (output_scalings_.find(ssrc) == output_scalings_.end()) | 342 if (output_scalings_.find(ssrc) == output_scalings_.end()) |
| 343 return false; | 343 return false; |
| 344 *volume = output_scalings_[ssrc]; | 344 *volume = output_scalings_[ssrc]; |
| 345 return true; | 345 return true; |
| 346 } | 346 } |
| 347 | 347 |
| 348 virtual bool GetStats(VoiceMediaInfo* info) { return false; } | 348 virtual bool GetStats(VoiceMediaInfo* info) { return false; } |
| 349 | 349 |
| 350 virtual void SetRawAudioSink( | 350 virtual void SetRawAudioSink( |
| 351 uint32_t ssrc, | 351 uint32_t ssrc, |
| 352 const rtc::scoped_refptr<webrtc::AudioSinkInterface>& sink) { | 352 rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) { |
| 353 sink_ = sink; | 353 sink_ = std::move(sink); |
| 354 } | 354 } |
| 355 | 355 |
| 356 private: | 356 private: |
| 357 class VoiceChannelAudioSink : public AudioRenderer::Sink { | 357 class VoiceChannelAudioSink : public AudioRenderer::Sink { |
| 358 public: | 358 public: |
| 359 explicit VoiceChannelAudioSink(AudioRenderer* renderer) | 359 explicit VoiceChannelAudioSink(AudioRenderer* renderer) |
| 360 : renderer_(renderer) { | 360 : renderer_(renderer) { |
| 361 renderer_->SetSink(this); | 361 renderer_->SetSink(this); |
| 362 } | 362 } |
| 363 virtual ~VoiceChannelAudioSink() { | 363 virtual ~VoiceChannelAudioSink() { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 } | 418 } |
| 419 | 419 |
| 420 FakeVoiceEngine* engine_; | 420 FakeVoiceEngine* engine_; |
| 421 std::vector<AudioCodec> recv_codecs_; | 421 std::vector<AudioCodec> recv_codecs_; |
| 422 std::vector<AudioCodec> send_codecs_; | 422 std::vector<AudioCodec> send_codecs_; |
| 423 std::map<uint32_t, double> output_scalings_; | 423 std::map<uint32_t, double> output_scalings_; |
| 424 std::vector<DtmfInfo> dtmf_info_queue_; | 424 std::vector<DtmfInfo> dtmf_info_queue_; |
| 425 int time_since_last_typing_; | 425 int time_since_last_typing_; |
| 426 AudioOptions options_; | 426 AudioOptions options_; |
| 427 std::map<uint32_t, VoiceChannelAudioSink*> local_renderers_; | 427 std::map<uint32_t, VoiceChannelAudioSink*> local_renderers_; |
| 428 rtc::scoped_refptr<webrtc::AudioSinkInterface> sink_; | 428 rtc::scoped_ptr<webrtc::AudioSinkInterface> sink_; |
| 429 }; | 429 }; |
| 430 | 430 |
| 431 // A helper function to compare the FakeVoiceMediaChannel::DtmfInfo. | 431 // A helper function to compare the FakeVoiceMediaChannel::DtmfInfo. |
| 432 inline bool CompareDtmfInfo(const FakeVoiceMediaChannel::DtmfInfo& info, | 432 inline bool CompareDtmfInfo(const FakeVoiceMediaChannel::DtmfInfo& info, |
| 433 uint32_t ssrc, | 433 uint32_t ssrc, |
| 434 int event_code, | 434 int event_code, |
| 435 int duration) { | 435 int duration) { |
| 436 return (info.duration == duration && info.event_code == event_code && | 436 return (info.duration == duration && info.event_code == event_code && |
| 437 info.ssrc == ssrc); | 437 info.ssrc == ssrc); |
| 438 } | 438 } |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 | 939 |
| 940 private: | 940 private: |
| 941 std::vector<FakeDataMediaChannel*> channels_; | 941 std::vector<FakeDataMediaChannel*> channels_; |
| 942 std::vector<DataCodec> data_codecs_; | 942 std::vector<DataCodec> data_codecs_; |
| 943 DataChannelType last_channel_type_; | 943 DataChannelType last_channel_type_; |
| 944 }; | 944 }; |
| 945 | 945 |
| 946 } // namespace cricket | 946 } // namespace cricket |
| 947 | 947 |
| 948 #endif // TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_ | 948 #endif // TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_ |
| OLD | NEW |