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

Side by Side Diff: media/cast/cast_sender_impl.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/cast_sender_impl.h" 5 #include "media/cast/cast_sender_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 const VideoSenderConfig& video_config, 120 const VideoSenderConfig& video_config,
121 const CastInitializationCallback& cast_initialization_cb, 121 const CastInitializationCallback& cast_initialization_cb,
122 const CreateVideoEncodeAcceleratorCallback& create_vea_cb, 122 const CreateVideoEncodeAcceleratorCallback& create_vea_cb,
123 const CreateVideoEncodeMemoryCallback& create_video_encode_mem_cb) { 123 const CreateVideoEncodeMemoryCallback& create_video_encode_mem_cb) {
124 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 124 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
125 CHECK(video_config.use_external_encoder || 125 CHECK(video_config.use_external_encoder ||
126 cast_environment_->HasVideoThread()); 126 cast_environment_->HasVideoThread());
127 127
128 VLOG(1) << "CastSenderImpl@" << this << "::InitializeVideo()"; 128 VLOG(1) << "CastSenderImpl@" << this << "::InitializeVideo()";
129 129
130 video_sender_.reset(new VideoSender(cast_environment_, 130 video_sender_.reset(
131 video_config, 131 new VideoSender(cast_environment_,
132 create_vea_cb, 132 video_config,
133 create_video_encode_mem_cb, 133 create_vea_cb,
134 transport_sender_)); 134 create_video_encode_mem_cb,
135 transport_sender_,
136 base::Bind(&CastSenderImpl::SetTargetPlayoutDelay,
137 weak_factory_.GetWeakPtr())));
135 138
136 const CastInitializationStatus status = video_sender_->InitializationResult(); 139 const CastInitializationStatus status = video_sender_->InitializationResult();
137 if (status == STATUS_VIDEO_INITIALIZED) { 140 if (status == STATUS_VIDEO_INITIALIZED) {
138 ssrc_of_video_sender_ = video_config.incoming_feedback_ssrc; 141 ssrc_of_video_sender_ = video_config.incoming_feedback_ssrc;
139 video_frame_input_ = 142 video_frame_input_ =
140 new LocalVideoFrameInput(cast_environment_, video_sender_->AsWeakPtr()); 143 new LocalVideoFrameInput(cast_environment_, video_sender_->AsWeakPtr());
141 } 144 }
142 cast_initialization_cb.Run(status); 145 cast_initialization_cb.Run(status);
143 if (audio_sender_) { 146 if (audio_sender_) {
144 DCHECK(audio_sender_->GetTargetPlayoutDelay() == 147 DCHECK(audio_sender_->GetTargetPlayoutDelay() ==
(...skipping 20 matching lines...) Expand all
165 if (audio_sender_) { 168 if (audio_sender_) {
166 audio_sender_->SetTargetPlayoutDelay(new_target_playout_delay); 169 audio_sender_->SetTargetPlayoutDelay(new_target_playout_delay);
167 } 170 }
168 if (video_sender_) { 171 if (video_sender_) {
169 video_sender_->SetTargetPlayoutDelay(new_target_playout_delay); 172 video_sender_->SetTargetPlayoutDelay(new_target_playout_delay);
170 } 173 }
171 } 174 }
172 175
173 } // namespace cast 176 } // namespace cast
174 } // namespace media 177 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698