Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio: add rtp sequence number on incoming frames #154

Merged
merged 3 commits into from
Jan 31, 2023

Conversation

fippo
Copy link
Collaborator

@fippo fippo commented Sep 29, 2022

where it is easily available.

This is useful in cases where one decodes audio using other means and just wants to grab the encoded frame (similar to what @alvestrand describes here as "alternative consumers")


Preview | Diff

index.bs Outdated
@@ -311,6 +311,7 @@ dictionary RTCEncodedAudioFrameMetadata {
long synchronizationSource;
octet payloadType;
sequence<long> contributingSources;
short? sequenceNumber; // RTP sequence number on incoming frames.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it nullable?

From an editorial perspective, we should probably have a section describing each metadata.
Can we add this section and add a description for sequenceNumber, like a link to RFC 3550 corresponding section.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm avoiding answering the question how/if this is supposed to work on outbound packets. The encoder might not be concerned with the RTP sequence number (which starts at a random offset) yet. On the receiving end the sequence number is always known (but I think there will be gaps when receiving padding-only probes)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given sequenceNumber is not required, outgoing frames would have their sequenceNumber field be undefined.

It would be nice though to set sequenceNumber as required for incoming frames.
This seems to be another hint at exposing different APIs for outgoing frames vs. incoming frames.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets use #155 for the format of how to describe fields

Copy link
Collaborator Author

@fippo fippo Oct 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the ? since dictionary members are optional by default.
We probably need to add some required in other places (see also #138)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that exposing this is information useful and necessary.

However I think we would do better to expose the index (https://www.rfc-editor.org/rfc/rfc3711#section-3.3.1).
In order to decrypt the packet we've already calculated the index correctly (i.e. factored in the ROC) - there is no reason to make the javascript developer do it again here.
The benefit is that for any sensible length calls you can assume a monotonically increasing index making packet drops and out-of-order packets simpler to detect and manage.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked and at least libwebrtc rarely cares about the extended sequence number and does not expose it at a level needed for wiring it up here.

@fippo fippo force-pushed the incoming-audio-sequencenumber branch from 80906e8 to 73472cd Compare September 29, 2022 15:51
@solmaks
Copy link

solmaks commented Nov 30, 2022

@youennf , @alvestrand , are there any extra changes that you believe are required prior to merging this? Having access to sequence numbers enables applications to build custom audio receive pipelines that operate on top of RTP.

@alvestrand
Copy link
Contributor

This is the PR where we have the discussion on the short sequence number vs the long sequence number.

@fippo
Copy link
Collaborator Author

fippo commented Jan 16, 2023

@steely-glint
Copy link

Ok, then perhaps the best compromise is to expose the short sequence number but include javascript reference code for converting to the long sequence number in the documentation, so fewer people get caught out.

@fippo
Copy link
Collaborator Author

fippo commented Jan 16, 2023

Added a note about serial number arithmetic (which got me pondering why it is not called sequence number arithmetic :-))

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 19, 2023
spec change w3c/webrtc-encoded-transform#154

drive-by:
- fix idl of payloadType to be octet instead of short
- remove unused contributing_sources vector on audio frame

BUG=TBD

Change-Id: Ic8dc8dcebb035a8f79823a8ca70e02ac1d6788cf
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 20, 2023
spec change w3c/webrtc-encoded-transform#154

drive-by:
- fix idl of payloadType to be octet instead of short
- remove unused contributing_sources vector on audio frame

BUG=TBD

Change-Id: Ic8dc8dcebb035a8f79823a8ca70e02ac1d6788cf
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 25, 2023
spec change w3c/webrtc-encoded-transform#154

drive-by:
- fix idl of payloadType to be octet instead of short
- remove unused contributing_sources vector on audio frame

BUG=TBD

Change-Id: Ic8dc8dcebb035a8f79823a8ca70e02ac1d6788cf
@alvestrand alvestrand merged commit 5c7ab84 into w3c:main Jan 31, 2023
@fippo fippo deleted the incoming-audio-sequencenumber branch January 31, 2023 13:41
github-actions bot added a commit that referenced this pull request Jan 31, 2023
SHA: 5c7ab84
Reason: push, by alvestrand

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 31, 2023
spec change w3c/webrtc-encoded-transform#154

drive-by:
- fix idl of payloadType to be octet instead of short
- remove unused contributing_sources vector on audio frame

BUG=chromium:1411703

Change-Id: Ic8dc8dcebb035a8f79823a8ca70e02ac1d6788cf
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 2, 2023
spec change w3c/webrtc-encoded-transform#154

drive-by:
- fix idl of payloadType to be octet instead of short

BUG=chromium:1411703

Change-Id: Ic8dc8dcebb035a8f79823a8ca70e02ac1d6788cf
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 2, 2023
spec change w3c/webrtc-encoded-transform#154

drive-by:
- fix idl of payloadType to be octet instead of short

BUG=chromium:1411703

Change-Id: Ic8dc8dcebb035a8f79823a8ca70e02ac1d6788cf
aarongable pushed a commit to chromium/chromium that referenced this pull request Feb 2, 2023
spec change w3c/webrtc-encoded-transform#154

drive-by:
- fix idl of payloadType to be octet instead of short

BUG=chromium:1411703

Change-Id: Ic8dc8dcebb035a8f79823a8ca70e02ac1d6788cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3925401
Reviewed-by: Harald Alvestrand <hta@chromium.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1100372}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 2, 2023
spec change w3c/webrtc-encoded-transform#154

drive-by:
- fix idl of payloadType to be octet instead of short

BUG=chromium:1411703

Change-Id: Ic8dc8dcebb035a8f79823a8ca70e02ac1d6788cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3925401
Reviewed-by: Harald Alvestrand <hta@chromium.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1100372}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 2, 2023
spec change w3c/webrtc-encoded-transform#154

drive-by:
- fix idl of payloadType to be octet instead of short

BUG=chromium:1411703

Change-Id: Ic8dc8dcebb035a8f79823a8ca70e02ac1d6788cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3925401
Reviewed-by: Harald Alvestrand <hta@chromium.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1100372}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Feb 5, 2023
…ber to incoming audio metadata, a=testonly

Automatic update from web-platform-tests
insertable streams: add rtp sequence number to incoming audio metadata

spec change w3c/webrtc-encoded-transform#154

drive-by:
- fix idl of payloadType to be octet instead of short

BUG=chromium:1411703

Change-Id: Ic8dc8dcebb035a8f79823a8ca70e02ac1d6788cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3925401
Reviewed-by: Harald Alvestrand <hta@chromium.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1100372}

--

wpt-commits: 7815492dc65bf1f07447668ab144a655cba44351
wpt-pr: 38057
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Feb 7, 2023
…ber to incoming audio metadata, a=testonly

Automatic update from web-platform-tests
insertable streams: add rtp sequence number to incoming audio metadata

spec change w3c/webrtc-encoded-transform#154

drive-by:
- fix idl of payloadType to be octet instead of short

BUG=chromium:1411703

Change-Id: Ic8dc8dcebb035a8f79823a8ca70e02ac1d6788cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3925401
Reviewed-by: Harald Alvestrand <hta@chromium.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1100372}

--

wpt-commits: 7815492dc65bf1f07447668ab144a655cba44351
wpt-pr: 38057
marcoscaceres pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 28, 2023
spec change w3c/webrtc-encoded-transform#154

drive-by:
- fix idl of payloadType to be octet instead of short

BUG=chromium:1411703

Change-Id: Ic8dc8dcebb035a8f79823a8ca70e02ac1d6788cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3925401
Reviewed-by: Harald Alvestrand <hta@chromium.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1100372}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants