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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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()); |
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 // Set number of output channels to stereo by default. |
422 // FIXME: The default should probably be stereo instead of mono. | 422 return MediaStreamAudioDestinationNode::create(this, 2); |
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); |
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 { |
(...skipping 605 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 |