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 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/bind_helpers.h" | 14 #include "base/bind_helpers.h" |
15 #include "base/callback_helpers.h" | 15 #include "base/callback_helpers.h" |
16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
20 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
21 #include "base/strings/stringprintf.h" | |
22 #include "base/threading/thread_task_runner_handle.h" | 21 #include "base/threading/thread_task_runner_handle.h" |
23 #include "base/timer/timer.h" | 22 #include "base/timer/timer.h" |
24 #include "base/trace_event/trace_event.h" | 23 #include "base/trace_event/trace_event.h" |
25 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
26 #include "chrome/renderer/media/cast_session.h" | 25 #include "chrome/renderer/media/cast_session.h" |
27 #include "chrome/renderer/media/cast_udp_transport.h" | 26 #include "chrome/renderer/media/cast_udp_transport.h" |
28 #include "content/public/renderer/media_stream_audio_sink.h" | 27 #include "content/public/renderer/media_stream_audio_sink.h" |
29 #include "content/public/renderer/media_stream_utils.h" | 28 #include "content/public/renderer/media_stream_utils.h" |
30 #include "content/public/renderer/media_stream_video_sink.h" | 29 #include "content/public/renderer/media_stream_video_sink.h" |
31 #include "content/public/renderer/render_thread.h" | 30 #include "content/public/renderer/render_thread.h" |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 DCHECK(content::RenderThread::Get()); | 579 DCHECK(content::RenderThread::Get()); |
581 DVLOG(1) << "CastRtpStream::DidEncounterError(" << message | 580 DVLOG(1) << "CastRtpStream::DidEncounterError(" << message |
582 << ") = " << (is_audio_ ? "audio" : "video"); | 581 << ") = " << (is_audio_ ? "audio" : "video"); |
583 // Save the WeakPtr first because the error callback might delete this object. | 582 // Save the WeakPtr first because the error callback might delete this object. |
584 base::WeakPtr<CastRtpStream> ptr = weak_factory_.GetWeakPtr(); | 583 base::WeakPtr<CastRtpStream> ptr = weak_factory_.GetWeakPtr(); |
585 error_callback_.Run(message); | 584 error_callback_.Run(message); |
586 base::ThreadTaskRunnerHandle::Get()->PostTask( | 585 base::ThreadTaskRunnerHandle::Get()->PostTask( |
587 FROM_HERE, | 586 FROM_HERE, |
588 base::Bind(&CastRtpStream::Stop, ptr)); | 587 base::Bind(&CastRtpStream::Stop, ptr)); |
589 } | 588 } |
OLD | NEW |