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

Side by Side Diff: media/cast/net/cast_transport_sender_impl_unittest.cc

Issue 560223002: [Cast] Limit frames in flight by duration, and not by number of frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweaks. Created 6 years, 3 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 | « media/cast/net/cast_transport_config.cc ('k') | media/cast/net/rtp/packet_storage.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <gtest/gtest.h> 5 #include <gtest/gtest.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 task_runner_, 103 task_runner_,
104 &transport_)); 104 &transport_));
105 task_runner_->RunTasks(); 105 task_runner_->RunTasks();
106 } 106 }
107 107
108 void InitializeVideo() { 108 void InitializeVideo() {
109 CastTransportRtpConfig rtp_config; 109 CastTransportRtpConfig rtp_config;
110 rtp_config.ssrc = kVideoSsrc; 110 rtp_config.ssrc = kVideoSsrc;
111 rtp_config.feedback_ssrc = 2; 111 rtp_config.feedback_ssrc = 2;
112 rtp_config.rtp_payload_type = 3; 112 rtp_config.rtp_payload_type = 3;
113 rtp_config.stored_frames = 10;
114 transport_sender_->InitializeVideo(rtp_config, 113 transport_sender_->InitializeVideo(rtp_config,
115 RtcpCastMessageCallback(), 114 RtcpCastMessageCallback(),
116 RtcpRttCallback()); 115 RtcpRttCallback());
117 } 116 }
118 117
119 void InitializeAudio() { 118 void InitializeAudio() {
120 CastTransportRtpConfig rtp_config; 119 CastTransportRtpConfig rtp_config;
121 rtp_config.ssrc = kAudioSsrc; 120 rtp_config.ssrc = kAudioSsrc;
122 rtp_config.feedback_ssrc = 3; 121 rtp_config.feedback_ssrc = 3;
123 rtp_config.rtp_payload_type = 4; 122 rtp_config.rtp_payload_type = 4;
124 rtp_config.stored_frames = 10;
125 transport_sender_->InitializeAudio(rtp_config, 123 transport_sender_->InitializeAudio(rtp_config,
126 RtcpCastMessageCallback(), 124 RtcpCastMessageCallback(),
127 RtcpRttCallback()); 125 RtcpRttCallback());
128 } 126 }
129 127
130 void LogRawEvents(const std::vector<PacketEvent>& packet_events, 128 void LogRawEvents(const std::vector<PacketEvent>& packet_events,
131 const std::vector<FrameEvent>& frame_events) { 129 const std::vector<FrameEvent>& frame_events) {
132 num_times_callback_called_++; 130 num_times_callback_called_++;
133 } 131 }
134 132
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 task_runner_->Sleep(base::TimeDelta::FromMilliseconds(2)); 341 task_runner_->Sleep(base::TimeDelta::FromMilliseconds(2));
344 transport_sender_->OnReceivedCastMessage(kVideoSsrc, 342 transport_sender_->OnReceivedCastMessage(kVideoSsrc,
345 RtcpCastMessageCallback(), 343 RtcpCastMessageCallback(),
346 cast_message); 344 cast_message);
347 task_runner_->RunTasks(); 345 task_runner_->RunTasks();
348 EXPECT_EQ(7, transport_.packets_sent()); 346 EXPECT_EQ(7, transport_.packets_sent());
349 } 347 }
350 348
351 } // namespace cast 349 } // namespace cast
352 } // namespace media 350 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/net/cast_transport_config.cc ('k') | media/cast/net/rtp/packet_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698