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 <stdint.h> | 7 #include <stdint.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/callback_helpers.h" | 12 #include "base/callback_helpers.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
18 #include "base/sys_info.h" | 18 #include "base/sys_info.h" |
19 #include "base/trace_event/trace_event.h" | 19 #include "base/trace_event/trace_event.h" |
20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
21 #include "chrome/renderer/media/cast_session.h" | 21 #include "chrome/renderer/media/cast_session.h" |
22 #include "chrome/renderer/media/cast_udp_transport.h" | 22 #include "chrome/renderer/media/cast_udp_transport.h" |
23 #include "content/public/renderer/media_stream_audio_sink.h" | 23 #include "content/public/renderer/media_stream_audio_sink.h" |
24 #include "content/public/renderer/media_stream_video_sink.h" | 24 #include "content/public/renderer/media_stream_video_sink.h" |
25 #include "content/public/renderer/render_thread.h" | 25 #include "content/public/renderer/render_thread.h" |
26 #include "content/public/renderer/video_encode_accelerator.h" | 26 #include "content/public/renderer/video_encode_accelerator.h" |
27 #include "media/audio/audio_parameters.h" | 27 #include "media/audio/audio_parameters.h" |
28 #include "media/base/audio_bus.h" | 28 #include "media/base/audio_bus.h" |
29 #include "media/base/audio_converter.h" | 29 #include "media/base/audio_converter.h" |
30 #include "media/base/audio_fifo.h" | |
31 #include "media/base/bind_to_current_loop.h" | 30 #include "media/base/bind_to_current_loop.h" |
32 #include "media/base/limits.h" | 31 #include "media/base/limits.h" |
33 #include "media/base/video_frame.h" | 32 #include "media/base/video_frame.h" |
34 #include "media/cast/cast_config.h" | 33 #include "media/cast/cast_config.h" |
35 #include "media/cast/cast_sender.h" | 34 #include "media/cast/cast_sender.h" |
36 #include "media/cast/net/cast_transport_config.h" | 35 #include "media/cast/net/cast_transport_config.h" |
37 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 36 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
38 #include "ui/gfx/geometry/size.h" | 37 #include "ui/gfx/geometry/size.h" |
39 | 38 |
40 using media::cast::AudioSenderConfig; | 39 using media::cast::AudioSenderConfig; |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 DCHECK(content::RenderThread::Get()); | 626 DCHECK(content::RenderThread::Get()); |
628 DVLOG(1) << "CastRtpStream::DidEncounterError(" << message << ") = " | 627 DVLOG(1) << "CastRtpStream::DidEncounterError(" << message << ") = " |
629 << (IsAudio() ? "audio" : "video"); | 628 << (IsAudio() ? "audio" : "video"); |
630 // Save the WeakPtr first because the error callback might delete this object. | 629 // Save the WeakPtr first because the error callback might delete this object. |
631 base::WeakPtr<CastRtpStream> ptr = weak_factory_.GetWeakPtr(); | 630 base::WeakPtr<CastRtpStream> ptr = weak_factory_.GetWeakPtr(); |
632 error_callback_.Run(message); | 631 error_callback_.Run(message); |
633 base::ThreadTaskRunnerHandle::Get()->PostTask( | 632 base::ThreadTaskRunnerHandle::Get()->PostTask( |
634 FROM_HERE, | 633 FROM_HERE, |
635 base::Bind(&CastRtpStream::Stop, ptr)); | 634 base::Bind(&CastRtpStream::Stop, ptr)); |
636 } | 635 } |
OLD | NEW |