Skip to content

Commit ee1f348

Browse files
committed
Move bandwidth data from event to attribute
1 parent a438620 commit ee1f348

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

index.bs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,9 @@ interface RTCTransformEvent : Event {
587587
};
588588

589589
interface BandwidthInfo {
590-
readonly attribute long bandwidth; // bits per second
591-
readonly attribute long bufferDepth; // bytes that can be sent with no loss at sender
590+
readonly attribute long allocatedBitrate; // bits per second
591+
readonly attribute long availableOutgoingBitrate;
592+
readonly attribute boolean writable;
592593
};
593594

594595
partial interface DedicatedWorkerGlobalScope {
@@ -604,6 +605,7 @@ interface mixin RTCRtpScriptSource {
604605

605606
interface mixin RTCRtpScriptSink {
606607
readonly attribute WritableStream writable;
608+
attribute BandwidthInfo bandwidthInfo;
607609
attribute EventHandler onbandwidthestimate;
608610
attribute EventHandler onkeyframerequest;
609611
};
@@ -620,11 +622,6 @@ interface RTCRtpScriptTransform {
620622
constructor(Worker worker, optional any options, optional sequence<object> transfer);
621623
};
622624

623-
interface BandwidthEstimateEvent : Event {
624-
constructor(DOMString type, BandwidthInfo info);
625-
readonly attribute BandwidthInfo bandwidthInfo;
626-
};
627-
628625
interface KeyFrameRequestEvent : Event {
629626
constructor(DOMString type, optional DOMString rid);
630627
readonly attribute DOMString? rid;
@@ -694,11 +691,22 @@ The <dfn attribute for="RTCRtpScriptSink">onbandwidthestimate</dfn> EventHandler
694691

695692
The <dfn attribute for="RTCRtpScriptSink">onkeyframerequest</dfn> EventHandler has type keyframerequest.
696693

697-
## Events ##
694+
## Attributes of BandwidthInfo ## {#BandwidthEstimate-attributes}
695+
The <dfn attribute for="BandwidthEstimate">allocatedBitrate</dfn> attribute represents the bandwith that the downstream
696+
entity recommends to be allocated for media from this source. If this number is exceeded, the downstream entity
697+
can drop frames to stay within the allocated bandwidth limit.
698+
699+
The <dfn attribute for="BandwidthEstimate">availableOutgoingBitrate</dfn> attribute represents the overall bandwidth estimate
700+
of the downstream entity - for an {{RTCRtpSender}}, this is the same number as the {{RTCIceCandidatePairStats/availableOutgoingBitrate}} of the {{RTCIceCandidatePair}} object that is currently supporting the transport.
701+
702+
The <dfn attribute for="BandwidthEstimate">writable</dfn> attribute is true whenever it is possible to enqueue a
703+
frame for processing without it being immediately discarded. Note that delivery is not guaranteed under any circumstance.
704+
705+
## Events ## {#RTCRtpScriptTransformer-events}
698706

699-
The following events fire on an RTCRtpScriptTransform:
707+
The following events fire on an {{RTCRtpScriptTransformer}}:
700708

701-
* bandwidthestimate of type {{BandwidthEstimateEvent}} - fired when the sink determines that the bandwidth estimate has changed significantly from what has been previously signalled. In the context of {{RTCRtpScriptTransform}}, if the event is not cancelled, the information will be passed to the source as if the sendBandwidthEstimate() function had been called.
709+
* bandwidthestimate of type {{Event}} - fired when the sink determines that the bandwidth estimate has changed significantly from what has been previously signalled. Significant changes include a change to the "writable" attribute, a decrease of the "allocatedBitrate" attribute, or an increase of more than 10% of the "allocatedBitrate" attribute. In the context of {{RTCRtpScriptTransform}}, if the event is not cancelled, the information will be passed to the source as if the sendBandwidthEstimate() function had been called.
702710

703711
* keyframerequest of type {{KeyFrameRequestEvent}} - fired when the sink determines that a key frame has been requested. In the context of {{RTCRtpScriptTransform}}, if the event is not cancelled, the information will be passed to the source as if the generateKeyFrame() function had been called. <!-- NOTE IN DRAFT: generateKeyFrame() and requestKeyFrame() should merge -->
704712

0 commit comments

Comments
 (0)