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 29 matching lines...) Expand all Loading... |
40 static const unsigned long kMaxChannelCount = 8; | 40 static const unsigned long kMaxChannelCount = 8; |
41 | 41 |
42 MediaStreamAudioDestinationHandler::MediaStreamAudioDestinationHandler(AudioNode
& node, size_t numberOfChannels) | 42 MediaStreamAudioDestinationHandler::MediaStreamAudioDestinationHandler(AudioNode
& node, size_t numberOfChannels) |
43 : AudioBasicInspectorHandler(NodeTypeMediaStreamAudioDestination, node, node
.context()->sampleRate(), numberOfChannels) | 43 : AudioBasicInspectorHandler(NodeTypeMediaStreamAudioDestination, node, node
.context()->sampleRate(), numberOfChannels) |
44 , m_mixBus(AudioBus::create(numberOfChannels, ProcessingSizeInFrames)) | 44 , m_mixBus(AudioBus::create(numberOfChannels, ProcessingSizeInFrames)) |
45 { | 45 { |
46 m_source = MediaStreamSource::create("WebAudio-" + createCanonicalUUIDString
(), MediaStreamSource::TypeAudio, "MediaStreamAudioDestinationNode", false, true
, MediaStreamSource::ReadyStateLive, true); | 46 m_source = MediaStreamSource::create("WebAudio-" + createCanonicalUUIDString
(), MediaStreamSource::TypeAudio, "MediaStreamAudioDestinationNode", false, true
, MediaStreamSource::ReadyStateLive, true); |
47 MediaStreamSourceVector audioSources; | 47 MediaStreamSourceVector audioSources; |
48 audioSources.append(m_source.get()); | 48 audioSources.append(m_source.get()); |
49 MediaStreamSourceVector videoSources; | 49 MediaStreamSourceVector videoSources; |
50 m_stream = MediaStream::create(node.context()->executionContext(), MediaStre
amDescriptor::create(audioSources, videoSources)); | 50 m_stream = MediaStream::create(node.context()->getExecutionContext(), MediaS
treamDescriptor::create(audioSources, videoSources)); |
51 MediaStreamCenter::instance().didCreateMediaStreamAndTracks(m_stream->descri
ptor()); | 51 MediaStreamCenter::instance().didCreateMediaStreamAndTracks(m_stream->descri
ptor()); |
52 | 52 |
53 m_source->setAudioFormat(numberOfChannels, node.context()->sampleRate()); | 53 m_source->setAudioFormat(numberOfChannels, node.context()->sampleRate()); |
54 | 54 |
55 initialize(); | 55 initialize(); |
56 } | 56 } |
57 | 57 |
58 PassRefPtr<MediaStreamAudioDestinationHandler> MediaStreamAudioDestinationHandle
r::create(AudioNode& node, size_t numberOfChannels) | 58 PassRefPtr<MediaStreamAudioDestinationHandler> MediaStreamAudioDestinationHandle
r::create(AudioNode& node, size_t numberOfChannels) |
59 { | 59 { |
60 return adoptRef(new MediaStreamAudioDestinationHandler(node, numberOfChannel
s)); | 60 return adoptRef(new MediaStreamAudioDestinationHandler(node, numberOfChannel
s)); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 return new MediaStreamAudioDestinationNode(context, numberOfChannels); | 127 return new MediaStreamAudioDestinationNode(context, numberOfChannels); |
128 } | 128 } |
129 | 129 |
130 MediaStream* MediaStreamAudioDestinationNode::stream() const | 130 MediaStream* MediaStreamAudioDestinationNode::stream() const |
131 { | 131 { |
132 return static_cast<MediaStreamAudioDestinationHandler&>(handler()).stream(); | 132 return static_cast<MediaStreamAudioDestinationHandler&>(handler()).stream(); |
133 } | 133 } |
134 | 134 |
135 } // namespace blink | 135 } // namespace blink |
136 | 136 |
OLD | NEW |