Bug 168860 - Add public method to MediaTime for doing timeScale conversion.
Summary: Add public method to MediaTime for doing timeScale conversion.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords:
Depends on:
Blocks: 168898
  Show dependency treegraph
 
Reported: 2017-02-24 17:29 PST by Jer Noble
Modified: 2017-02-27 08:55 PST (History)
3 users (show)

See Also:


Attachments
Patch (13.11 KB, patch)
2017-02-24 17:47 PST, Jer Noble
eric.carlson: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews115 for mac-elcapitan (1.66 MB, application/zip)
2017-02-24 22:05 PST, Build Bot
no flags Details
Patch for landing (13.11 KB, patch)
2017-02-27 08:45 PST, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2017-02-24 17:29:59 PST
Add public method to MediaTime for doing timeScale conversion.
Comment 1 Jer Noble 2017-02-24 17:47:22 PST
Created attachment 302718 [details]
Patch
Comment 2 Build Bot 2017-02-24 22:05:17 PST
Comment on attachment 302718 [details]
Patch

Attachment 302718 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/3189326

New failing tests:
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag.html
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html
Comment 3 Build Bot 2017-02-24 22:05:20 PST
Created attachment 302735 [details]
Archive of layout-test-results from ews115 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews115  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 4 youenn fablet 2017-02-25 14:18:40 PST
Comment on attachment 302718 [details]
Patch

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

> Source/WTF/ChangeLog:9
> +        will be used when converting to a new time scale.

This seems fine, although two tests are failing.

The broader question I have is whether MediaTime abstraction is the best approach here.
For the mac platform, we are probably going from CMTime to MediaTime and (I am guessing) back to CMTime.
If so, maybe we would be better using something like a PlatformMediaTime wrapping a CMTime (and maybe a MediaTime for GTK) instead of directly using a MediaTime?
Comment 5 youenn fablet 2017-02-26 10:45:23 PST
Or maybe PlatformAudioData should own its time as CMTime for Mac
Comment 6 Eric Carlson 2017-02-27 06:38:15 PST
Comment on attachment 302718 [details]
Patch

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

> Source/WTF/wtf/MediaTime.cpp:530
> +        if (static_cast<int64_t>(llabs(remainder))*2 >= static_cast<int64_t>(timeScale)) {

Nit: spaces around the "*"
Comment 7 Jer Noble 2017-02-27 08:29:06 PST
(In reply to comment #4)
> Comment on attachment 302718 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=302718&action=review
> 
> > Source/WTF/ChangeLog:9
> > +        will be used when converting to a new time scale.
> 
> This seems fine, although two tests are failing.
> 
> The broader question I have is whether MediaTime abstraction is the best
> approach here.
> For the mac platform, we are probably going from CMTime to MediaTime and (I
> am guessing) back to CMTime.
> If so, maybe we would be better using something like a PlatformMediaTime
> wrapping a CMTime (and maybe a MediaTime for GTK) instead of directly using
> a MediaTime?

No. MediaTime is very heavily used in the MSE codebase. Adding an extra indirection + soft link dispatch for every time operation would be unacceptably slow. And then every port would need to re-invent their own rational time class which would look, in the end, exactly the same as MediaTime. There's no practical benefit.
Comment 8 Jer Noble 2017-02-27 08:39:00 PST
(In reply to comment #7)
> (In reply to comment #4)
> > Comment on attachment 302718 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=302718&action=review
> > 
> > > Source/WTF/ChangeLog:9
> > > +        will be used when converting to a new time scale.
> > 
> > This seems fine, although two tests are failing.

Those tests have been flaky for a while: <https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#tests=media%2Fmodern-media-controls%2Fmacos-fullscreen-media-controls%2Fmacos-fullscreen-media-controls-drag.html>
Comment 9 Jer Noble 2017-02-27 08:45:43 PST
Created attachment 302842 [details]
Patch for landing
Comment 10 Jer Noble 2017-02-27 08:55:20 PST
Committed r213068: <http://trac.webkit.org/changeset/213068>