OLD | NEW |
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 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 } | 907 } |
908 void clear_options_changed() { | 908 void clear_options_changed() { |
909 video_.options_changed_ = false; | 909 video_.options_changed_ = false; |
910 } | 910 } |
911 void set_fail_create_channel(bool fail) { | 911 void set_fail_create_channel(bool fail) { |
912 voice_.set_fail_create_channel(fail); | 912 voice_.set_fail_create_channel(fail); |
913 video_.set_fail_create_channel(fail); | 913 video_.set_fail_create_channel(fail); |
914 } | 914 } |
915 }; | 915 }; |
916 | 916 |
917 // CompositeMediaEngine with FakeVoiceEngine to expose SetAudioCodecs to | |
918 // establish a media connectionwith minimum set of audio codes required | |
919 template <class VIDEO> | |
920 class CompositeMediaEngineWithFakeVoiceEngine : | |
921 public CompositeMediaEngine<FakeVoiceEngine, VIDEO> { | |
922 public: | |
923 CompositeMediaEngineWithFakeVoiceEngine() {} | |
924 virtual ~CompositeMediaEngineWithFakeVoiceEngine() {} | |
925 | |
926 virtual void SetAudioCodecs(const std::vector<AudioCodec>& codecs) { | |
927 CompositeMediaEngine<FakeVoiceEngine, VIDEO>::voice_.SetCodecs(codecs); | |
928 } | |
929 }; | |
930 | |
931 // Have to come afterwards due to declaration order | 917 // Have to come afterwards due to declaration order |
932 inline FakeVoiceMediaChannel::~FakeVoiceMediaChannel() { | 918 inline FakeVoiceMediaChannel::~FakeVoiceMediaChannel() { |
933 if (engine_) { | 919 if (engine_) { |
934 engine_->UnregisterChannel(this); | 920 engine_->UnregisterChannel(this); |
935 } | 921 } |
936 } | 922 } |
937 | 923 |
938 inline FakeVideoMediaChannel::~FakeVideoMediaChannel() { | 924 inline FakeVideoMediaChannel::~FakeVideoMediaChannel() { |
939 if (engine_) { | 925 if (engine_) { |
940 engine_->UnregisterChannel(this); | 926 engine_->UnregisterChannel(this); |
(...skipping 25 matching lines...) Expand all Loading... |
966 virtual const std::vector<DataCodec>& data_codecs() { return data_codecs_; } | 952 virtual const std::vector<DataCodec>& data_codecs() { return data_codecs_; } |
967 | 953 |
968 private: | 954 private: |
969 std::vector<FakeDataMediaChannel*> channels_; | 955 std::vector<FakeDataMediaChannel*> channels_; |
970 std::vector<DataCodec> data_codecs_; | 956 std::vector<DataCodec> data_codecs_; |
971 }; | 957 }; |
972 | 958 |
973 } // namespace cricket | 959 } // namespace cricket |
974 | 960 |
975 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ | 961 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ |
OLD | NEW |