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

Side by Side Diff: chrome/renderer/extensions/cast_streaming_native_handler.cc

Issue 1484403002: cast: Support for low-latency interactive mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years 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 "chrome/renderer/extensions/cast_streaming_native_handler.h" 5 #include "chrome/renderer/extensions/cast_streaming_native_handler.h"
6 6
7 #include <algorithm>
7 #include <functional> 8 #include <functional>
8 #include <iterator> 9 #include <iterator>
10 #include <string>
11 #include <vector>
9 12
10 #include "base/location.h" 13 #include "base/location.h"
11 #include "base/logging.h" 14 #include "base/logging.h"
12 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
13 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
14 #include "base/thread_task_runner_handle.h" 17 #include "base/thread_task_runner_handle.h"
15 #include "chrome/common/extensions/api/cast_streaming_receiver_session.h" 18 #include "chrome/common/extensions/api/cast_streaming_receiver_session.h"
16 #include "chrome/common/extensions/api/cast_streaming_rtp_stream.h" 19 #include "chrome/common/extensions/api/cast_streaming_rtp_stream.h"
17 #include "chrome/common/extensions/api/cast_streaming_udp_transport.h" 20 #include "chrome/common/extensions/api/cast_streaming_udp_transport.h"
18 #include "chrome/renderer/media/cast_receiver_session.h" 21 #include "chrome/renderer/media/cast_receiver_session.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 85 }
83 } // namespace 86 } // namespace
84 87
85 bool ToCastRtpPayloadParamsOrThrow(v8::Isolate* isolate, 88 bool ToCastRtpPayloadParamsOrThrow(v8::Isolate* isolate,
86 const RtpPayloadParams& ext_params, 89 const RtpPayloadParams& ext_params,
87 CastRtpPayloadParams* cast_params) { 90 CastRtpPayloadParams* cast_params) {
88 cast_params->payload_type = ext_params.payload_type; 91 cast_params->payload_type = ext_params.payload_type;
89 cast_params->max_latency_ms = ext_params.max_latency; 92 cast_params->max_latency_ms = ext_params.max_latency;
90 cast_params->min_latency_ms = 93 cast_params->min_latency_ms =
91 ext_params.min_latency ? *ext_params.min_latency : ext_params.max_latency; 94 ext_params.min_latency ? *ext_params.min_latency : ext_params.max_latency;
95 cast_params->animated_latency_ms = ext_params.animated_latency
96 ? *ext_params.animated_latency
97 : ext_params.max_latency;
92 cast_params->codec_name = ext_params.codec_name; 98 cast_params->codec_name = ext_params.codec_name;
93 cast_params->ssrc = ext_params.ssrc; 99 cast_params->ssrc = ext_params.ssrc;
94 cast_params->feedback_ssrc = ext_params.feedback_ssrc; 100 cast_params->feedback_ssrc = ext_params.feedback_ssrc;
95 cast_params->clock_rate = ext_params.clock_rate ? *ext_params.clock_rate : 0; 101 cast_params->clock_rate = ext_params.clock_rate ? *ext_params.clock_rate : 0;
96 cast_params->min_bitrate = 102 cast_params->min_bitrate =
97 ext_params.min_bitrate ? *ext_params.min_bitrate : 0; 103 ext_params.min_bitrate ? *ext_params.min_bitrate : 0;
98 cast_params->max_bitrate = 104 cast_params->max_bitrate =
99 ext_params.max_bitrate ? *ext_params.max_bitrate : 0; 105 ext_params.max_bitrate ? *ext_params.max_bitrate : 0;
100 cast_params->channels = ext_params.channels ? *ext_params.channels : 0; 106 cast_params->channels = ext_params.channels ? *ext_params.channels : 0;
101 cast_params->max_frame_rate = 107 cast_params->max_frame_rate =
(...skipping 17 matching lines...) Expand all
119 cast_params->codec_specific_params.push_back(cast_codec_params); 125 cast_params->codec_specific_params.push_back(cast_codec_params);
120 } 126 }
121 return true; 127 return true;
122 } 128 }
123 129
124 void FromCastRtpPayloadParams(const CastRtpPayloadParams& cast_params, 130 void FromCastRtpPayloadParams(const CastRtpPayloadParams& cast_params,
125 RtpPayloadParams* ext_params) { 131 RtpPayloadParams* ext_params) {
126 ext_params->payload_type = cast_params.payload_type; 132 ext_params->payload_type = cast_params.payload_type;
127 ext_params->max_latency = cast_params.max_latency_ms; 133 ext_params->max_latency = cast_params.max_latency_ms;
128 ext_params->min_latency.reset(new int(cast_params.min_latency_ms)); 134 ext_params->min_latency.reset(new int(cast_params.min_latency_ms));
135 ext_params->animated_latency.reset(new int(cast_params.animated_latency_ms));
129 ext_params->codec_name = cast_params.codec_name; 136 ext_params->codec_name = cast_params.codec_name;
130 ext_params->ssrc = cast_params.ssrc; 137 ext_params->ssrc = cast_params.ssrc;
131 ext_params->feedback_ssrc = cast_params.feedback_ssrc; 138 ext_params->feedback_ssrc = cast_params.feedback_ssrc;
132 if (cast_params.clock_rate) 139 if (cast_params.clock_rate)
133 ext_params->clock_rate.reset(new int(cast_params.clock_rate)); 140 ext_params->clock_rate.reset(new int(cast_params.clock_rate));
134 if (cast_params.min_bitrate) 141 if (cast_params.min_bitrate)
135 ext_params->min_bitrate.reset(new int(cast_params.min_bitrate)); 142 ext_params->min_bitrate.reset(new int(cast_params.min_bitrate));
136 if (cast_params.max_bitrate) 143 if (cast_params.max_bitrate)
137 ext_params->max_bitrate.reset(new int(cast_params.max_bitrate)); 144 ext_params->max_bitrate.reset(new int(cast_params.max_bitrate));
138 if (cast_params.channels) 145 if (cast_params.channels)
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 void CastStreamingNativeHandler::AddTracksToMediaStream( 857 void CastStreamingNativeHandler::AddTracksToMediaStream(
851 const std::string& url, 858 const std::string& url,
852 const media::AudioParameters& params, 859 const media::AudioParameters& params,
853 scoped_refptr<media::AudioCapturerSource> audio, 860 scoped_refptr<media::AudioCapturerSource> audio,
854 scoped_ptr<media::VideoCapturerSource> video) { 861 scoped_ptr<media::VideoCapturerSource> video) {
855 content::AddAudioTrackToMediaStream(audio, params, true, true, url); 862 content::AddAudioTrackToMediaStream(audio, params, true, true, url);
856 content::AddVideoTrackToMediaStream(video.Pass(), true, true, url); 863 content::AddVideoTrackToMediaStream(video.Pass(), true, true, url);
857 } 864 }
858 865
859 } // namespace extensions 866 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/cast_streaming_rtp_stream.idl ('k') | chrome/renderer/media/cast_rtp_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698