Feat:add ext for audio and video frame#515
Merged
Sy0307 merged 4 commits intoalibaba:moq_v05_patchfrom Nov 20, 2025
Merged
Conversation
TEST: with moq_demo_audio_server and moq_demo_client
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for extension headers in audio and video frames for the MOQ (Media over QUIC) transport protocol. The feature allows clients to attach custom metadata to media frames that is preserved end-to-end.
Key changes:
- Introduces a new message type
XQC_MOQ_MSG_OBJECT_STREAM_EXT(0x30) for objects with extension headers - Adds
ext_headersandext_headers_lenfields to audio/video frame structures - Implements encode/decode logic for the extended message format with validation and handling of extension headers
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| include/moq/xqc_moq.h | Adds extension header fields to video and audio frame structures, and defines new message type enum |
| moq/moq_transport/xqc_moq_message.h | Declares encode/decode functions and handler for the extended object stream message type |
| moq/moq_transport/xqc_moq_message.c | Implements encoding, decoding, creation, and cleanup for extended object stream messages with extension headers |
| moq/moq_transport/xqc_moq_message_handler.h | Declares handler function for processing extended object stream messages |
| moq/moq_transport/xqc_moq_message_handler.c | Implements conversion of extended messages to standard object messages for processing |
| moq/moq_transport/xqc_moq_message_writer.h | Declares writer function for extended object stream messages |
| moq/moq_transport/xqc_moq_message_writer.c | Implements writer for extended object stream messages |
| moq/moq_media/xqc_moq_media_track.c | Updates audio/video frame write and read paths to handle extension headers when present |
| moq/demo/xqc_moq_demo_client.c | Demonstrates sending extension headers with audio frames and displays received extension headers |
| moq/demo/xqc_moq_audiodemo_server.c | Updates audio frame logging to include extension header length |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TEST: with moq_demo_audio_server and moq_demo_client
moq/demo/moq_demo_client -n 5
option frame num :5
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:522 (xqc_client_conn_create_notify)
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:582 (xqc_client_conn_handshake_finished)
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:66 (save_session_cb)
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:66 (save_session_cb)
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:319 (on_session_setup)
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:366 (on_datachannel)
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:455 (on_catalog)
track_namespace:namespace track_name:audio track_type:1 codec:opus mime_type:audio/mp4 bitrate:32000 lang:null framerate:0 width:0 height:0 display_width:0 display_height:0 samplerate:48000 channel_config:2
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:384 (on_subscribe)
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:378 (on_datachannel_msg)
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:440 (on_subscribe_ok)
subscribe_id:2 expire_ms:0 content_exist:1 largest_group_id:0 largest_object_id:0
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:499 (on_audio_frame)
subscribe_id:2, seq_num:0, timestamp_us:1763152444706786, audio_len:1024, dcid:0f483b07e4219ab3d8af7e5b
audio ext headers: raw_len=15, data=4 test_ext_data
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:499 (on_audio_frame)
subscribe_id:2, seq_num:1, timestamp_us:1763152444746223, audio_len:1024, dcid:0f483b07e4219ab3d8af7e5b
audio ext headers: raw_len=15, data=3 test_ext_data
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:499 (on_audio_frame)
subscribe_id:2, seq_num:2, timestamp_us:1763152444784609, audio_len:1024, dcid:0f483b07e4219ab3d8af7e5b
audio ext headers: raw_len=15, data=2 test_ext_data
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:499 (on_audio_frame)
subscribe_id:2, seq_num:3, timestamp_us:1763152444821691, audio_len:1024, dcid:0f483b07e4219ab3d8af7e5b
audio ext headers: raw_len=15, data=1 test_ext_data
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:499 (on_audio_frame)
subscribe_id:2, seq_num:4, timestamp_us:1763152444861803, audio_len:1024, dcid:0f483b07e4219ab3d8af7e5b
audio ext headers: raw_len=15, data=0 test_ext_data
/src/xquic-ali/moq/demo/xqc_moq_demo_client.c:554 (xqc_client_conn_close_notify)
send_count:16, lost_count:0, lost_dgram_count:0, tlp_count:0, recv_count:26, srtt:9520 early_data_flag:2, conn_err:0, ack_info:#30-29#0-0#0-0#v0429, alpn:moq-quic, fec_recovered:0