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

Side by Side Diff: talk/session/media/channel_unittest.cc

Issue 1646253004: Split out dscp option from VideoOptions to new struct MediaChannelOptions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 4 years, 10 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 | « talk/app/webrtc/webrtcsession_unittest.cc ('k') | talk/session/media/channelmanager.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 * 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 transport_controller1_(cricket::ICEROLE_CONTROLLING), 136 transport_controller1_(cricket::ICEROLE_CONTROLLING),
137 transport_controller2_(cricket::ICEROLE_CONTROLLED), 137 transport_controller2_(cricket::ICEROLE_CONTROLLED),
138 media_channel1_(NULL), 138 media_channel1_(NULL),
139 media_channel2_(NULL), 139 media_channel2_(NULL),
140 rtp_packet_(reinterpret_cast<const char*>(rtp_data), rtp_len), 140 rtp_packet_(reinterpret_cast<const char*>(rtp_data), rtp_len),
141 rtcp_packet_(reinterpret_cast<const char*>(rtcp_data), rtcp_len), 141 rtcp_packet_(reinterpret_cast<const char*>(rtcp_data), rtcp_len),
142 media_info_callbacks1_(), 142 media_info_callbacks1_(),
143 media_info_callbacks2_() {} 143 media_info_callbacks2_() {}
144 144
145 void CreateChannels(int flags1, int flags2) { 145 void CreateChannels(int flags1, int flags2) {
146 CreateChannels(new typename T::MediaChannel(NULL, typename T::Options()), 146 CreateChannels(
147 new typename T::MediaChannel(NULL, typename T::Options()), 147 new typename T::MediaChannel(NULL, cricket::MediaChannelOptions(),
148 flags1, flags2, rtc::Thread::Current()); 148 typename T::Options()),
149 new typename T::MediaChannel(NULL, cricket::MediaChannelOptions(),
150 typename T::Options()),
151 flags1, flags2, rtc::Thread::Current());
149 } 152 }
150 void CreateChannels( 153 void CreateChannels(
151 typename T::MediaChannel* ch1, typename T::MediaChannel* ch2, 154 typename T::MediaChannel* ch1, typename T::MediaChannel* ch2,
152 int flags1, int flags2, rtc::Thread* thread) { 155 int flags1, int flags2, rtc::Thread* thread) {
153 media_channel1_ = ch1; 156 media_channel1_ = ch1;
154 media_channel2_ = ch2; 157 media_channel2_ = ch2;
155 channel1_.reset(CreateChannel(thread, &media_engine_, ch1, 158 channel1_.reset(CreateChannel(thread, &media_engine_, ch1,
156 &transport_controller1_, 159 &transport_controller1_,
157 (flags1 & RTCP) != 0)); 160 (flags1 & RTCP) != 0));
158 channel2_.reset(CreateChannel(thread, &media_engine_, ch2, 161 channel2_.reset(CreateChannel(thread, &media_engine_, ch2,
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 EXPECT_EQ(1U, media_channel2_->codecs().size()); 952 EXPECT_EQ(1U, media_channel2_->codecs().size());
950 } 953 }
951 954
952 // Test that we don't crash if packets are sent during call teardown 955 // Test that we don't crash if packets are sent during call teardown
953 // when RTCP mux is enabled. This is a regression test against a specific 956 // when RTCP mux is enabled. This is a regression test against a specific
954 // race condition that would only occur when a RTCP packet was sent during 957 // race condition that would only occur when a RTCP packet was sent during
955 // teardown of a channel on which RTCP mux was enabled. 958 // teardown of a channel on which RTCP mux was enabled.
956 void TestCallTeardownRtcpMux() { 959 void TestCallTeardownRtcpMux() {
957 class LastWordMediaChannel : public T::MediaChannel { 960 class LastWordMediaChannel : public T::MediaChannel {
958 public: 961 public:
959 LastWordMediaChannel() : T::MediaChannel(NULL, typename T::Options()) {} 962 LastWordMediaChannel()
963 : T::MediaChannel(NULL,
964 cricket::MediaChannelOptions(),
965 typename T::Options()) {}
960 ~LastWordMediaChannel() { 966 ~LastWordMediaChannel() {
961 T::MediaChannel::SendRtp(kPcmuFrame, sizeof(kPcmuFrame), 967 T::MediaChannel::SendRtp(kPcmuFrame, sizeof(kPcmuFrame),
962 rtc::PacketOptions()); 968 rtc::PacketOptions());
963 T::MediaChannel::SendRtcp(kRtcpReport, sizeof(kRtcpReport)); 969 T::MediaChannel::SendRtcp(kRtcpReport, sizeof(kRtcpReport));
964 } 970 }
965 }; 971 };
966 CreateChannels(new LastWordMediaChannel(), new LastWordMediaChannel(), 972 CreateChannels(new LastWordMediaChannel(), new LastWordMediaChannel(),
967 RTCP | RTCP_MUX, RTCP | RTCP_MUX, 973 RTCP | RTCP_MUX, RTCP | RTCP_MUX,
968 rtc::Thread::Current()); 974 rtc::Thread::Current());
969 EXPECT_TRUE(SendInitiate()); 975 EXPECT_TRUE(SendInitiate());
(...skipping 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after
2707 }; 2713 };
2708 rtc::Buffer payload(data, 3); 2714 rtc::Buffer payload(data, 3);
2709 cricket::SendDataResult result; 2715 cricket::SendDataResult result;
2710 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); 2716 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result));
2711 EXPECT_EQ(params.ssrc, 2717 EXPECT_EQ(params.ssrc,
2712 media_channel1_->last_sent_data_params().ssrc); 2718 media_channel1_->last_sent_data_params().ssrc);
2713 EXPECT_EQ("foo", media_channel1_->last_sent_data()); 2719 EXPECT_EQ("foo", media_channel1_->last_sent_data());
2714 } 2720 }
2715 2721
2716 // TODO(pthatcher): TestSetReceiver? 2722 // TODO(pthatcher): TestSetReceiver?
OLDNEW
« no previous file with comments | « talk/app/webrtc/webrtcsession_unittest.cc ('k') | talk/session/media/channelmanager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698