Skip to content

Commit

Permalink
Rename class related to object message to improve readability (#162)
Browse files Browse the repository at this point in the history
* refactor: rename datagram object message

* refactor: fix wording in comment

* refactor: rename subgroup stream messages

* refactor: fix wording in logging

* refactor: rename track stream messages

* refactor: rename object process results

* refactor: rename object receiver and forwarder

* refactor: rename wt writer

* refactor: rename a test

* refactor: remove unnecessary as_any

* refactor: rename stream files
  • Loading branch information
tetter27 authored Feb 3, 2025
1 parent b59a2d3 commit 72f3835
Show file tree
Hide file tree
Showing 21 changed files with 1,095 additions and 1,154 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Supported version: draft-ietf-moq-transport-06
- [x] SUBSCRIBE_NAMESPACE_OK
- [x] SUBSCRIBE_NAMESPACE_ERROR
- [ ] Data Streams
- [x] Object Datagram Message
- [x] Datagram
- [x] Track Stream
- [ ] Subgroup Stream
- [ ] Features
Expand Down
36 changes: 18 additions & 18 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,27 @@ init().then(async () => {
console.log({ subscribeNamespaceResponse })
})

client.onObjectDatagram(async (objectDatagram) => {
console.log({ objectDatagram })
describeReceivedObject(objectDatagram.object_payload)
client.onDatagramObject(async (datagramObject) => {
console.log({ datagramObject })
describeReceivedObject(datagramObject.object_payload)
})

client.onStreamHeaderTrack(async (streamHeaderTrack) => {
console.log({ streamHeaderTrack })
client.onTrackStreamHeader(async (trackStreamHeader) => {
console.log({ trackStreamHeader })
})

client.onObjectStreamTrack(async (objectStreamTrack) => {
console.log({ objectStreamTrack })
describeReceivedObject(objectStreamTrack.object_payload)
client.onTrackStreamObject(async (trackStreamObject) => {
console.log({ trackStreamObject })
describeReceivedObject(trackStreamObject.object_payload)
})

client.onStreamHeaderSubgroup(async (streamHeaderSubgroup) => {
console.log({ streamHeaderSubgroup })
client.onSubgroupStreamHeader(async (subgroupStreamHeader) => {
console.log({ subgroupStreamHeader })
})

client.onObjectStreamSubgroup(async (objectStreamSubgroup) => {
console.log({ objectStreamSubgroup })
describeReceivedObject(objectStreamSubgroup.object_payload)
client.onSubgroupStreamObject(async (subgroupStreamObject) => {
console.log({ subgroupStreamObject })
describeReceivedObject(subgroupStreamObject.object_payload)
})

const objectIdElement = document.getElementById('objectId')
Expand Down Expand Up @@ -172,7 +172,7 @@ init().then(async () => {
// encode the text to the object array
const objectPayloadArray = new TextEncoder().encode(objectPayloadString)

await client.sendObjectDatagram(
await client.sendDatagramObject(
BigInt(subscribeId),
BigInt(trackAlias),
mutableGroupId,
Expand All @@ -196,11 +196,11 @@ init().then(async () => {

// send header if it is the first time
if (!headerSend) {
await client.sendStreamHeaderTrackMessage(BigInt(subscribeId), BigInt(trackAlias), publisherPriority)
await client.sendTrackStreamHeaderMessage(BigInt(subscribeId), BigInt(trackAlias), publisherPriority)
headerSend = true
}

await client.sendObjectStreamTrack(BigInt(subscribeId), mutableGroupId, objectId++, objectPayloadArray)
await client.sendTrackStreamObject(BigInt(subscribeId), mutableGroupId, objectId++, objectPayloadArray)
objectIdElement.textContent = objectId
})

Expand All @@ -219,7 +219,7 @@ init().then(async () => {

// send header if it is the first time
if (!headerSend) {
await client.sendStreamHeaderSubgroupMessage(
await client.sendSubgroupStreamHeaderMessage(
BigInt(subscribeId),
BigInt(trackAlias),
BigInt(groupId),
Expand All @@ -229,7 +229,7 @@ init().then(async () => {
headerSend = true
}

await client.sendObjectStreamSubgroup(subscribeId, objectId++, objectPayloadArray)
await client.sendSubgroupStreamObject(subscribeId, objectId++, objectPayloadArray)
objectIdElement.textContent = objectId
})

Expand Down
Loading

0 comments on commit 72f3835

Please sign in to comment.