Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 38 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion moq
Submodule moq updated 1472 files
16 changes: 8 additions & 8 deletions rs/moq-scene/src/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ async fn copy(
// The group ends at what it holds, where the source
// has not said.
_ = stop.changed() => {
drop(copy.close()?);
drop(copy.finish()?);
break 'groups;
}
};
Expand All @@ -575,8 +575,8 @@ async fn copy(
// The copy ends where the source ended its group, when it said,
// so a paused source's last picture ages out of the copy too.
match group.end() {
Some(end) => drop(copy.finish(end)?),
None => drop(copy.close()?),
Some(end) => drop(copy.finish_at(end)?),
None => drop(copy.finish()?),
}
}
out.clone().finish().map(drop)
Expand Down Expand Up @@ -664,7 +664,7 @@ impl<'a> Listing<'a> {
while let Some(mut catalog) = updates.next().await? {
// Media timing is the root's: the one clock, and the join interval an
// HLS export numbers its segments on.
catalog.media = Default::default();
catalog.sync = Default::default();
// The claim is checked inside the mutation, so a newer source's
// writes, made under the same lock, are never overwritten.
studio.mutate(|root| {
Expand Down Expand Up @@ -1449,7 +1449,7 @@ mod tests {
let snapshot = listed(&catalog, |sources| sources.len() == 2).await;
assert!(snapshot.video.renditions.is_empty(), "no source is a program rendition");
let published = &snapshot.ext.studio.sources;
assert!(published["red"].media.is_empty(), "the root carries the media timing");
assert!(published["red"].sync.is_empty(), "the root carries the media timing");
assert_eq!(sources.get("red").unwrap().track(), Some(Status::Live));
assert_eq!(sources.get("guest").unwrap().track(), None);
assert!(sources.get("red copy").is_none(), "a clone opens no feed, so no track");
Expand Down Expand Up @@ -1578,15 +1578,15 @@ mod tests {
for (start, appended) in [(1_000, true), (3_000, true), (5_000, false)] {
// Nothing says what lies between 3 000 and 5 000.
let group = match appended {
true => source.append_group(start),
true => source.append_group(moq_net::Timestamp::from_micros(start).unwrap()),
false => source.create_group(moq_net::group::Info { start }),
};
// The first group says where it ends; the others only close.
let group = group.unwrap();
drop(
match start {
1_000 => group.finish(2_000),
_ => group.close(),
1_000 => group.finish_at(2_000),
_ => group.finish(),
}
.unwrap(),
);
Expand Down
18 changes: 9 additions & 9 deletions rs/moq-scene/src/replay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ fn copy_held(
into.write_frame(frame.timestamp, frame.payload.clone())?;
}
match (&held.read, held.end) {
(Ok(()), Some(end)) => drop(into.finish(end)?),
(Ok(()), None) => drop(into.close()?),
(Ok(()), Some(end)) => drop(into.finish_at(end)?),
(Ok(()), None) => drop(into.finish()?),
(Err(err), _) => into.abort(err.clone())?,
}
}
Expand Down Expand Up @@ -423,7 +423,7 @@ mod tests {
/// [`write`] as a publisher appends, saying nothing lies between this group
/// and the one before.
fn append(track: &moq_net::track::Producer, sequence: u64, at: &[u64]) {
fill(track.append_group(at[0] * 1000).unwrap(), sequence, at);
fill(track.append_group(ts(at[0])).unwrap(), sequence, at);
}

fn fill(mut group: moq_net::group::Producer, sequence: u64, at: &[u64]) {
Expand All @@ -432,7 +432,7 @@ mod tests {
.write_frame(ts(*at), format!("{sequence}.{index}").into_bytes())
.unwrap();
}
group.close().unwrap();
group.finish().unwrap();
}

/// A group's second, from its start in microseconds.
Expand Down Expand Up @@ -556,13 +556,13 @@ mod tests {
async fn a_take_keeps_where_its_whole_groups_end() {
let (broadcast, track) = broadcast(0, None);
for sequence in 0..3 {
let mut group = track.append_group(sequence * 1_000_000).unwrap();
let mut group = track.append_group(ts(sequence * 1_000)).unwrap();
for (index, at) in second(sequence).iter().enumerate() {
group
.write_frame(ts(*at), format!("{sequence}.{index}").into_bytes())
.unwrap();
}
drop(group.finish((sequence + 1) * 1_000_000).unwrap());
drop(group.finish_at((sequence + 1) * 1_000_000).unwrap());
}
let take = Take::new(&target(&broadcast, ts(2_500)), Duration::from_secs(2)).unwrap();
let mut copied = take
Expand Down Expand Up @@ -656,7 +656,7 @@ mod tests {
#[tokio::test(start_paused = true)]
async fn a_take_at_the_live_edge_holds_what_was_written() {
let (broadcast, track) = broadcast(7, None);
let mut live = track.append_group(7_000_000).unwrap();
let mut live = track.append_group(ts(7_000)).unwrap();
live.write_frame(ts(7_000), b"7.0".to_vec()).unwrap();
let take = Take::new(&target(&broadcast, ts(7_500)), Duration::from_secs(3)).unwrap();
live.write_frame(ts(7_333), b"7.1".to_vec()).unwrap();
Expand Down Expand Up @@ -708,15 +708,15 @@ mod tests {
// The marker a publisher writes as it stops encoding.
let config = target(&broadcast, ts(0)).video.unwrap().1;
let container = moq_mux::catalog::hang::Container::try_from(&config).unwrap();
let mut group = track.append_group(3_500_000).unwrap();
let mut group = track.append_group(ts(3_500)).unwrap();
let gap = moq_mux::container::Frame {
timestamp: ts(3_500),
payload: bytes::Bytes::new(),
keyframe: false,
duration: None,
};
container.write(&mut group, &[gap]).unwrap();
group.close().unwrap();
group.finish().unwrap();
let result = Take::new(&target(&broadcast, ts(3_900)), Duration::from_millis(300));
assert!(matches!(result, Err(Error::Unsupported(_))), "{:?}", result.err());
}
Expand Down
Loading
Loading