mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1218694 - Return the AudioNode connected to when calling AudioNode.connect(). r=smaug
This commit is contained in:
parent
81fba50329
commit
2834e84fab
@ -177,25 +177,25 @@ AudioNode::DisconnectFromGraph()
|
||||
DestroyMediaStream();
|
||||
}
|
||||
|
||||
void
|
||||
AudioNode*
|
||||
AudioNode::Connect(AudioNode& aDestination, uint32_t aOutput,
|
||||
uint32_t aInput, ErrorResult& aRv)
|
||||
{
|
||||
if (aOutput >= NumberOfOutputs() ||
|
||||
aInput >= aDestination.NumberOfInputs()) {
|
||||
aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
|
||||
return;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (Context() != aDestination.Context()) {
|
||||
aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
|
||||
return;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (FindIndexOfNodeWithPorts(aDestination.mInputNodes, this, aInput, aOutput) !=
|
||||
nsTArray<AudioNode::InputNode>::NoIndex) {
|
||||
// connection already exists.
|
||||
return;
|
||||
return &aDestination;
|
||||
}
|
||||
|
||||
// The MediaStreamGraph will handle cycle detection. We don't need to do it
|
||||
@ -220,6 +220,8 @@ AudioNode::Connect(AudioNode& aDestination, uint32_t aOutput,
|
||||
|
||||
// This connection may have connected a panner and a source.
|
||||
Context()->UpdatePannerSource();
|
||||
|
||||
return &aDestination;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -89,8 +89,8 @@ public:
|
||||
return mContext;
|
||||
}
|
||||
|
||||
virtual void Connect(AudioNode& aDestination, uint32_t aOutput,
|
||||
uint32_t aInput, ErrorResult& aRv);
|
||||
virtual AudioNode* Connect(AudioNode& aDestination, uint32_t aOutput,
|
||||
uint32_t aInput, ErrorResult& aRv);
|
||||
|
||||
virtual void Connect(AudioParam& aDestination, uint32_t aOutput,
|
||||
ErrorResult& aRv);
|
||||
|
@ -33,13 +33,14 @@ public:
|
||||
|
||||
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
virtual void Connect(AudioNode& aDestination, uint32_t aOutput,
|
||||
uint32_t aInput, ErrorResult& aRv) override
|
||||
virtual AudioNode* Connect(AudioNode& aDestination, uint32_t aOutput,
|
||||
uint32_t aInput, ErrorResult& aRv) override
|
||||
{
|
||||
AudioNode::Connect(aDestination, aOutput, aInput, aRv);
|
||||
AudioNode* node = AudioNode::Connect(aDestination, aOutput, aInput, aRv);
|
||||
if (!aRv.Failed()) {
|
||||
UpdateConnectedStatus();
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
virtual void Connect(AudioParam& aDestination, uint32_t aOutput,
|
||||
|
@ -24,7 +24,7 @@ enum ChannelInterpretation {
|
||||
interface AudioNode : EventTarget {
|
||||
|
||||
[Throws]
|
||||
void connect(AudioNode destination, optional unsigned long output = 0, optional unsigned long input = 0);
|
||||
AudioNode connect(AudioNode destination, optional unsigned long output = 0, optional unsigned long input = 0);
|
||||
[Throws]
|
||||
void connect(AudioParam destination, optional unsigned long output = 0);
|
||||
[Throws]
|
||||
|
Loading…
Reference in New Issue
Block a user