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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 audio_sink_.reset(); | 421 audio_sink_.reset(); |
422 video_sink_.reset(); | 422 video_sink_.reset(); |
423 stop_callback_.Run(); | 423 stop_callback_.Run(); |
424 } | 424 } |
425 | 425 |
426 void CastRtpStream::ToggleLogging(bool enable) { | 426 void CastRtpStream::ToggleLogging(bool enable) { |
427 cast_session_->ToggleLogging(IsAudio(), enable); | 427 cast_session_->ToggleLogging(IsAudio(), enable); |
428 } | 428 } |
429 | 429 |
430 void CastRtpStream::GetRawEvents( | 430 void CastRtpStream::GetRawEvents( |
431 const base::Callback<void(scoped_ptr<std::string>)>& callback) { | 431 const base::Callback<void(scoped_ptr<base::BinaryValue>)>& callback) { |
432 cast_session_->GetEventLogsAndReset(IsAudio(), callback); | 432 cast_session_->GetEventLogsAndReset(IsAudio(), callback); |
433 } | 433 } |
434 | 434 |
435 void CastRtpStream::GetStats( | 435 void CastRtpStream::GetStats( |
436 const base::Callback<void(scoped_ptr<base::DictionaryValue>)>& callback) { | 436 const base::Callback<void(scoped_ptr<base::DictionaryValue>)>& callback) { |
437 cast_session_->GetStatsAndReset(IsAudio(), callback); | 437 cast_session_->GetStatsAndReset(IsAudio(), callback); |
438 } | 438 } |
439 | 439 |
440 bool CastRtpStream::IsAudio() const { | 440 bool CastRtpStream::IsAudio() const { |
441 return track_.source().type() == blink::WebMediaStreamSource::TypeAudio; | 441 return track_.source().type() == blink::WebMediaStreamSource::TypeAudio; |
442 } | 442 } |
443 | 443 |
444 void CastRtpStream::DidEncounterError(const std::string& message) { | 444 void CastRtpStream::DidEncounterError(const std::string& message) { |
445 error_callback_.Run(message); | 445 error_callback_.Run(message); |
446 Stop(); | 446 Stop(); |
447 } | 447 } |
OLD | NEW |