Bug 212402 - RealtimeIncomingVideoSourceCocoa::OnFrame should use video frame timestamp
Summary: RealtimeIncomingVideoSourceCocoa::OnFrame should use video frame timestamp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-27 01:45 PDT by youenn fablet
Modified: 2020-05-28 01:41 PDT (History)
10 users (show)

See Also:


Attachments
Patch (18.55 KB, patch)
2020-05-27 02:45 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (18.54 KB, patch)
2020-05-27 04:28 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2020-05-27 01:45:15 PDT
RealtimeIncomingVideoSourceCocoa::OnFrame should use video frame timestamp
Comment 1 youenn fablet 2020-05-27 02:45:31 PDT
Created attachment 400317 [details]
Patch
Comment 2 youenn fablet 2020-05-27 04:28:39 PDT
Created attachment 400320 [details]
Patch
Comment 3 Eric Carlson 2020-05-27 09:59:37 PDT
Comment on attachment 400320 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=400320&action=review

Nice simplification!

> Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:331
>      while (!m_pendingVideoSampleQueue.isEmpty()) {
> -        if (m_pendingVideoSampleQueue.first()->decodeTime() > now)
> +        auto presentationTime = m_pendingVideoSampleQueue.first()->presentationTime();
> +        if (presentationTime.isValid() && presentationTime > now)
>              break;
>          m_pendingVideoSampleQueue.removeFirst();

Will this do the right thing with 'display immediately' samples?
Comment 4 youenn fablet 2020-05-27 13:30:54 PDT
(In reply to Eric Carlson from comment #3)
> Comment on attachment 400320 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=400320&action=review
> 
> Nice simplification!
> 
> > Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:331
> >      while (!m_pendingVideoSampleQueue.isEmpty()) {
> > -        if (m_pendingVideoSampleQueue.first()->decodeTime() > now)
> > +        auto presentationTime = m_pendingVideoSampleQueue.first()->presentationTime();
> > +        if (presentationTime.isValid() && presentationTime > now)
> >              break;
> >          m_pendingVideoSampleQueue.removeFirst();
> 
> Will this do the right thing with 'display immediately' samples?

There might indeed be an issue in general.
In practice, for WebRTC usage (which is the sole use of this class), we could probably further simplify and just use one sample as a buffer instead of a duque, since we want to use the newest sample for WebRTC.
Comment 5 EWS 2020-05-28 01:40:46 PDT
Committed r262238: <https://trac.webkit.org/changeset/262238>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 400320 [details].
Comment 6 Radar WebKit Bug Importer 2020-05-28 01:41:18 PDT
<rdar://problem/63710172>