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_rtp_stream.h" | 5 #include "chrome/renderer/media/cast_rtp_stream.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/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "chrome/renderer/media/cast_session.h" | 10 #include "chrome/renderer/media/cast_session.h" |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 | 347 |
348 void CastRtpStream::ToggleLogging(bool enable) { | 348 void CastRtpStream::ToggleLogging(bool enable) { |
349 cast_session_->ToggleLogging(IsAudio(), enable); | 349 cast_session_->ToggleLogging(IsAudio(), enable); |
350 } | 350 } |
351 | 351 |
352 void CastRtpStream::GetRawEvents( | 352 void CastRtpStream::GetRawEvents( |
353 const base::Callback<void(scoped_ptr<std::string>)>& callback) { | 353 const base::Callback<void(scoped_ptr<std::string>)>& callback) { |
354 cast_session_->GetEventLogsAndReset(IsAudio(), callback); | 354 cast_session_->GetEventLogsAndReset(IsAudio(), callback); |
355 } | 355 } |
356 | 356 |
| 357 void CastRtpStream::GetStats( |
| 358 const base::Callback<void(scoped_ptr<std::string>)>& callback) { |
| 359 cast_session_->GetStatsAndReset(IsAudio(), callback); |
| 360 } |
| 361 |
357 bool CastRtpStream::IsAudio() const { | 362 bool CastRtpStream::IsAudio() const { |
358 return track_.source().type() == blink::WebMediaStreamSource::TypeAudio; | 363 return track_.source().type() == blink::WebMediaStreamSource::TypeAudio; |
359 } | 364 } |
360 | 365 |
361 void CastRtpStream::DidEncounterError(const std::string& message) { | 366 void CastRtpStream::DidEncounterError(const std::string& message) { |
362 error_callback_.Run(message); | 367 error_callback_.Run(message); |
363 Stop(); | 368 Stop(); |
364 } | 369 } |
OLD | NEW |