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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 std::string last_sent_data_; | 687 std::string last_sent_data_; |
688 bool send_blocked_; | 688 bool send_blocked_; |
689 int max_bps_; | 689 int max_bps_; |
690 }; | 690 }; |
691 | 691 |
692 // A base class for all of the shared parts between FakeVoiceEngine | 692 // A base class for all of the shared parts between FakeVoiceEngine |
693 // and FakeVideoEngine. | 693 // and FakeVideoEngine. |
694 class FakeBaseEngine { | 694 class FakeBaseEngine { |
695 public: | 695 public: |
696 FakeBaseEngine() | 696 FakeBaseEngine() |
697 : loglevel_(-1), | 697 : options_changed_(false), |
698 options_changed_(false), | |
699 fail_create_channel_(false) {} | 698 fail_create_channel_(false) {} |
700 void SetLogging(int level, const char* filter) { | |
701 loglevel_ = level; | |
702 logfilter_ = filter; | |
703 } | |
704 | |
705 void set_fail_create_channel(bool fail) { fail_create_channel_ = fail; } | 699 void set_fail_create_channel(bool fail) { fail_create_channel_ = fail; } |
706 | 700 |
707 const std::vector<RtpHeaderExtension>& rtp_header_extensions() const { | 701 const std::vector<RtpHeaderExtension>& rtp_header_extensions() const { |
708 return rtp_header_extensions_; | 702 return rtp_header_extensions_; |
709 } | 703 } |
710 void set_rtp_header_extensions( | 704 void set_rtp_header_extensions( |
711 const std::vector<RtpHeaderExtension>& extensions) { | 705 const std::vector<RtpHeaderExtension>& extensions) { |
712 rtp_header_extensions_ = extensions; | 706 rtp_header_extensions_ = extensions; |
713 } | 707 } |
714 | 708 |
715 protected: | 709 protected: |
716 int loglevel_; | |
717 std::string logfilter_; | |
718 // Flag used by optionsmessagehandler_unittest for checking whether any | 710 // Flag used by optionsmessagehandler_unittest for checking whether any |
719 // relevant setting has been updated. | 711 // relevant setting has been updated. |
720 // TODO(thaloun): Replace with explicit checks of before & after values. | 712 // TODO(thaloun): Replace with explicit checks of before & after values. |
721 bool options_changed_; | 713 bool options_changed_; |
722 bool fail_create_channel_; | 714 bool fail_create_channel_; |
723 std::vector<RtpHeaderExtension> rtp_header_extensions_; | 715 std::vector<RtpHeaderExtension> rtp_header_extensions_; |
724 }; | 716 }; |
725 | 717 |
726 class FakeVoiceEngine : public FakeBaseEngine { | 718 class FakeVoiceEngine : public FakeBaseEngine { |
727 public: | 719 public: |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 return video_.GetChannel(index); | 898 return video_.GetChannel(index); |
907 } | 899 } |
908 | 900 |
909 AudioOptions audio_options() const { return voice_.options_; } | 901 AudioOptions audio_options() const { return voice_.options_; } |
910 int output_volume() const { return voice_.output_volume_; } | 902 int output_volume() const { return voice_.output_volume_; } |
911 const VideoEncoderConfig& default_video_encoder_config() const { | 903 const VideoEncoderConfig& default_video_encoder_config() const { |
912 return video_.default_encoder_config_; | 904 return video_.default_encoder_config_; |
913 } | 905 } |
914 const std::string& audio_in_device() const { return voice_.in_device_; } | 906 const std::string& audio_in_device() const { return voice_.in_device_; } |
915 const std::string& audio_out_device() const { return voice_.out_device_; } | 907 const std::string& audio_out_device() const { return voice_.out_device_; } |
916 int voice_loglevel() const { return voice_.loglevel_; } | |
917 const std::string& voice_logfilter() const { return voice_.logfilter_; } | |
918 int video_loglevel() const { return video_.loglevel_; } | |
919 const std::string& video_logfilter() const { return video_.logfilter_; } | |
920 bool capture() const { return video_.capture_; } | 908 bool capture() const { return video_.capture_; } |
921 bool options_changed() const { | 909 bool options_changed() const { |
922 return voice_.options_changed_ || video_.options_changed_; | 910 return voice_.options_changed_ || video_.options_changed_; |
923 } | 911 } |
924 void clear_options_changed() { | 912 void clear_options_changed() { |
925 video_.options_changed_ = false; | 913 video_.options_changed_ = false; |
926 voice_.options_changed_ = false; | 914 voice_.options_changed_ = false; |
927 } | 915 } |
928 void set_fail_create_channel(bool fail) { | 916 void set_fail_create_channel(bool fail) { |
929 voice_.set_fail_create_channel(fail); | 917 voice_.set_fail_create_channel(fail); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 | 975 |
988 private: | 976 private: |
989 std::vector<FakeDataMediaChannel*> channels_; | 977 std::vector<FakeDataMediaChannel*> channels_; |
990 std::vector<DataCodec> data_codecs_; | 978 std::vector<DataCodec> data_codecs_; |
991 DataChannelType last_channel_type_; | 979 DataChannelType last_channel_type_; |
992 }; | 980 }; |
993 | 981 |
994 } // namespace cricket | 982 } // namespace cricket |
995 | 983 |
996 #endif // TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_ | 984 #endif // TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_ |
OLD | NEW |