| 25 | } |
| 26 | |
| 27 | NullDeviceNode::NullDeviceNode(AudioContext & ac, |
| 28 | const AudioStreamConfig & outputConfig, double lengthSeconds) |
| 29 | : AudioNode(ac, *desc()) |
| 30 | , m_lengthSeconds(lengthSeconds) |
| 31 | , m_context(&ac) |
| 32 | , outConfig(outputConfig) |
| 33 | { |
| 34 | addInput(std::unique_ptr<AudioNodeInput>(new AudioNodeInput(this))); |
| 35 | |
| 36 | m_numChannels = outputConfig.desired_channels; |
| 37 | m_renderBus = std::unique_ptr<AudioBus>(new AudioBus(m_numChannels, offlineRenderSizeQuantum)); |
| 38 | |
| 39 | m_channelCount = m_numChannels; |
| 40 | m_channelCountMode = ChannelCountMode::Explicit; |
| 41 | m_channelInterpretation = ChannelInterpretation::Discrete; |
| 42 | |
| 43 | // We need to partially fill the the info struct here so that the context's graph thread |
| 44 | // has enough initial info to make connections/disconnections appropriately |
| 45 | info = {}; |
| 46 | info.sampling_rate = outConfig.desired_samplerate; |
| 47 | info.epoch[0] = info.epoch[1] = std::chrono::high_resolution_clock::now(); |
| 48 | |
| 49 | ContextGraphLock glock(&ac, "NullDeviceNode"); |
| 50 | AudioNode::setChannelCount(glock, m_numChannels); |
| 51 | initialize(); |
| 52 | } |
| 53 | |
| 54 | NullDeviceNode::~NullDeviceNode() |
| 55 | { |
nothing calls this directly
no outgoing calls
no test coverage detected