Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: webrtc/media/base/fakemediaengine.h

Issue 2770233003: Implemented the GetSources() in native code. (Closed)
Patch Set: Merge and add the tests. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 411 }
412 bool GetOutputVolume(uint32_t ssrc, double* volume) { 412 bool GetOutputVolume(uint32_t ssrc, double* volume) {
413 if (output_scalings_.find(ssrc) == output_scalings_.end()) 413 if (output_scalings_.find(ssrc) == output_scalings_.end())
414 return false; 414 return false;
415 *volume = output_scalings_[ssrc]; 415 *volume = output_scalings_[ssrc];
416 return true; 416 return true;
417 } 417 }
418 418
419 virtual bool GetStats(VoiceMediaInfo* info) { return false; } 419 virtual bool GetStats(VoiceMediaInfo* info) { return false; }
420 420
421 virtual const std::vector<webrtc::RtpContributingSource*>&
422 GetContributingSources(uint32_t ssrc) {
423 return contributing_sources_;
424 }
425
421 virtual void SetRawAudioSink( 426 virtual void SetRawAudioSink(
422 uint32_t ssrc, 427 uint32_t ssrc,
423 std::unique_ptr<webrtc::AudioSinkInterface> sink) { 428 std::unique_ptr<webrtc::AudioSinkInterface> sink) {
424 sink_ = std::move(sink); 429 sink_ = std::move(sink);
425 } 430 }
426 431
427 private: 432 private:
428 class VoiceChannelAudioSink : public AudioSource::Sink { 433 class VoiceChannelAudioSink : public AudioSource::Sink {
429 public: 434 public:
430 explicit VoiceChannelAudioSink(AudioSource* source) : source_(source) { 435 explicit VoiceChannelAudioSink(AudioSource* source) : source_(source) {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 497
493 FakeVoiceEngine* engine_; 498 FakeVoiceEngine* engine_;
494 std::vector<AudioCodec> recv_codecs_; 499 std::vector<AudioCodec> recv_codecs_;
495 std::vector<AudioCodec> send_codecs_; 500 std::vector<AudioCodec> send_codecs_;
496 std::map<uint32_t, double> output_scalings_; 501 std::map<uint32_t, double> output_scalings_;
497 std::vector<DtmfInfo> dtmf_info_queue_; 502 std::vector<DtmfInfo> dtmf_info_queue_;
498 AudioOptions options_; 503 AudioOptions options_;
499 std::map<uint32_t, VoiceChannelAudioSink*> local_sinks_; 504 std::map<uint32_t, VoiceChannelAudioSink*> local_sinks_;
500 std::unique_ptr<webrtc::AudioSinkInterface> sink_; 505 std::unique_ptr<webrtc::AudioSinkInterface> sink_;
501 int max_bps_; 506 int max_bps_;
507 std::vector<webrtc::RtpContributingSource*> contributing_sources_;
502 }; 508 };
503 509
504 // A helper function to compare the FakeVoiceMediaChannel::DtmfInfo. 510 // A helper function to compare the FakeVoiceMediaChannel::DtmfInfo.
505 inline bool CompareDtmfInfo(const FakeVoiceMediaChannel::DtmfInfo& info, 511 inline bool CompareDtmfInfo(const FakeVoiceMediaChannel::DtmfInfo& info,
506 uint32_t ssrc, 512 uint32_t ssrc,
507 int event_code, 513 int event_code,
508 int duration) { 514 int duration) {
509 return (info.duration == duration && info.event_code == event_code && 515 return (info.duration == duration && info.event_code == event_code &&
510 info.ssrc == ssrc); 516 info.ssrc == ssrc);
511 } 517 }
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 virtual const std::vector<DataCodec>& data_codecs() { return data_codecs_; } 968 virtual const std::vector<DataCodec>& data_codecs() { return data_codecs_; }
963 969
964 private: 970 private:
965 std::vector<FakeDataMediaChannel*> channels_; 971 std::vector<FakeDataMediaChannel*> channels_;
966 std::vector<DataCodec> data_codecs_; 972 std::vector<DataCodec> data_codecs_;
967 }; 973 };
968 974
969 } // namespace cricket 975 } // namespace cricket
970 976
971 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ 977 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698