Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 403 audioTrack = audioTracks[i]; | 403 audioTrack = audioTracks[i]; |
| 404 if (audioTrack->component()->audioSourceProvider()) { | 404 if (audioTrack->component()->audioSourceProvider()) { |
| 405 provider = audioTrack->component()->audioSourceProvider(); | 405 provider = audioTrack->component()->audioSourceProvider(); |
| 406 break; | 406 break; |
| 407 } | 407 } |
| 408 } | 408 } |
| 409 | 409 |
| 410 RefPtr<MediaStreamAudioSourceNode> node = MediaStreamAudioSourceNode::create (this, mediaStream, audioTrack.get(), provider); | 410 RefPtr<MediaStreamAudioSourceNode> node = MediaStreamAudioSourceNode::create (this, mediaStream, audioTrack.get(), provider); |
| 411 | 411 |
| 412 // FIXME: Only stereo streams are supported right now. We should be able to accept multi-channel streams. | 412 // FIXME: Only stereo streams are supported right now. We should be able to accept multi-channel streams. |
| 413 node->setFormat(2, sampleRate()); | 413 node->setFormat(2, sampleRate()); |
|
no longer working on chromium
2014/03/25 10:08:29
for example here
| |
| 414 | 414 |
| 415 refNode(node.get()); // context keeps reference until node is disconnected | 415 refNode(node.get()); // context keeps reference until node is disconnected |
| 416 return node; | 416 return node; |
| 417 } | 417 } |
| 418 | 418 |
| 419 PassRefPtr<MediaStreamAudioDestinationNode> AudioContext::createMediaStreamDesti nation() | 419 PassRefPtr<MediaStreamAudioDestinationNode> AudioContext::createMediaStreamDesti nation() |
| 420 { | 420 { |
| 421 // FIXME: Add support for an optional argument which specifies the number of channels. | 421 // FIXME: Add support for an optional argument which specifies the number of channels. |
|
Tommy Widenflycht
2014/03/25 09:49:27
I guess this comment can be removed as well
no longer working on chromium
2014/03/25 10:08:29
Done with replacing the FIXME with a comment, as h
| |
| 422 // FIXME: The default should probably be stereo instead of mono. | 422 return MediaStreamAudioDestinationNode::create(this, 2); |
|
Tommy Widenflycht
2014/03/25 09:49:27
Can this be made into an enum? MediaStreamAudioDes
no longer working on chromium
2014/03/25 10:08:29
:) Looking at the whole file, they use 2 for the c
| |
| 423 return MediaStreamAudioDestinationNode::create(this, 1); | |
| 424 } | 423 } |
| 425 | 424 |
| 426 PassRefPtr<ScriptProcessorNode> AudioContext::createScriptProcessor(ExceptionSta te& exceptionState) | 425 PassRefPtr<ScriptProcessorNode> AudioContext::createScriptProcessor(ExceptionSta te& exceptionState) |
| 427 { | 426 { |
| 428 // Set number of input/output channels to stereo by default. | 427 // Set number of input/output channels to stereo by default. |
| 429 return createScriptProcessor(0, 2, 2, exceptionState); | 428 return createScriptProcessor(0, 2, 2, exceptionState); |
|
no longer working on chromium
2014/03/25 10:08:29
here, and elsewhere in all the webaudio code.
| |
| 430 } | 429 } |
| 431 | 430 |
| 432 PassRefPtr<ScriptProcessorNode> AudioContext::createScriptProcessor(size_t buffe rSize, ExceptionState& exceptionState) | 431 PassRefPtr<ScriptProcessorNode> AudioContext::createScriptProcessor(size_t buffe rSize, ExceptionState& exceptionState) |
| 433 { | 432 { |
| 434 // Set number of input/output channels to stereo by default. | 433 // Set number of input/output channels to stereo by default. |
| 435 return createScriptProcessor(bufferSize, 2, 2, exceptionState); | 434 return createScriptProcessor(bufferSize, 2, 2, exceptionState); |
| 436 } | 435 } |
| 437 | 436 |
| 438 PassRefPtr<ScriptProcessorNode> AudioContext::createScriptProcessor(size_t buffe rSize, size_t numberOfInputChannels, ExceptionState& exceptionState) | 437 PassRefPtr<ScriptProcessorNode> AudioContext::createScriptProcessor(size_t buffe rSize, size_t numberOfInputChannels, ExceptionState& exceptionState) |
| 439 { | 438 { |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1039 } | 1038 } |
| 1040 | 1039 |
| 1041 void AudioContext::decrementActiveSourceCount() | 1040 void AudioContext::decrementActiveSourceCount() |
| 1042 { | 1041 { |
| 1043 atomicDecrement(&m_activeSourceCount); | 1042 atomicDecrement(&m_activeSourceCount); |
| 1044 } | 1043 } |
| 1045 | 1044 |
| 1046 } // namespace WebCore | 1045 } // namespace WebCore |
| 1047 | 1046 |
| 1048 #endif // ENABLE(WEB_AUDIO) | 1047 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |