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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 MediaStreamAudioDestinationHandler::MediaStreamAudioDestinationHandler( | 43 MediaStreamAudioDestinationHandler::MediaStreamAudioDestinationHandler( |
44 AudioNode& node, | 44 AudioNode& node, |
45 size_t numberOfChannels) | 45 size_t numberOfChannels) |
46 : AudioBasicInspectorHandler(NodeTypeMediaStreamAudioDestination, | 46 : AudioBasicInspectorHandler(NodeTypeMediaStreamAudioDestination, |
47 node, | 47 node, |
48 node.context()->sampleRate(), | 48 node.context()->sampleRate(), |
49 numberOfChannels), | 49 numberOfChannels), |
50 m_mixBus(AudioBus::create(numberOfChannels, ProcessingSizeInFrames)) { | 50 m_mixBus(AudioBus::create(numberOfChannels, ProcessingSizeInFrames)) { |
51 m_source = MediaStreamSource::create( | 51 m_source = MediaStreamSource::create( |
52 "WebAudio-" + createCanonicalUUIDString(), MediaStreamSource::TypeAudio, | 52 "WebAudio-" + createCanonicalUUIDString(), MediaStreamSource::TypeAudio, |
53 "MediaStreamAudioDestinationNode", false, | 53 "MediaStreamAudioDestinationNode", MediaStreamSource::ReadyStateLive, |
54 MediaStreamSource::ReadyStateLive, true); | 54 true); |
55 MediaStreamSourceVector audioSources; | 55 MediaStreamSourceVector audioSources; |
56 audioSources.append(m_source.get()); | 56 audioSources.append(m_source.get()); |
57 MediaStreamSourceVector videoSources; | 57 MediaStreamSourceVector videoSources; |
58 m_stream = MediaStream::create( | 58 m_stream = MediaStream::create( |
59 node.context()->getExecutionContext(), | 59 node.context()->getExecutionContext(), |
60 MediaStreamDescriptor::create(audioSources, videoSources)); | 60 MediaStreamDescriptor::create(audioSources, videoSources)); |
61 MediaStreamCenter::instance().didCreateMediaStreamAndTracks( | 61 MediaStreamCenter::instance().didCreateMediaStreamAndTracks( |
62 m_stream->descriptor()); | 62 m_stream->descriptor()); |
63 | 63 |
64 m_source->setAudioFormat(numberOfChannels, node.context()->sampleRate()); | 64 m_source->setAudioFormat(numberOfChannels, node.context()->sampleRate()); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 | 157 |
158 return new MediaStreamAudioDestinationNode(context, numberOfChannels); | 158 return new MediaStreamAudioDestinationNode(context, numberOfChannels); |
159 } | 159 } |
160 | 160 |
161 MediaStream* MediaStreamAudioDestinationNode::stream() const { | 161 MediaStream* MediaStreamAudioDestinationNode::stream() const { |
162 return static_cast<MediaStreamAudioDestinationHandler&>(handler()).stream(); | 162 return static_cast<MediaStreamAudioDestinationHandler&>(handler()).stream(); |
163 } | 163 } |
164 | 164 |
165 } // namespace blink | 165 } // namespace blink |
OLD | NEW |