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

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

Issue 1878883003: Refactor: simplify interface of SenderRtcpSession and CastTransport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 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/sender/frame_sender.cc ('k') | media/cast/sender/video_sender_unittest.cc » ('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 "media/cast/sender/video_sender.h" 5 #include "media/cast/sender/video_sender.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <cmath> 9 #include <cmath>
10 #include <cstring> 10 #include <cstring>
11 #include <utility> 11 #include <utility>
12 12
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/memory/ptr_util.h"
15 #include "base/trace_event/trace_event.h" 16 #include "base/trace_event/trace_event.h"
16 #include "media/cast/net/cast_transport_config.h" 17 #include "media/cast/net/cast_transport_config.h"
17 #include "media/cast/sender/performance_metrics_overlay.h" 18 #include "media/cast/sender/performance_metrics_overlay.h"
18 #include "media/cast/sender/video_encoder.h" 19 #include "media/cast/sender/video_encoder.h"
19 20
20 namespace media { 21 namespace media {
21 namespace cast { 22 namespace cast {
22 23
23 namespace { 24 namespace {
24 25
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 133 }
133 134
134 media::cast::CastTransportRtpConfig transport_config; 135 media::cast::CastTransportRtpConfig transport_config;
135 transport_config.ssrc = video_config.ssrc; 136 transport_config.ssrc = video_config.ssrc;
136 transport_config.feedback_ssrc = video_config.receiver_ssrc; 137 transport_config.feedback_ssrc = video_config.receiver_ssrc;
137 transport_config.rtp_payload_type = video_config.rtp_payload_type; 138 transport_config.rtp_payload_type = video_config.rtp_payload_type;
138 transport_config.aes_key = video_config.aes_key; 139 transport_config.aes_key = video_config.aes_key;
139 transport_config.aes_iv_mask = video_config.aes_iv_mask; 140 transport_config.aes_iv_mask = video_config.aes_iv_mask;
140 141
141 transport_sender->InitializeVideo( 142 transport_sender->InitializeVideo(
142 transport_config, base::Bind(&VideoSender::OnReceivedCastFeedback, 143 transport_config, base::WrapUnique(new FrameSender::RtcpClient(
143 weak_factory_.GetWeakPtr()), 144 weak_factory_.GetWeakPtr())));
144 base::Bind(&VideoSender::OnMeasuredRoundTripTime,
145 weak_factory_.GetWeakPtr()),
146 base::Bind(&VideoSender::OnReceivedPli, weak_factory_.GetWeakPtr()));
147 } 145 }
148 146
149 VideoSender::~VideoSender() { 147 VideoSender::~VideoSender() {
150 } 148 }
151 149
152 void VideoSender::InsertRawVideoFrame( 150 void VideoSender::InsertRawVideoFrame(
153 const scoped_refptr<media::VideoFrame>& video_frame, 151 const scoped_refptr<media::VideoFrame>& video_frame,
154 const base::TimeTicks& reference_time) { 152 const base::TimeTicks& reference_time) {
155 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 153 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
156 154
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 media::VideoFrameMetadata::RESOURCE_UTILIZATION, 349 media::VideoFrameMetadata::RESOURCE_UTILIZATION,
352 encoded_frame->dependency == EncodedFrame::KEY ? 350 encoded_frame->dependency == EncodedFrame::KEY ?
353 std::min(1.0, attenuated_utilization) : attenuated_utilization); 351 std::min(1.0, attenuated_utilization) : attenuated_utilization);
354 } 352 }
355 353
356 SendEncodedFrame(encoder_bitrate, std::move(encoded_frame)); 354 SendEncodedFrame(encoder_bitrate, std::move(encoded_frame));
357 } 355 }
358 356
359 } // namespace cast 357 } // namespace cast
360 } // namespace media 358 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/sender/frame_sender.cc ('k') | media/cast/sender/video_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698