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

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

Issue 1486123002: Return a copy of the supported RTP header extensions instead of a reference. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Comments addressed. Created 5 years 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
« no previous file with comments | « no previous file | talk/media/base/mediaengine.h » ('j') | talk/media/webrtc/webrtcvideoengine2.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 687
688 // A base class for all of the shared parts between FakeVoiceEngine 688 // A base class for all of the shared parts between FakeVoiceEngine
689 // and FakeVideoEngine. 689 // and FakeVideoEngine.
690 class FakeBaseEngine { 690 class FakeBaseEngine {
691 public: 691 public:
692 FakeBaseEngine() 692 FakeBaseEngine()
693 : options_changed_(false), 693 : options_changed_(false),
694 fail_create_channel_(false) {} 694 fail_create_channel_(false) {}
695 void set_fail_create_channel(bool fail) { fail_create_channel_ = fail; } 695 void set_fail_create_channel(bool fail) { fail_create_channel_ = fail; }
696 696
697 const std::vector<RtpHeaderExtension>& rtp_header_extensions() const { 697 RtpCapabilities GetCapabilities() const {
698 return rtp_header_extensions_; 698 return capabilities_;
699 } 699 }
700 void set_rtp_header_extensions( 700 void set_rtp_header_extensions(
701 const std::vector<RtpHeaderExtension>& extensions) { 701 const std::vector<RtpHeaderExtension>& extensions) {
702 rtp_header_extensions_ = extensions; 702 capabilities_.header_extensions = extensions;
703 } 703 }
704 704
705 protected: 705 protected:
706 // Flag used by optionsmessagehandler_unittest for checking whether any 706 // Flag used by optionsmessagehandler_unittest for checking whether any
707 // relevant setting has been updated. 707 // relevant setting has been updated.
708 // TODO(thaloun): Replace with explicit checks of before & after values. 708 // TODO(thaloun): Replace with explicit checks of before & after values.
709 bool options_changed_; 709 bool options_changed_;
710 bool fail_create_channel_; 710 bool fail_create_channel_;
711 std::vector<RtpHeaderExtension> rtp_header_extensions_; 711 RtpCapabilities capabilities_;
712 }; 712 };
713 713
714 class FakeVoiceEngine : public FakeBaseEngine { 714 class FakeVoiceEngine : public FakeBaseEngine {
715 public: 715 public:
716 FakeVoiceEngine() 716 FakeVoiceEngine()
717 : output_volume_(-1) { 717 : output_volume_(-1) {
718 // Add a fake audio codec. Note that the name must not be "" as there are 718 // Add a fake audio codec. Note that the name must not be "" as there are
719 // sanity checks against that. 719 // sanity checks against that.
720 codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1, 0)); 720 codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1, 0));
721 } 721 }
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 971
972 private: 972 private:
973 std::vector<FakeDataMediaChannel*> channels_; 973 std::vector<FakeDataMediaChannel*> channels_;
974 std::vector<DataCodec> data_codecs_; 974 std::vector<DataCodec> data_codecs_;
975 DataChannelType last_channel_type_; 975 DataChannelType last_channel_type_;
976 }; 976 };
977 977
978 } // namespace cricket 978 } // namespace cricket
979 979
980 #endif // TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_ 980 #endif // TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_
OLDNEW
« no previous file with comments | « no previous file | talk/media/base/mediaengine.h » ('j') | talk/media/webrtc/webrtcvideoengine2.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698