Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(763)

Side by Side Diff: chrome/renderer/media/cast_rtp_stream.cc

Issue 1714593003: Introduce media::AudioPushFifo and a couple of use cases (and clean-ups). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Win compile issue. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698