| OLD | NEW |
| 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/media/cast_send_transport.h" | 5 #include "chrome/renderer/media/cast_rtp_stream.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/renderer/media/cast_session.h" | 8 #include "chrome/renderer/media/cast_session.h" |
| 9 #include "chrome/renderer/media/cast_udp_transport.h" | 9 #include "chrome/renderer/media/cast_udp_transport.h" |
| 10 #include "media/cast/cast_config.h" | 10 #include "media/cast/cast_config.h" |
| 11 #include "media/cast/cast_defines.h" | 11 #include "media/cast/cast_defines.h" |
| 12 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 12 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
| 13 | 13 |
| 14 using media::cast::AudioSenderConfig; | 14 using media::cast::AudioSenderConfig; |
| 15 using media::cast::VideoSenderConfig; | 15 using media::cast::VideoSenderConfig; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 CastRtpPayloadParams::~CastRtpPayloadParams() { | 112 CastRtpPayloadParams::~CastRtpPayloadParams() { |
| 113 } | 113 } |
| 114 | 114 |
| 115 CastRtpCaps::CastRtpCaps() { | 115 CastRtpCaps::CastRtpCaps() { |
| 116 } | 116 } |
| 117 | 117 |
| 118 CastRtpCaps::~CastRtpCaps() { | 118 CastRtpCaps::~CastRtpCaps() { |
| 119 } | 119 } |
| 120 | 120 |
| 121 CastSendTransport::CastSendTransport( | 121 CastRtpStream::CastRtpStream( |
| 122 const blink::WebMediaStreamTrack& track, | 122 const blink::WebMediaStreamTrack& track, |
| 123 const scoped_refptr<CastSession>& session) | 123 const scoped_refptr<CastSession>& session) |
| 124 : track_(track), | 124 : track_(track), |
| 125 cast_session_(session) { | 125 cast_session_(session) { |
| 126 } | 126 } |
| 127 | 127 |
| 128 CastSendTransport::~CastSendTransport() { | 128 CastRtpStream::~CastRtpStream() { |
| 129 } | 129 } |
| 130 | 130 |
| 131 CastRtpCaps CastSendTransport::GetCaps() { | 131 CastRtpCaps CastRtpStream::GetCaps() { |
| 132 if (IsAudio()) | 132 if (IsAudio()) |
| 133 return DefaultAudioCaps(); | 133 return DefaultAudioCaps(); |
| 134 else | 134 else |
| 135 return DefaultVideoCaps(); | 135 return DefaultVideoCaps(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 CastRtpParams CastSendTransport::GetParams() { | 138 CastRtpParams CastRtpStream::GetParams() { |
| 139 return params_; | 139 return params_; |
| 140 } | 140 } |
| 141 | 141 |
| 142 void CastSendTransport::Start(const CastRtpParams& params) { | 142 void CastRtpStream::Start(const CastRtpParams& params) { |
| 143 if (IsAudio()) { | 143 if (IsAudio()) { |
| 144 AudioSenderConfig config; | 144 AudioSenderConfig config; |
| 145 if (!ToAudioSenderConfig(params, &config)) { | 145 if (!ToAudioSenderConfig(params, &config)) { |
| 146 DVLOG(1) << "Invalid parameters for audio."; | 146 DVLOG(1) << "Invalid parameters for audio."; |
| 147 } | 147 } |
| 148 cast_session_->StartAudio(config); | 148 cast_session_->StartAudio(config); |
| 149 } else { | 149 } else { |
| 150 VideoSenderConfig config; | 150 VideoSenderConfig config; |
| 151 if (!ToVideoSenderConfig(params, &config)) { | 151 if (!ToVideoSenderConfig(params, &config)) { |
| 152 DVLOG(1) << "Invalid parameters for video."; | 152 DVLOG(1) << "Invalid parameters for video."; |
| 153 } | 153 } |
| 154 cast_session_->StartVideo(config); | 154 cast_session_->StartVideo(config); |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 | 157 |
| 158 void CastSendTransport::Stop() { | 158 void CastRtpStream::Stop() { |
| 159 NOTIMPLEMENTED(); | 159 NOTIMPLEMENTED(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 bool CastSendTransport::IsAudio() const { | 162 bool CastRtpStream::IsAudio() const { |
| 163 return track_.source().type() == blink::WebMediaStreamSource::TypeAudio; | 163 return track_.source().type() == blink::WebMediaStreamSource::TypeAudio; |
| 164 } | 164 } |
| OLD | NEW |