OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2009 Google Inc. | 3 * Copyright 2009 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 189 } |
190 CreateContent(flags1, kPcmuCodec, kH264Codec, | 190 CreateContent(flags1, kPcmuCodec, kH264Codec, |
191 &local_media_content1_); | 191 &local_media_content1_); |
192 CreateContent(flags2, kPcmuCodec, kH264Codec, | 192 CreateContent(flags2, kPcmuCodec, kH264Codec, |
193 &local_media_content2_); | 193 &local_media_content2_); |
194 CopyContent(local_media_content1_, &remote_media_content1_); | 194 CopyContent(local_media_content1_, &remote_media_content1_); |
195 CopyContent(local_media_content2_, &remote_media_content2_); | 195 CopyContent(local_media_content2_, &remote_media_content2_); |
196 | 196 |
197 if (flags1 & DTLS) { | 197 if (flags1 & DTLS) { |
198 // Confirmed to work with KT_RSA and KT_ECDSA. | 198 // Confirmed to work with KT_RSA and KT_ECDSA. |
199 identity1_.reset(rtc::SSLIdentity::Generate("session1", rtc::KT_DEFAULT)); | 199 session1_.set_ssl_rtccertificate(rtc::RTCCertificate::Create( |
200 session1_.set_ssl_identity(identity1_.get()); | 200 rtc::scoped_ptr<rtc::SSLIdentity>(rtc::SSLIdentity::Generate( |
| 201 "session1", rtc::KT_DEFAULT)).Pass())); |
201 } | 202 } |
202 if (flags2 & DTLS) { | 203 if (flags2 & DTLS) { |
203 // Confirmed to work with KT_RSA and KT_ECDSA. | 204 // Confirmed to work with KT_RSA and KT_ECDSA. |
204 identity2_.reset(rtc::SSLIdentity::Generate("session2", rtc::KT_DEFAULT)); | 205 session2_.set_ssl_rtccertificate(rtc::RTCCertificate::Create( |
205 session2_.set_ssl_identity(identity2_.get()); | 206 rtc::scoped_ptr<rtc::SSLIdentity>(rtc::SSLIdentity::Generate( |
| 207 "session2", rtc::KT_DEFAULT)).Pass())); |
206 } | 208 } |
207 | 209 |
208 // Add stream information (SSRC) to the local content but not to the remote | 210 // Add stream information (SSRC) to the local content but not to the remote |
209 // content. This means that we per default know the SSRC of what we send but | 211 // content. This means that we per default know the SSRC of what we send but |
210 // not what we receive. | 212 // not what we receive. |
211 AddLegacyStreamInContent(kSsrc1, flags1, &local_media_content1_); | 213 AddLegacyStreamInContent(kSsrc1, flags1, &local_media_content1_); |
212 AddLegacyStreamInContent(kSsrc2, flags2, &local_media_content2_); | 214 AddLegacyStreamInContent(kSsrc2, flags2, &local_media_content2_); |
213 | 215 |
214 // If SSRC_MUX is used we also need to know the SSRC of the incoming stream. | 216 // If SSRC_MUX is used we also need to know the SSRC of the incoming stream. |
215 if (flags1 & SSRC_MUX) { | 217 if (flags1 & SSRC_MUX) { |
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1784 cricket::FakeMediaEngine media_engine_; | 1786 cricket::FakeMediaEngine media_engine_; |
1785 // The media channels are owned by the voice channel objects below. | 1787 // The media channels are owned by the voice channel objects below. |
1786 typename T::MediaChannel* media_channel1_; | 1788 typename T::MediaChannel* media_channel1_; |
1787 typename T::MediaChannel* media_channel2_; | 1789 typename T::MediaChannel* media_channel2_; |
1788 rtc::scoped_ptr<typename T::Channel> channel1_; | 1790 rtc::scoped_ptr<typename T::Channel> channel1_; |
1789 rtc::scoped_ptr<typename T::Channel> channel2_; | 1791 rtc::scoped_ptr<typename T::Channel> channel2_; |
1790 typename T::Content local_media_content1_; | 1792 typename T::Content local_media_content1_; |
1791 typename T::Content local_media_content2_; | 1793 typename T::Content local_media_content2_; |
1792 typename T::Content remote_media_content1_; | 1794 typename T::Content remote_media_content1_; |
1793 typename T::Content remote_media_content2_; | 1795 typename T::Content remote_media_content2_; |
1794 rtc::scoped_ptr<rtc::SSLIdentity> identity1_; | |
1795 rtc::scoped_ptr<rtc::SSLIdentity> identity2_; | |
1796 // The RTP and RTCP packets to send in the tests. | 1796 // The RTP and RTCP packets to send in the tests. |
1797 std::string rtp_packet_; | 1797 std::string rtp_packet_; |
1798 std::string rtcp_packet_; | 1798 std::string rtcp_packet_; |
1799 int media_info_callbacks1_; | 1799 int media_info_callbacks1_; |
1800 int media_info_callbacks2_; | 1800 int media_info_callbacks2_; |
1801 bool mute_callback_recved_; | 1801 bool mute_callback_recved_; |
1802 bool mute_callback_value_; | 1802 bool mute_callback_value_; |
1803 | 1803 |
1804 uint32 ssrc_; | 1804 uint32 ssrc_; |
1805 typename T::MediaChannel::Error error_; | 1805 typename T::MediaChannel::Error error_; |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2876 }; | 2876 }; |
2877 rtc::Buffer payload(data, 3); | 2877 rtc::Buffer payload(data, 3); |
2878 cricket::SendDataResult result; | 2878 cricket::SendDataResult result; |
2879 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); | 2879 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); |
2880 EXPECT_EQ(params.ssrc, | 2880 EXPECT_EQ(params.ssrc, |
2881 media_channel1_->last_sent_data_params().ssrc); | 2881 media_channel1_->last_sent_data_params().ssrc); |
2882 EXPECT_EQ("foo", media_channel1_->last_sent_data()); | 2882 EXPECT_EQ("foo", media_channel1_->last_sent_data()); |
2883 } | 2883 } |
2884 | 2884 |
2885 // TODO(pthatcher): TestSetReceiver? | 2885 // TODO(pthatcher): TestSetReceiver? |
OLD | NEW |