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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "chrome/renderer/media/cast_session.h" | 11 #include "chrome/renderer/media/cast_session.h" |
12 #include "chrome/renderer/media/cast_udp_transport.h" | 12 #include "chrome/renderer/media/cast_udp_transport.h" |
13 #include "content/public/renderer/media_stream_audio_sink.h" | 13 #include "content/public/renderer/media_stream_audio_sink.h" |
14 #include "content/public/renderer/media_stream_video_sink.h" | 14 #include "content/public/renderer/media_stream_video_sink.h" |
15 #include "content/public/renderer/render_thread.h" | 15 #include "content/public/renderer/render_thread.h" |
16 #include "media/audio/audio_parameters.h" | 16 #include "media/audio/audio_parameters.h" |
17 #include "media/base/audio_bus.h" | 17 #include "media/base/audio_bus.h" |
18 #include "media/base/audio_fifo.h" | 18 #include "media/base/audio_fifo.h" |
19 #include "media/base/bind_to_current_loop.h" | 19 #include "media/base/bind_to_current_loop.h" |
20 #include "media/base/multi_channel_resampler.h" | 20 #include "media/base/multi_channel_resampler.h" |
| 21 #include "media/base/video_frame.h" |
21 #include "media/cast/cast_config.h" | 22 #include "media/cast/cast_config.h" |
22 #include "media/cast/cast_defines.h" | 23 #include "media/cast/cast_defines.h" |
23 #include "media/cast/cast_sender.h" | 24 #include "media/cast/cast_sender.h" |
24 #include "media/cast/transport/cast_transport_config.h" | 25 #include "media/cast/transport/cast_transport_config.h" |
25 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 26 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
| 27 #include "ui/gfx/geometry/size.h" |
26 | 28 |
27 using media::cast::AudioSenderConfig; | 29 using media::cast::AudioSenderConfig; |
28 using media::cast::VideoSenderConfig; | 30 using media::cast::VideoSenderConfig; |
29 | 31 |
30 namespace { | 32 namespace { |
31 | 33 |
32 const char kCodecNameOpus[] = "OPUS"; | 34 const char kCodecNameOpus[] = "OPUS"; |
33 const char kCodecNameVp8[] = "VP8"; | 35 const char kCodecNameVp8[] = "VP8"; |
34 | 36 |
35 // This constant defines the number of sets of audio data to buffer | 37 // This constant defines the number of sets of audio data to buffer |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 } | 444 } |
443 | 445 |
444 void CastRtpStream::DidEncounterError(const std::string& message) { | 446 void CastRtpStream::DidEncounterError(const std::string& message) { |
445 // Save the WeakPtr first because the error callback might delete this object. | 447 // Save the WeakPtr first because the error callback might delete this object. |
446 base::WeakPtr<CastRtpStream> ptr = weak_factory_.GetWeakPtr(); | 448 base::WeakPtr<CastRtpStream> ptr = weak_factory_.GetWeakPtr(); |
447 error_callback_.Run(message); | 449 error_callback_.Run(message); |
448 content::RenderThread::Get()->GetMessageLoop()->PostTask( | 450 content::RenderThread::Get()->GetMessageLoop()->PostTask( |
449 FROM_HERE, | 451 FROM_HERE, |
450 base::Bind(&CastRtpStream::Stop, ptr)); | 452 base::Bind(&CastRtpStream::Stop, ptr)); |
451 } | 453 } |
OLD | NEW |