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

Side by Side Diff: media/cast/sender/audio_sender.cc

Issue 562653004: Cast: First stab at implementing adaptive latency (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 "media/cast/sender/audio_sender.h" 5 #include "media/cast/sender/audio_sender.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "media/cast/cast_defines.h" 10 #include "media/cast/cast_defines.h"
(...skipping 15 matching lines...) Expand all
26 const AudioSenderConfig& audio_config, 26 const AudioSenderConfig& audio_config,
27 CastTransportSender* const transport_sender) 27 CastTransportSender* const transport_sender)
28 : FrameSender( 28 : FrameSender(
29 cast_environment, 29 cast_environment,
30 true, 30 true,
31 transport_sender, 31 transport_sender,
32 base::TimeDelta::FromMilliseconds(audio_config.rtcp_interval), 32 base::TimeDelta::FromMilliseconds(audio_config.rtcp_interval),
33 audio_config.frequency, 33 audio_config.frequency,
34 audio_config.ssrc, 34 audio_config.ssrc,
35 kAudioFrameRate * 2.0, // We lie to increase max outstanding frames. 35 kAudioFrameRate * 2.0, // We lie to increase max outstanding frames.
36 audio_config.target_playout_delay, 36 audio_config.min_playout_delay,
37 audio_config.max_playout_delay,
37 NewFixedCongestionControl(audio_config.bitrate)), 38 NewFixedCongestionControl(audio_config.bitrate)),
38 samples_in_encoder_(0), 39 samples_in_encoder_(0),
39 weak_factory_(this) { 40 weak_factory_(this) {
40 cast_initialization_status_ = STATUS_AUDIO_UNINITIALIZED; 41 cast_initialization_status_ = STATUS_AUDIO_UNINITIALIZED;
41 VLOG(1) << "max_unacked_frames " << max_unacked_frames_; 42 VLOG(1) << "max_unacked_frames " << max_unacked_frames_;
42 DCHECK_GT(max_unacked_frames_, 0); 43 DCHECK_GT(max_unacked_frames_, 0);
43 44
44 if (!audio_config.use_external_encoder) { 45 if (!audio_config.use_external_encoder) {
45 audio_encoder_.reset( 46 audio_encoder_.reset(
46 new AudioEncoder(cast_environment, 47 new AudioEncoder(cast_environment,
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 116 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
116 117
117 samples_in_encoder_ -= audio_encoder_->GetSamplesPerFrame() + samples_skipped; 118 samples_in_encoder_ -= audio_encoder_->GetSamplesPerFrame() + samples_skipped;
118 DCHECK_GE(samples_in_encoder_, 0); 119 DCHECK_GE(samples_in_encoder_, 0);
119 120
120 SendEncodedFrame(encoder_bitrate, encoded_frame.Pass()); 121 SendEncodedFrame(encoder_bitrate, encoded_frame.Pass());
121 } 122 }
122 123
123 } // namespace cast 124 } // namespace cast
124 } // namespace media 125 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698