Set RTCEncodedVideoFrame's timestamp to capture_begin_time if available
Doc: go/capture-timestamp-flake Bug: 333420614, 333739617 Change-Id: Ibed94b57dfcd79a35976e53ea4547b0a40d4dd26 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5493785 Reviewed-by: Guido Urdaneta <guidou@chromium.org> Commit-Queue: Palak Agarwal <agpalak@chromium.org> Cr-Commit-Position: refs/heads/main@{#1295378}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
48a945323a
commit
1c245af571
third_party/blink
renderer
platform
peerconnection
web_tests
fast
peerconnection
@ -262,9 +262,15 @@ void WebRtcVideoTrackSource::OnFrameCaptured(
|
||||
}
|
||||
|
||||
std::optional<webrtc::Timestamp> capture_time_identifier;
|
||||
// Set |capture_time_identifier| only when frame->timestamp() is a valid
|
||||
// value (infinite values are invalid).
|
||||
if (!frame->timestamp().is_inf()) {
|
||||
// Set |capture_time_identifier| to capture_begin_time if available, else use
|
||||
// frame->timestamp().
|
||||
if (base::FeatureList::IsEnabled(features::kWebRtcUseCaptureBeginTimestamp) &&
|
||||
frame->metadata().capture_begin_time) {
|
||||
capture_time_identifier = webrtc::Timestamp::Micros(
|
||||
frame->metadata().capture_begin_time->ToInternalValue());
|
||||
} else if (!frame->timestamp().is_inf()) {
|
||||
// Use only when frame->timestamp() is a valid value (infinite values are
|
||||
// invalid).
|
||||
capture_time_identifier =
|
||||
webrtc::Timestamp::Micros(frame->timestamp().InMicroseconds());
|
||||
}
|
||||
|
2
third_party/blink/web_tests/fast/peerconnection/RTCEncodedVideoFrameMetadata-timestamp.html
vendored
2
third_party/blink/web_tests/fast/peerconnection/RTCEncodedVideoFrameMetadata-timestamp.html
vendored
@ -13,7 +13,7 @@ const callee = new RTCPeerConnection({ encodedInsertableStreams: true });
|
||||
t.add_cleanup(() => callee.close());
|
||||
exchangeIceCandidates(caller, callee);
|
||||
|
||||
const stream = await getNoiseStream({ video: true });
|
||||
const stream = await navigator.mediaDevices.getUserMedia({ video: true });
|
||||
const videoTrack = stream.getVideoTracks()[0];
|
||||
t.add_cleanup(() => videoTrack.stop());
|
||||
|
||||
|
Reference in New Issue
Block a user