| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "modules/webaudio/AudioContext.h" | 31 #include "modules/webaudio/AudioContext.h" |
| 32 #include "modules/webaudio/AudioNodeInput.h" | 32 #include "modules/webaudio/AudioNodeInput.h" |
| 33 #include "platform/UUID.h" | 33 #include "platform/UUID.h" |
| 34 #include "platform/mediastream/MediaStreamCenter.h" | 34 #include "platform/mediastream/MediaStreamCenter.h" |
| 35 #include "public/platform/WebRTCPeerConnectionHandler.h" | 35 #include "public/platform/WebRTCPeerConnectionHandler.h" |
| 36 #include "wtf/Locker.h" | 36 #include "wtf/Locker.h" |
| 37 | 37 |
| 38 namespace WebCore { | 38 namespace WebCore { |
| 39 | 39 |
| 40 PassRefPtr<MediaStreamAudioDestinationNode> MediaStreamAudioDestinationNode::cre
ate(AudioContext* context, size_t numberOfChannels) | 40 PassRefPtrWillBeRawPtr<MediaStreamAudioDestinationNode> MediaStreamAudioDestinat
ionNode::create(AudioContext* context, size_t numberOfChannels) |
| 41 { | 41 { |
| 42 return adoptRef(new MediaStreamAudioDestinationNode(context, numberOfChannel
s)); | 42 return adoptRefWillBeNoop(new MediaStreamAudioDestinationNode(context, numbe
rOfChannels)); |
| 43 } | 43 } |
| 44 | 44 |
| 45 MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode(AudioContext* c
ontext, size_t numberOfChannels) | 45 MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode(AudioContext* c
ontext, size_t numberOfChannels) |
| 46 : AudioBasicInspectorNode(context, context->sampleRate(), numberOfChannels) | 46 : AudioBasicInspectorNode(context, context->sampleRate(), numberOfChannels) |
| 47 , m_mixBus(AudioBus::create(numberOfChannels, ProcessingSizeInFrames)) | 47 , m_mixBus(AudioBus::create(numberOfChannels, ProcessingSizeInFrames)) |
| 48 { | 48 { |
| 49 ScriptWrappable::init(this); | 49 ScriptWrappable::init(this); |
| 50 setNodeType(NodeTypeMediaStreamAudioDestination); | 50 setNodeType(NodeTypeMediaStreamAudioDestination); |
| 51 | 51 |
| 52 m_source = MediaStreamSource::create("WebAudio-" + createCanonicalUUIDString
(), MediaStreamSource::TypeAudio, "MediaStreamAudioDestinationNode", MediaStream
Source::ReadyStateLive, true); | 52 m_source = MediaStreamSource::create("WebAudio-" + createCanonicalUUIDString
(), MediaStreamSource::TypeAudio, "MediaStreamAudioDestinationNode", MediaStream
Source::ReadyStateLive, true); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 68 | 68 |
| 69 void MediaStreamAudioDestinationNode::process(size_t numberOfFrames) | 69 void MediaStreamAudioDestinationNode::process(size_t numberOfFrames) |
| 70 { | 70 { |
| 71 m_mixBus->copyFrom(*input(0)->bus()); | 71 m_mixBus->copyFrom(*input(0)->bus()); |
| 72 m_source->consumeAudio(m_mixBus.get(), numberOfFrames); | 72 m_source->consumeAudio(m_mixBus.get(), numberOfFrames); |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace WebCore | 75 } // namespace WebCore |
| 76 | 76 |
| 77 #endif // ENABLE(WEB_AUDIO) | 77 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |