本文整理汇总了C++中MediaStream::AsProcessedStream方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaStream::AsProcessedStream方法的具体用法?C++ MediaStream::AsProcessedStream怎么用?C++ MediaStream::AsProcessedStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaStream
的用法示例。
在下文中一共展示了MediaStream::AsProcessedStream方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
AudioNode::Connect(AudioParam& aDestination, uint32_t aOutput,
ErrorResult& aRv)
{
if (aOutput >= NumberOfOutputs()) {
aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
return;
}
if (Context() != aDestination.GetParentObject()) {
aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
return;
}
if (FindIndexOfNodeWithPorts(aDestination.InputNodes(),
this, INVALID_PORT, aOutput) !=
nsTArray<AudioNode::InputNode>::NoIndex) {
// connection already exists.
return;
}
mOutputParams.AppendElement(&aDestination);
InputNode* input = aDestination.AppendInputNode();
input->mInputNode = this;
input->mInputPort = INVALID_PORT;
input->mOutputPort = aOutput;
MediaStream* stream = aDestination.Stream();
MOZ_ASSERT(stream->AsProcessedStream());
ProcessedMediaStream* ps = static_cast<ProcessedMediaStream*>(stream);
if (mStream) {
// Setup our stream as an input to the AudioParam's stream
MOZ_ASSERT(aOutput <= UINT16_MAX, "Unexpected large output port number");
input->mStreamPort =
ps->AllocateInputPort(mStream, AudioNodeStream::AUDIO_TRACK, TRACK_ANY,
0, static_cast<uint16_t>(aOutput));
}
}