Remove VideoMediaChannel::SetRender().
Was a no-op in current implementation. BUG= R=pthatcher@webrtc.org Review URL: https://codereview.webrtc.org/1334793003 . Cr-Commit-Position: refs/heads/master@{#10059}
This commit is contained in:
@ -539,10 +539,6 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
|
||||
*send_codec = send_codecs_[0];
|
||||
return true;
|
||||
}
|
||||
virtual bool SetRender(bool render) {
|
||||
set_playout(render);
|
||||
return true;
|
||||
}
|
||||
virtual bool SetRenderer(uint32 ssrc, VideoRenderer* r) {
|
||||
if (ssrc != 0 && renderers_.find(ssrc) == renderers_.end()) {
|
||||
return false;
|
||||
|
@ -1140,8 +1140,6 @@ class VideoMediaChannel : public MediaChannel {
|
||||
virtual bool GetSendCodec(VideoCodec* send_codec) = 0;
|
||||
// Sets the format of a specified outgoing stream.
|
||||
virtual bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format) = 0;
|
||||
// Starts or stops playout of received video.
|
||||
virtual bool SetRender(bool render) = 0;
|
||||
// Starts or stops transmission (and potentially capture) of local video.
|
||||
virtual bool SetSend(bool send) = 0;
|
||||
// Configure stream for sending.
|
||||
|
@ -769,7 +769,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
void SendAndReceive(const cricket::VideoCodec& codec) {
|
||||
EXPECT_TRUE(SetOneCodec(codec));
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_TRUE(channel_->SetRenderer(kDefaultReceiveSsrc, &renderer_));
|
||||
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
||||
EXPECT_TRUE(SendFrame());
|
||||
@ -782,7 +781,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
cricket::VideoCodec codec(DefaultCodec());
|
||||
EXPECT_TRUE(SetOneCodec(codec));
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_TRUE(channel_->SetRenderer(kDefaultReceiveSsrc, &renderer_));
|
||||
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
||||
EXPECT_TRUE(WaitAndSendFrame(30));
|
||||
@ -804,7 +802,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
int duration_sec, int fps) {
|
||||
EXPECT_TRUE(SetOneCodec(codec));
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_TRUE(channel_->SetRenderer(kDefaultReceiveSsrc, &renderer_));
|
||||
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
||||
for (int i = 0; i < duration_sec; ++i) {
|
||||
@ -887,7 +884,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
cricket::StreamParams::CreateLegacy(2)));
|
||||
EXPECT_TRUE(channel_->SetRenderer(1, &renderer1));
|
||||
EXPECT_TRUE(channel_->SetRenderer(2, &renderer2));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_EQ(0, renderer1.num_rendered_frames());
|
||||
EXPECT_EQ(0, renderer2.num_rendered_frames());
|
||||
std::vector<uint32> ssrcs;
|
||||
@ -937,7 +933,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_TRUE(channel_->SetRenderer(kSsrc, &renderer_));
|
||||
channel_->UpdateAspectRatio(640, 400);
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_TRUE(SendFrame());
|
||||
EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout);
|
||||
EXPECT_FRAME_WAIT(1, DefaultCodec().width, DefaultCodec().height, kTimeout);
|
||||
@ -1054,7 +1049,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
channel_->SetRenderer(kDefaultReceiveSsrc, NULL);
|
||||
EXPECT_TRUE(SetDefaultCodec());
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
||||
channel_->OnPacketReceived(&packet1, rtc::PacketTime());
|
||||
EXPECT_TRUE(channel_->SetRenderer(kDefaultReceiveSsrc, &renderer_));
|
||||
@ -1077,7 +1071,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
void AddRemoveSendStreams() {
|
||||
EXPECT_TRUE(SetOneCodec(DefaultCodec()));
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_TRUE(channel_->SetRenderer(kDefaultReceiveSsrc, &renderer_));
|
||||
EXPECT_TRUE(SendFrame());
|
||||
EXPECT_FRAME_WAIT(1, DefaultCodec().width, DefaultCodec().height, kTimeout);
|
||||
@ -1203,7 +1196,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
cricket::FakeVideoRenderer renderer1;
|
||||
EXPECT_TRUE(SetDefaultCodec());
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_TRUE(channel_->AddRecvStream(
|
||||
cricket::StreamParams::CreateLegacy(kSsrc)));
|
||||
EXPECT_TRUE(channel_->SetRenderer(kSsrc, &renderer1));
|
||||
@ -1248,7 +1240,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
parameters.options.conference_mode.Set(true);
|
||||
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_TRUE(channel_->AddRecvStream(
|
||||
cricket::StreamParams::CreateLegacy(1)));
|
||||
EXPECT_TRUE(channel_->AddRecvStream(
|
||||
@ -1285,7 +1276,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
const int time_between_send = TimeBetweenSend(codec);
|
||||
EXPECT_TRUE(SetOneCodec(codec));
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_TRUE(channel_->SetRenderer(kDefaultReceiveSsrc, &renderer_));
|
||||
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
||||
EXPECT_TRUE(SendFrame());
|
||||
@ -1347,7 +1337,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
void RemoveCapturerWithoutAdd() {
|
||||
EXPECT_TRUE(SetOneCodec(DefaultCodec()));
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_TRUE(channel_->SetRenderer(kDefaultReceiveSsrc, &renderer_));
|
||||
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
||||
EXPECT_TRUE(SendFrame());
|
||||
@ -1412,7 +1401,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_TRUE(channel_->SetCapturer(1, capturer1.get()));
|
||||
EXPECT_TRUE(channel_->SetCapturer(2, capturer2.get()));
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
// Test capturer associated with engine.
|
||||
const int kTestWidth = 160;
|
||||
const int kTestHeight = 120;
|
||||
@ -1449,7 +1437,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_TRUE(channel_->AddRecvStream(
|
||||
cricket::StreamParams::CreateLegacy(kSsrc)));
|
||||
EXPECT_TRUE(channel_->SetRenderer(kSsrc, &renderer));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_EQ(0, renderer.num_rendered_frames());
|
||||
|
||||
EXPECT_TRUE(SendFrame());
|
||||
@ -1512,7 +1499,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
codec.width = codec.height = codec.framerate = 0;
|
||||
EXPECT_TRUE(SetOneCodec(codec));
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_TRUE(channel_->SetRenderer(kDefaultReceiveSsrc, &renderer_));
|
||||
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
||||
EXPECT_TRUE(SendFrame());
|
||||
@ -1528,7 +1514,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
// The capturer runs at 30 fps. The channel requires 30 fps.
|
||||
EXPECT_TRUE(SetOneCodec(codec));
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_EQ(frame_count, renderer_.num_rendered_frames());
|
||||
EXPECT_TRUE(WaitAndSendFrame(0)); // Should be rendered.
|
||||
EXPECT_TRUE(WaitAndSendFrame(30)); // Should be rendered.
|
||||
@ -1574,7 +1559,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
codec.height = 240;
|
||||
EXPECT_TRUE(SetOneCodec(codec));
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_TRUE(channel_->SetRenderer(kDefaultReceiveSsrc, &renderer_));
|
||||
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
||||
EXPECT_TRUE(SendFrame());
|
||||
@ -1624,7 +1608,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_TRUE(SetOneCodec(DefaultCodec()));
|
||||
EXPECT_TRUE(SetSendStreamFormat(kSsrc, DefaultCodec()));
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_TRUE(channel_->SetRenderer(kDefaultReceiveSsrc, &renderer_));
|
||||
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
||||
// This frame should be received.
|
||||
@ -1656,7 +1639,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
cricket::FOURCC_I420));
|
||||
EXPECT_TRUE(channel_->SetCapturer(kSsrc, &video_capturer));
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_TRUE(channel_->SetRenderer(kDefaultReceiveSsrc, &renderer_));
|
||||
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
||||
// Mute the channel and expect black output frame.
|
||||
@ -1770,7 +1752,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_TRUE(channel_->SetSendParameters(parameters));
|
||||
SetUpSecondStreamWithNoRecv();
|
||||
// Test sending and receiving on first stream.
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
Send(codec);
|
||||
EXPECT_EQ_WAIT(2, NumRtpPackets(), kTimeout);
|
||||
EXPECT_EQ_WAIT(1, renderer_.num_rendered_frames(), kTimeout);
|
||||
@ -1805,7 +1786,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_TRUE(channel_->SetOptions(vmo));
|
||||
SetUpSecondStreamWithNoRecv();
|
||||
// Sending and receiving on first stream.
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
Send(codec);
|
||||
EXPECT_EQ_WAIT(2, NumRtpPackets(), kTimeout);
|
||||
EXPECT_EQ_WAIT(1, renderer_.num_rendered_frames(), kTimeout);
|
||||
|
@ -1021,12 +1021,6 @@ bool WebRtcVideoChannel2::SetSendStreamFormat(uint32 ssrc,
|
||||
return send_streams_[ssrc]->SetVideoFormat(format);
|
||||
}
|
||||
|
||||
bool WebRtcVideoChannel2::SetRender(bool render) {
|
||||
// TODO(pbos): Implement. Or refactor away as it shouldn't be needed.
|
||||
LOG(LS_VERBOSE) << "SetRender: " << (render ? "true" : "false");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WebRtcVideoChannel2::SetSend(bool send) {
|
||||
LOG(LS_VERBOSE) << "SetSend: " << (send ? "true" : "false");
|
||||
if (send && !send_codec_.IsSet()) {
|
||||
|
@ -170,7 +170,6 @@ class WebRtcVideoChannel2 : public rtc::MessageHandler,
|
||||
bool SetRecvParameters(const VideoRecvParameters& params) override;
|
||||
bool GetSendCodec(VideoCodec* send_codec) override;
|
||||
bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format) override;
|
||||
bool SetRender(bool render) override;
|
||||
bool SetSend(bool send) override;
|
||||
bool SetVideoSend(uint32 ssrc, bool mute,
|
||||
const VideoOptions* options) override;
|
||||
|
@ -889,7 +889,6 @@ TEST_F(WebRtcVideoChannel2BaseTest, DISABLED_SendVp8HdAndReceiveAdaptedVp8Vga) {
|
||||
codec.width /= 2;
|
||||
codec.height /= 2;
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
||||
EXPECT_TRUE(SendFrame());
|
||||
EXPECT_FRAME_WAIT(1, codec.width, codec.height, kTimeout);
|
||||
@ -1458,10 +1457,6 @@ TEST_F(WebRtcVideoChannel2Test, DISABLED_AddRemoveRecvStreamConference) {
|
||||
FAIL() << "Not implemented."; // TODO(pbos): Implement.
|
||||
}
|
||||
|
||||
TEST_F(WebRtcVideoChannel2Test, DISABLED_SetRender) {
|
||||
FAIL() << "Not implemented."; // TODO(pbos): Implement.
|
||||
}
|
||||
|
||||
TEST_F(WebRtcVideoChannel2Test, DISABLED_SetBandwidthAuto) {
|
||||
FAIL() << "Not implemented."; // TODO(pbos): Implement.
|
||||
}
|
||||
@ -1825,7 +1820,6 @@ TEST_F(WebRtcVideoChannel2Test, EstimatesNtpStartTimeAndElapsedTimeCorrectly) {
|
||||
FakeVideoReceiveStream* stream = AddRecvStream();
|
||||
cricket::FakeVideoRenderer renderer;
|
||||
EXPECT_TRUE(channel_->SetRenderer(last_ssrc_, &renderer));
|
||||
EXPECT_TRUE(channel_->SetRender(true));
|
||||
|
||||
webrtc::VideoFrame video_frame;
|
||||
CreateBlackFrame(&video_frame, 4, 4);
|
||||
|
@ -1743,14 +1743,6 @@ bool VideoChannel::SetVideoSend(uint32 ssrc,
|
||||
}
|
||||
|
||||
void VideoChannel::ChangeState() {
|
||||
// Render incoming data if we're the active call, and we have the local
|
||||
// content. We receive data on the default channel and multiplexed streams.
|
||||
bool recv = IsReadyToReceive();
|
||||
if (!media_channel()->SetRender(recv)) {
|
||||
LOG(LS_ERROR) << "Failed to SetRender on video channel";
|
||||
// TODO(gangji): Report error back to server.
|
||||
}
|
||||
|
||||
// Send outgoing data if we're the active call, we have the remote content,
|
||||
// and we have had some form of connectivity.
|
||||
bool send = IsReadyToSend();
|
||||
@ -1759,7 +1751,7 @@ void VideoChannel::ChangeState() {
|
||||
// TODO(gangji): Report error back to server.
|
||||
}
|
||||
|
||||
LOG(LS_INFO) << "Changing video state, recv=" << recv << " send=" << send;
|
||||
LOG(LS_INFO) << "Changing video state, send=" << send;
|
||||
}
|
||||
|
||||
bool VideoChannel::GetStats(VideoMediaInfo* stats) {
|
||||
|
@ -126,11 +126,13 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
|
||||
enum Flags { RTCP = 0x1, RTCP_MUX = 0x2, SECURE = 0x4, SSRC_MUX = 0x8,
|
||||
DTLS = 0x10 };
|
||||
|
||||
ChannelTest(const uint8* rtp_data,
|
||||
ChannelTest(bool verify_playout,
|
||||
const uint8* rtp_data,
|
||||
int rtp_len,
|
||||
const uint8* rtcp_data,
|
||||
int rtcp_len)
|
||||
: transport_controller1_(cricket::ICEROLE_CONTROLLING),
|
||||
: verify_playout_(verify_playout),
|
||||
transport_controller1_(cricket::ICEROLE_CONTROLLING),
|
||||
transport_controller2_(cricket::ICEROLE_CONTROLLED),
|
||||
media_channel1_(NULL),
|
||||
media_channel2_(NULL),
|
||||
@ -489,7 +491,9 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
|
||||
CreateChannels(0, 0);
|
||||
EXPECT_FALSE(channel1_->secure());
|
||||
EXPECT_FALSE(media_channel1_->sending());
|
||||
EXPECT_FALSE(media_channel1_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_FALSE(media_channel1_->playout());
|
||||
}
|
||||
EXPECT_TRUE(media_channel1_->codecs().empty());
|
||||
EXPECT_TRUE(media_channel1_->recv_streams().empty());
|
||||
EXPECT_TRUE(media_channel1_->rtp_packets().empty());
|
||||
@ -816,36 +820,56 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
|
||||
// Test that we only start playout and sending at the right times.
|
||||
void TestPlayoutAndSendingStates() {
|
||||
CreateChannels(0, 0);
|
||||
EXPECT_FALSE(media_channel1_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_FALSE(media_channel1_->playout());
|
||||
}
|
||||
EXPECT_FALSE(media_channel1_->sending());
|
||||
EXPECT_FALSE(media_channel2_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_FALSE(media_channel2_->playout());
|
||||
}
|
||||
EXPECT_FALSE(media_channel2_->sending());
|
||||
EXPECT_TRUE(channel1_->Enable(true));
|
||||
EXPECT_FALSE(media_channel1_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_FALSE(media_channel1_->playout());
|
||||
}
|
||||
EXPECT_FALSE(media_channel1_->sending());
|
||||
EXPECT_TRUE(channel1_->SetLocalContent(&local_media_content1_,
|
||||
CA_OFFER, NULL));
|
||||
EXPECT_TRUE(media_channel1_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_TRUE(media_channel1_->playout());
|
||||
}
|
||||
EXPECT_FALSE(media_channel1_->sending());
|
||||
EXPECT_TRUE(channel2_->SetRemoteContent(&local_media_content1_,
|
||||
CA_OFFER, NULL));
|
||||
EXPECT_FALSE(media_channel2_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_FALSE(media_channel2_->playout());
|
||||
}
|
||||
EXPECT_FALSE(media_channel2_->sending());
|
||||
EXPECT_TRUE(channel2_->SetLocalContent(&local_media_content2_,
|
||||
CA_ANSWER, NULL));
|
||||
EXPECT_FALSE(media_channel2_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_FALSE(media_channel2_->playout());
|
||||
}
|
||||
EXPECT_FALSE(media_channel2_->sending());
|
||||
transport_controller1_.Connect(&transport_controller2_);
|
||||
EXPECT_TRUE(media_channel1_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_TRUE(media_channel1_->playout());
|
||||
}
|
||||
EXPECT_FALSE(media_channel1_->sending());
|
||||
EXPECT_FALSE(media_channel2_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_FALSE(media_channel2_->playout());
|
||||
}
|
||||
EXPECT_FALSE(media_channel2_->sending());
|
||||
EXPECT_TRUE(channel2_->Enable(true));
|
||||
EXPECT_TRUE(media_channel2_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_TRUE(media_channel2_->playout());
|
||||
}
|
||||
EXPECT_TRUE(media_channel2_->sending());
|
||||
EXPECT_TRUE(channel1_->SetRemoteContent(&local_media_content2_,
|
||||
CA_ANSWER, NULL));
|
||||
EXPECT_TRUE(media_channel1_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_TRUE(media_channel1_->playout());
|
||||
}
|
||||
EXPECT_TRUE(media_channel1_->sending());
|
||||
}
|
||||
|
||||
@ -862,9 +886,13 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
|
||||
|
||||
EXPECT_TRUE(channel1_->Enable(true));
|
||||
EXPECT_TRUE(channel2_->Enable(true));
|
||||
EXPECT_FALSE(media_channel1_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_FALSE(media_channel1_->playout());
|
||||
}
|
||||
EXPECT_FALSE(media_channel1_->sending());
|
||||
EXPECT_FALSE(media_channel2_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_FALSE(media_channel2_->playout());
|
||||
}
|
||||
EXPECT_FALSE(media_channel2_->sending());
|
||||
|
||||
EXPECT_TRUE(channel1_->SetLocalContent(&content1, CA_OFFER, NULL));
|
||||
@ -873,9 +901,13 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
|
||||
EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_PRANSWER, NULL));
|
||||
transport_controller1_.Connect(&transport_controller2_);
|
||||
|
||||
EXPECT_TRUE(media_channel1_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_TRUE(media_channel1_->playout());
|
||||
}
|
||||
EXPECT_FALSE(media_channel1_->sending()); // remote InActive
|
||||
EXPECT_FALSE(media_channel2_->playout()); // local InActive
|
||||
if (verify_playout_) {
|
||||
EXPECT_FALSE(media_channel2_->playout()); // local InActive
|
||||
}
|
||||
EXPECT_FALSE(media_channel2_->sending()); // local InActive
|
||||
|
||||
// Update |content2| to be RecvOnly.
|
||||
@ -883,9 +915,13 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
|
||||
EXPECT_TRUE(channel2_->SetLocalContent(&content2, CA_PRANSWER, NULL));
|
||||
EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_PRANSWER, NULL));
|
||||
|
||||
EXPECT_TRUE(media_channel1_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_TRUE(media_channel1_->playout());
|
||||
}
|
||||
EXPECT_TRUE(media_channel1_->sending());
|
||||
EXPECT_TRUE(media_channel2_->playout()); // local RecvOnly
|
||||
if (verify_playout_) {
|
||||
EXPECT_TRUE(media_channel2_->playout()); // local RecvOnly
|
||||
}
|
||||
EXPECT_FALSE(media_channel2_->sending()); // local RecvOnly
|
||||
|
||||
// Update |content2| to be SendRecv.
|
||||
@ -893,9 +929,13 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
|
||||
EXPECT_TRUE(channel2_->SetLocalContent(&content2, CA_ANSWER, NULL));
|
||||
EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_ANSWER, NULL));
|
||||
|
||||
EXPECT_TRUE(media_channel1_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_TRUE(media_channel1_->playout());
|
||||
}
|
||||
EXPECT_TRUE(media_channel1_->sending());
|
||||
EXPECT_TRUE(media_channel2_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_TRUE(media_channel2_->playout());
|
||||
}
|
||||
EXPECT_TRUE(media_channel2_->sending());
|
||||
}
|
||||
|
||||
@ -904,13 +944,17 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
|
||||
CreateChannels(0, 0);
|
||||
EXPECT_FALSE(channel1_->secure());
|
||||
EXPECT_TRUE(SendInitiate());
|
||||
EXPECT_TRUE(media_channel1_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_TRUE(media_channel1_->playout());
|
||||
}
|
||||
EXPECT_FALSE(media_channel1_->sending());
|
||||
EXPECT_TRUE(SendAccept());
|
||||
EXPECT_FALSE(channel1_->secure());
|
||||
EXPECT_TRUE(media_channel1_->sending());
|
||||
EXPECT_EQ(1U, media_channel1_->codecs().size());
|
||||
EXPECT_TRUE(media_channel2_->playout());
|
||||
if (verify_playout_) {
|
||||
EXPECT_TRUE(media_channel2_->playout());
|
||||
}
|
||||
EXPECT_TRUE(media_channel2_->sending());
|
||||
EXPECT_EQ(1U, media_channel2_->codecs().size());
|
||||
}
|
||||
@ -1738,6 +1782,9 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
|
||||
}
|
||||
|
||||
protected:
|
||||
// TODO(pbos): Remove playout from all media channels and let renderers mute
|
||||
// themselves.
|
||||
const bool verify_playout_;
|
||||
cricket::FakeTransportController transport_controller1_;
|
||||
cricket::FakeTransportController transport_controller2_;
|
||||
cricket::FakeMediaEngine media_engine_;
|
||||
@ -1760,7 +1807,6 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
|
||||
typename T::MediaChannel::Error error_;
|
||||
};
|
||||
|
||||
|
||||
template<>
|
||||
void ChannelTest<VoiceTraits>::CreateContent(
|
||||
int flags,
|
||||
@ -1801,8 +1847,11 @@ class VoiceChannelTest
|
||||
public:
|
||||
typedef ChannelTest<VoiceTraits> Base;
|
||||
VoiceChannelTest()
|
||||
: Base(kPcmuFrame, sizeof(kPcmuFrame), kRtcpReport, sizeof(kRtcpReport)) {
|
||||
}
|
||||
: Base(true,
|
||||
kPcmuFrame,
|
||||
sizeof(kPcmuFrame),
|
||||
kRtcpReport,
|
||||
sizeof(kRtcpReport)) {}
|
||||
};
|
||||
|
||||
// override to add NULL parameter
|
||||
@ -1868,7 +1917,8 @@ class VideoChannelTest
|
||||
public:
|
||||
typedef ChannelTest<VideoTraits> Base;
|
||||
VideoChannelTest()
|
||||
: Base(kH264Packet,
|
||||
: Base(false,
|
||||
kH264Packet,
|
||||
sizeof(kH264Packet),
|
||||
kRtcpReport,
|
||||
sizeof(kRtcpReport)) {}
|
||||
@ -2556,9 +2606,12 @@ class DataChannelTest
|
||||
public:
|
||||
typedef ChannelTest<DataTraits>
|
||||
Base;
|
||||
DataChannelTest() : Base(kDataPacket, sizeof(kDataPacket),
|
||||
kRtcpReport, sizeof(kRtcpReport)) {
|
||||
}
|
||||
DataChannelTest()
|
||||
: Base(true,
|
||||
kDataPacket,
|
||||
sizeof(kDataPacket),
|
||||
kRtcpReport,
|
||||
sizeof(kRtcpReport)) {}
|
||||
};
|
||||
|
||||
// Override to avoid engine channel parameter.
|
||||
|
Reference in New Issue
Block a user