Bug 212402

Summary: RealtimeIncomingVideoSourceCocoa::OnFrame should use video frame timestamp
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebRTCAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, ews-watchlist, glenn, hta, jer.noble, philipj, sergio, tommyw, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

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>