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

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

Issue 42635: Lots of files touched for a very simple change. Everywhere we used a const M... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/media/audio_renderer_impl.h ('k') | chrome/renderer/media/data_source_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "chrome/renderer/media/audio_renderer_impl.h" 5 #include "chrome/renderer/media/audio_renderer_impl.h"
6 #include "chrome/renderer/render_view.h" 6 #include "chrome/renderer/render_view.h"
7 #include "chrome/renderer/render_thread.h" 7 #include "chrome/renderer/render_thread.h"
8 #include "chrome/renderer/webmediaplayer_delegate_impl.h" 8 #include "chrome/renderer/webmediaplayer_delegate_impl.h"
9 #include "media/base/filter_host.h" 9 #include "media/base/filter_host.h"
10 10
(...skipping 11 matching lines...) Expand all
22 render_loop_(RenderThread::current()->message_loop()), 22 render_loop_(RenderThread::current()->message_loop()),
23 resource_release_event_(true, false) { 23 resource_release_event_(true, false) {
24 // TODO(hclam): do we need to move this method call to render thread? 24 // TODO(hclam): do we need to move this method call to render thread?
25 delegate_->SetAudioRenderer(this); 25 delegate_->SetAudioRenderer(this);
26 } 26 }
27 27
28 AudioRendererImpl::~AudioRendererImpl() { 28 AudioRendererImpl::~AudioRendererImpl() {
29 } 29 }
30 30
31 bool AudioRendererImpl::IsMediaFormatSupported( 31 bool AudioRendererImpl::IsMediaFormatSupported(
32 const media::MediaFormat* media_format) { 32 const media::MediaFormat& media_format) {
33 int channels; 33 int channels;
34 int sample_rate; 34 int sample_rate;
35 int sample_bits; 35 int sample_bits;
36 return ParseMediaFormat(media_format, &channels, &sample_rate, &sample_bits); 36 return ParseMediaFormat(media_format, &channels, &sample_rate, &sample_bits);
37 } 37 }
38 38
39 bool AudioRendererImpl::OnInitialize(const media::MediaFormat* media_format) { 39 bool AudioRendererImpl::OnInitialize(const media::MediaFormat& media_format) {
40 // Parse integer values in MediaFormat. 40 // Parse integer values in MediaFormat.
41 int channels; 41 int channels;
42 int sample_rate; 42 int sample_rate;
43 int sample_bits; 43 int sample_bits;
44 if (!ParseMediaFormat(media_format, &channels, &sample_rate, &sample_bits)) { 44 if (!ParseMediaFormat(media_format, &channels, &sample_rate, &sample_bits)) {
45 return false; 45 return false;
46 } 46 }
47 47
48 // Create the audio output stream in browser process. 48 // Create the audio output stream in browser process.
49 size_t packet_size = kSamplesPerBuffer * channels * sample_bits / 8; 49 size_t packet_size = kSamplesPerBuffer * channels * sample_bits / 8;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 if (packet_requested_) { 149 if (packet_requested_) {
150 DCHECK(shared_memory_.get()); 150 DCHECK(shared_memory_.get());
151 // Fill into the shared memory. 151 // Fill into the shared memory.
152 size_t filled = FillBuffer(static_cast<uint8*>(shared_memory_->memory()), 152 size_t filled = FillBuffer(static_cast<uint8*>(shared_memory_->memory()),
153 shared_memory_size_); 153 shared_memory_size_);
154 packet_requested_ = false; 154 packet_requested_ = false;
155 // Then tell browser process we are done filling into the buffer. 155 // Then tell browser process we are done filling into the buffer.
156 delegate_->view()->NotifyAudioPacketReady(stream_id_, filled); 156 delegate_->view()->NotifyAudioPacketReady(stream_id_, filled);
157 } 157 }
158 } 158 }
159
160 const media::MediaFormat* AudioRendererImpl::GetMediaFormat() {
161 return &media_format_;
162 }
OLDNEW
« no previous file with comments | « chrome/renderer/media/audio_renderer_impl.h ('k') | chrome/renderer/media/data_source_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698