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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | |
10 #include "base/logging.h" | 9 #include "base/logging.h" |
11 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
12 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
13 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
| 13 #include "base/trace_event/trace_event.h" |
14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
15 #include "chrome/renderer/media/cast_session.h" | 15 #include "chrome/renderer/media/cast_session.h" |
16 #include "chrome/renderer/media/cast_udp_transport.h" | 16 #include "chrome/renderer/media/cast_udp_transport.h" |
17 #include "content/public/renderer/media_stream_audio_sink.h" | 17 #include "content/public/renderer/media_stream_audio_sink.h" |
18 #include "content/public/renderer/media_stream_video_sink.h" | 18 #include "content/public/renderer/media_stream_video_sink.h" |
19 #include "content/public/renderer/render_thread.h" | 19 #include "content/public/renderer/render_thread.h" |
20 #include "content/public/renderer/video_encode_accelerator.h" | 20 #include "content/public/renderer/video_encode_accelerator.h" |
21 #include "media/audio/audio_parameters.h" | 21 #include "media/audio/audio_parameters.h" |
22 #include "media/base/audio_bus.h" | 22 #include "media/base/audio_bus.h" |
23 #include "media/base/audio_converter.h" | 23 #include "media/base/audio_converter.h" |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 void CastRtpStream::DidEncounterError(const std::string& message) { | 591 void CastRtpStream::DidEncounterError(const std::string& message) { |
592 DVLOG(1) << "CastRtpStream::DidEncounterError(" << message << ") = " | 592 DVLOG(1) << "CastRtpStream::DidEncounterError(" << message << ") = " |
593 << (IsAudio() ? "audio" : "video"); | 593 << (IsAudio() ? "audio" : "video"); |
594 // Save the WeakPtr first because the error callback might delete this object. | 594 // Save the WeakPtr first because the error callback might delete this object. |
595 base::WeakPtr<CastRtpStream> ptr = weak_factory_.GetWeakPtr(); | 595 base::WeakPtr<CastRtpStream> ptr = weak_factory_.GetWeakPtr(); |
596 error_callback_.Run(message); | 596 error_callback_.Run(message); |
597 content::RenderThread::Get()->GetTaskRunner()->PostTask( | 597 content::RenderThread::Get()->GetTaskRunner()->PostTask( |
598 FROM_HERE, | 598 FROM_HERE, |
599 base::Bind(&CastRtpStream::Stop, ptr)); | 599 base::Bind(&CastRtpStream::Stop, ptr)); |
600 } | 600 } |
OLD | NEW |