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

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

Issue 2024153002: Add RtpHeaderExtension to avoid client breakage (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed nits Created 4 years, 6 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
« no previous file with comments | « no previous file | webrtc/media/base/mediachannel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 FakeBaseEngine() 709 FakeBaseEngine()
710 : options_changed_(false), 710 : options_changed_(false),
711 fail_create_channel_(false) {} 711 fail_create_channel_(false) {}
712 void set_fail_create_channel(bool fail) { fail_create_channel_ = fail; } 712 void set_fail_create_channel(bool fail) { fail_create_channel_ = fail; }
713 713
714 RtpCapabilities GetCapabilities() const { return capabilities_; } 714 RtpCapabilities GetCapabilities() const { return capabilities_; }
715 void set_rtp_header_extensions(const std::vector<RtpExtension>& extensions) { 715 void set_rtp_header_extensions(const std::vector<RtpExtension>& extensions) {
716 capabilities_.header_extensions = extensions; 716 capabilities_.header_extensions = extensions;
717 } 717 }
718 718
719 void set_rtp_header_extensions(
720 const std::vector<cricket::RtpHeaderExtension>& extensions) {
721 for (const cricket::RtpHeaderExtension& ext : extensions) {
722 RtpExtension webrtc_ext;
723 webrtc_ext.uri = ext.uri;
724 webrtc_ext.id = ext.id;
725 capabilities_.header_extensions.push_back(webrtc_ext);
726 }
727 }
728
719 protected: 729 protected:
720 // Flag used by optionsmessagehandler_unittest for checking whether any 730 // Flag used by optionsmessagehandler_unittest for checking whether any
721 // relevant setting has been updated. 731 // relevant setting has been updated.
722 // TODO(thaloun): Replace with explicit checks of before & after values. 732 // TODO(thaloun): Replace with explicit checks of before & after values.
723 bool options_changed_; 733 bool options_changed_;
724 bool fail_create_channel_; 734 bool fail_create_channel_;
725 RtpCapabilities capabilities_; 735 RtpCapabilities capabilities_;
726 }; 736 };
727 737
728 class FakeVoiceEngine : public FakeBaseEngine { 738 class FakeVoiceEngine : public FakeBaseEngine {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 864
855 void SetAudioRtpHeaderExtensions( 865 void SetAudioRtpHeaderExtensions(
856 const std::vector<RtpExtension>& extensions) { 866 const std::vector<RtpExtension>& extensions) {
857 voice_.set_rtp_header_extensions(extensions); 867 voice_.set_rtp_header_extensions(extensions);
858 } 868 }
859 void SetVideoRtpHeaderExtensions( 869 void SetVideoRtpHeaderExtensions(
860 const std::vector<RtpExtension>& extensions) { 870 const std::vector<RtpExtension>& extensions) {
861 video_.set_rtp_header_extensions(extensions); 871 video_.set_rtp_header_extensions(extensions);
862 } 872 }
863 873
874 void SetAudioRtpHeaderExtensions(
875 const std::vector<cricket::RtpHeaderExtension>& extensions) {
876 voice_.set_rtp_header_extensions(extensions);
877 }
878 void SetVideoRtpHeaderExtensions(
879 const std::vector<cricket::RtpHeaderExtension>& extensions) {
880 video_.set_rtp_header_extensions(extensions);
881 }
882
864 FakeVoiceMediaChannel* GetVoiceChannel(size_t index) { 883 FakeVoiceMediaChannel* GetVoiceChannel(size_t index) {
865 return voice_.GetChannel(index); 884 return voice_.GetChannel(index);
866 } 885 }
867 FakeVideoMediaChannel* GetVideoChannel(size_t index) { 886 FakeVideoMediaChannel* GetVideoChannel(size_t index) {
868 return video_.GetChannel(index); 887 return video_.GetChannel(index);
869 } 888 }
870 889
871 int output_volume() const { return voice_.output_volume_; } 890 int output_volume() const { return voice_.output_volume_; }
872 bool capture() const { return video_.capture_; } 891 bool capture() const { return video_.capture_; }
873 bool options_changed() const { 892 bool options_changed() const {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 957
939 private: 958 private:
940 std::vector<FakeDataMediaChannel*> channels_; 959 std::vector<FakeDataMediaChannel*> channels_;
941 std::vector<DataCodec> data_codecs_; 960 std::vector<DataCodec> data_codecs_;
942 DataChannelType last_channel_type_; 961 DataChannelType last_channel_type_;
943 }; 962 };
944 963
945 } // namespace cricket 964 } // namespace cricket
946 965
947 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ 966 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/base/mediachannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698