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

Side by Side Diff: content/renderer/media/audio_message_filter.cc

Issue 525313002: SyncSocket Transit Descriptor - refactoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits done - Prelanding checks Created 6 years, 3 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 (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/renderer/media/audio_message_filter.h" 5 #include "content/renderer/media/audio_message_filter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "content/common/media/audio_messages.h" 10 #include "content/common/media/audio_messages.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 while (!it.IsAtEnd()) { 161 while (!it.IsAtEnd()) {
162 it.GetCurrentValue()->OnIPCClosed(); 162 it.GetCurrentValue()->OnIPCClosed();
163 delegates_.Remove(it.GetCurrentKey()); 163 delegates_.Remove(it.GetCurrentKey());
164 it.Advance(); 164 it.Advance();
165 } 165 }
166 } 166 }
167 167
168 void AudioMessageFilter::OnStreamCreated( 168 void AudioMessageFilter::OnStreamCreated(
169 int stream_id, 169 int stream_id,
170 base::SharedMemoryHandle handle, 170 base::SharedMemoryHandle handle,
171 #if defined(OS_WIN) 171 base::SyncSocket::TransitDescriptor socket_descriptor,
172 base::SyncSocket::Handle socket_handle,
173 #else
174 base::FileDescriptor socket_descriptor,
175 #endif
176 uint32 length) { 172 uint32 length) {
177 DCHECK(io_message_loop_->BelongsToCurrentThread()); 173 DCHECK(io_message_loop_->BelongsToCurrentThread());
178 174
179 WebRtcLogMessage(base::StringPrintf( 175 WebRtcLogMessage(base::StringPrintf(
180 "AMF::OnStreamCreated. stream_id=%d", 176 "AMF::OnStreamCreated. stream_id=%d",
181 stream_id)); 177 stream_id));
182 178
183 #if !defined(OS_WIN) 179 base::SyncSocket::Handle socket_handle =
184 base::SyncSocket::Handle socket_handle = socket_descriptor.fd; 180 base::SyncSocket::UnwrapHandle(socket_descriptor);
185 #endif
186 181
187 media::AudioOutputIPCDelegate* delegate = delegates_.Lookup(stream_id); 182 media::AudioOutputIPCDelegate* delegate = delegates_.Lookup(stream_id);
188 if (!delegate) { 183 if (!delegate) {
189 DLOG(WARNING) << "Got OnStreamCreated() event for a non-existent or removed" 184 DLOG(WARNING) << "Got OnStreamCreated() event for a non-existent or removed"
190 << " audio renderer. (stream_id=" << stream_id << ")."; 185 << " audio renderer. (stream_id=" << stream_id << ").";
191 base::SharedMemory::CloseHandle(handle); 186 base::SharedMemory::CloseHandle(handle);
192 base::SyncSocket socket(socket_handle); 187 base::SyncSocket socket(socket_handle);
193 return; 188 return;
194 } 189 }
195 delegate->OnStreamCreated(handle, socket_handle, length); 190 delegate->OnStreamCreated(handle, socket_handle, length);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 audio_hardware_config_->UpdateOutputConfig(output_params); 236 audio_hardware_config_->UpdateOutputConfig(output_params);
242 } 237 }
243 238
244 void AudioMessageFilter::SetAudioHardwareConfig( 239 void AudioMessageFilter::SetAudioHardwareConfig(
245 media::AudioHardwareConfig* config) { 240 media::AudioHardwareConfig* config) {
246 base::AutoLock auto_lock(lock_); 241 base::AutoLock auto_lock(lock_);
247 audio_hardware_config_ = config; 242 audio_hardware_config_ = config;
248 } 243 }
249 244
250 } // namespace content 245 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/audio_message_filter.h ('k') | content/renderer/media/audio_message_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698