| 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 23 matching lines...) Expand all Loading... |
| 34 #include "wtf/Locker.h" | 34 #include "wtf/Locker.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 MediaStreamAudioDestinationHandler::MediaStreamAudioDestinationHandler(AudioNode
& node, size_t numberOfChannels) | 38 MediaStreamAudioDestinationHandler::MediaStreamAudioDestinationHandler(AudioNode
& node, size_t numberOfChannels) |
| 39 : AudioBasicInspectorHandler(NodeTypeMediaStreamAudioDestination, node, node
.context()->sampleRate(), numberOfChannels) | 39 : AudioBasicInspectorHandler(NodeTypeMediaStreamAudioDestination, node, node
.context()->sampleRate(), numberOfChannels) |
| 40 , m_mixBus(AudioBus::create(numberOfChannels, ProcessingSizeInFrames)) | 40 , m_mixBus(AudioBus::create(numberOfChannels, ProcessingSizeInFrames)) |
| 41 { | 41 { |
| 42 m_source = MediaStreamSource::create("WebAudio-" + createCanonicalUUIDString
(), MediaStreamSource::TypeAudio, "MediaStreamAudioDestinationNode", false, true
, MediaStreamSource::ReadyStateLive, true); | 42 m_source = MediaStreamSource::create("WebAudio-" + createCanonicalUUIDString
(), MediaStreamSource::TypeAudio, "MediaStreamAudioDestinationNode", false, true
, MediaStreamSource::ReadyStateLive, true); |
| 43 MediaStreamSourceVector audioSources; | 43 MediaStreamSourceVector audioSources; |
| 44 audioSources.append(m_source); | 44 audioSources.append(m_source.get()); |
| 45 MediaStreamSourceVector videoSources; | 45 MediaStreamSourceVector videoSources; |
| 46 m_stream = MediaStream::create(node.context()->executionContext(), MediaStre
amDescriptor::create(audioSources, videoSources)); | 46 m_stream = MediaStream::create(node.context()->executionContext(), MediaStre
amDescriptor::create(audioSources, videoSources)); |
| 47 MediaStreamCenter::instance().didCreateMediaStreamAndTracks(m_stream->descri
ptor()); | 47 MediaStreamCenter::instance().didCreateMediaStreamAndTracks(m_stream->descri
ptor()); |
| 48 | 48 |
| 49 m_source->setAudioFormat(numberOfChannels, node.context()->sampleRate()); | 49 m_source->setAudioFormat(numberOfChannels, node.context()->sampleRate()); |
| 50 | 50 |
| 51 initialize(); | 51 initialize(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 PassRefPtr<MediaStreamAudioDestinationHandler> MediaStreamAudioDestinationHandle
r::create(AudioNode& node, size_t numberOfChannels) | 54 PassRefPtr<MediaStreamAudioDestinationHandler> MediaStreamAudioDestinationHandle
r::create(AudioNode& node, size_t numberOfChannels) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 81 } | 81 } |
| 82 | 82 |
| 83 MediaStream* MediaStreamAudioDestinationNode::stream() const | 83 MediaStream* MediaStreamAudioDestinationNode::stream() const |
| 84 { | 84 { |
| 85 return static_cast<MediaStreamAudioDestinationHandler&>(handler()).stream(); | 85 return static_cast<MediaStreamAudioDestinationHandler&>(handler()).stream(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace blink | 88 } // namespace blink |
| 89 | 89 |
| 90 #endif // ENABLE(WEB_AUDIO) | 90 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |