Bug 125156 - [MSE][Mac] Report the intrinsic size of the media element
Summary: [MSE][Mac] Report the intrinsic size of the media element
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-03 08:50 PST by Jer Noble
Modified: 2014-01-10 12:44 PST (History)
3 users (show)

See Also:


Attachments
Patch (21.53 KB, patch)
2014-01-08 23:32 PST, Jer Noble
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2013-12-03 08:50:37 PST
[MSE][Mac] Report the intrinsic size of the media element from MediaPlayerPrivateMediaSourceAVFObjC::naturalSize().
Comment 1 Jer Noble 2014-01-08 23:32:25 PST
Created attachment 220699 [details]
Patch
Comment 2 Eric Carlson 2014-01-09 07:30:06 PST
Comment on attachment 220699 [details]
Patch

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

A test case would be useful.

> Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:331
> +            auto videoTrack = VideoTrackPrivateMediaSourceAVFObjC::create(track, this);

This seems like one if the cases where "auto" is not helpful because someone reading the code can't know what style of ref-ptr VideoTrackPrivateMediaSourceAVFObjC::create returns.

> Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:338
> +            auto audioTrack = AudioTrackPrivateMediaSourceAVFObjC::create(track, this);

Ditto.
Comment 3 Jer Noble 2014-01-09 16:25:50 PST
(In reply to comment #2)
> (From update of attachment 220699 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=220699&action=review
> 
> A test case would be useful.

Unfortunately, this isn't really testable at the moment; we could add a Mock test, but that wouldn't test this change.

> > Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:331
> > +            auto videoTrack = VideoTrackPrivateMediaSourceAVFObjC::create(track, this);
> 
> This seems like one if the cases where "auto" is not helpful because someone reading the code can't know what style of ref-ptr VideoTrackPrivateMediaSourceAVFObjC::create returns.

I wonder if "RefPtr<auto>" would be valid syntax?

> > Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:338
> > +            auto audioTrack = AudioTrackPrivateMediaSourceAVFObjC::create(track, this);
> 
> Ditto.

Ditto.
Comment 4 Jer Noble 2014-01-09 16:29:11 PST
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 220699 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=220699&action=review
> > 
> > A test case would be useful.
> 
> Unfortunately, this isn't really testable at the moment; we could add a Mock test, but that wouldn't test this change.
> 
> > > Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:331
> > > +            auto videoTrack = VideoTrackPrivateMediaSourceAVFObjC::create(track, this);
> > 
> > This seems like one if the cases where "auto" is not helpful because someone reading the code can't know what style of ref-ptr VideoTrackPrivateMediaSourceAVFObjC::create returns.
> 
> I wonder if "RefPtr<auto>" would be valid syntax?
> 

Nope. "error: 'auto' not allowed in template argument".  I'll switch these back to non-auto types.
Comment 5 Jer Noble 2014-01-09 17:45:51 PST
Committed r161612: <http://trac.webkit.org/changeset/161612>
Comment 6 Darin Adler 2014-01-10 12:44:52 PST
Comment on attachment 220699 [details]
Patch

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

> Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:648
> +    for (auto videoTrack : m_videoTracks) {

Here auto is causing reference count churn. You could use auto& or const auto& to avoid that.