OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/media/audio_renderer_host.h" | 5 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 virtual ~AudioEntry(); | 38 virtual ~AudioEntry(); |
39 | 39 |
40 int stream_id() const { | 40 int stream_id() const { |
41 return stream_id_; | 41 return stream_id_; |
42 } | 42 } |
43 | 43 |
44 int render_view_id() const { | 44 int render_view_id() const { |
45 return render_view_id_; | 45 return render_view_id_; |
46 } | 46 } |
47 | 47 |
48 media::AudioOutputController* controller() const { | 48 media::AudioOutputController* controller() const { return controller_.get(); } |
49 return controller_; | |
50 } | |
51 | 49 |
52 base::SharedMemory* shared_memory() { | 50 base::SharedMemory* shared_memory() { |
53 return shared_memory_.get(); | 51 return shared_memory_.get(); |
54 } | 52 } |
55 | 53 |
56 media::AudioOutputController::SyncReader* reader() const { | 54 media::AudioOutputController::SyncReader* reader() const { |
57 return reader_.get(); | 55 return reader_.get(); |
58 } | 56 } |
59 | 57 |
60 private: | 58 private: |
(...skipping 27 matching lines...) Expand all Loading... |
88 const media::AudioParameters& params, | 86 const media::AudioParameters& params, |
89 scoped_ptr<base::SharedMemory> shared_memory, | 87 scoped_ptr<base::SharedMemory> shared_memory, |
90 scoped_ptr<media::AudioOutputController::SyncReader> reader) | 88 scoped_ptr<media::AudioOutputController::SyncReader> reader) |
91 : host_(host), | 89 : host_(host), |
92 stream_id_(stream_id), | 90 stream_id_(stream_id), |
93 render_view_id_(render_view_id), | 91 render_view_id_(render_view_id), |
94 controller_(media::AudioOutputController::Create( | 92 controller_(media::AudioOutputController::Create( |
95 host->audio_manager_, this, params, reader.get())), | 93 host->audio_manager_, this, params, reader.get())), |
96 shared_memory_(shared_memory.Pass()), | 94 shared_memory_(shared_memory.Pass()), |
97 reader_(reader.Pass()) { | 95 reader_(reader.Pass()) { |
98 DCHECK(controller_); | 96 DCHECK(controller_.get()); |
99 } | 97 } |
100 | 98 |
101 AudioRendererHost::AudioEntry::~AudioEntry() {} | 99 AudioRendererHost::AudioEntry::~AudioEntry() {} |
102 | 100 |
103 /////////////////////////////////////////////////////////////////////////////// | 101 /////////////////////////////////////////////////////////////////////////////// |
104 // AudioRendererHost implementations. | 102 // AudioRendererHost implementations. |
105 AudioRendererHost::AudioRendererHost( | 103 AudioRendererHost::AudioRendererHost( |
106 int render_process_id, | 104 int render_process_id, |
107 media::AudioManager* audio_manager, | 105 media::AudioManager* audio_manager, |
108 AudioMirroringManager* mirroring_manager, | 106 AudioMirroringManager* mirroring_manager, |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 } | 428 } |
431 | 429 |
432 AudioRendererHost::AudioEntry* AudioRendererHost::LookupById(int stream_id) { | 430 AudioRendererHost::AudioEntry* AudioRendererHost::LookupById(int stream_id) { |
433 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 431 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
434 | 432 |
435 AudioEntryMap::const_iterator i = audio_entries_.find(stream_id); | 433 AudioEntryMap::const_iterator i = audio_entries_.find(stream_id); |
436 return i != audio_entries_.end() ? i->second : NULL; | 434 return i != audio_entries_.end() ? i->second : NULL; |
437 } | 435 } |
438 | 436 |
439 } // namespace content | 437 } // namespace content |
OLD | NEW |