Bug 146908

Summary: Implement VideoTrackPrivateAVFObjC for MediaStreamPrivate
Product: WebKit Reporter: Matthew Daiter <mdaiter>
Component: WebCore Misc.Assignee: Matthew Daiter <mdaiter>
Status: RESOLVED INVALID    
Severity: Normal CC: bfulgham, eric.carlson, jonlee, mdaiter, webkit-bug-importer, webkit.review.bot
Priority: P2 Keywords: InRadar, PlatformOnly
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 146906    
Attachments:
Description Flags
Patch bfulgham: review-

Description Matthew Daiter 2015-07-13 11:29:34 PDT
Make sure we can implement platform-specific portions of the video streaming API for the browser media streams.
Comment 1 Radar WebKit Bug Importer 2015-07-13 11:30:53 PDT
<rdar://problem/21796914>
Comment 2 Matthew Daiter 2015-07-13 13:15:45 PDT
Created attachment 256717 [details]
Patch
Comment 3 Brent Fulgham 2015-07-16 17:48:55 PDT
Comment on attachment 256717 [details]
Patch

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

Looks good, but I don't like the potential null access. Let's make it a reference if we know it's always present; otherwise null check.

> Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaStreamAVFObjC.mm:80
> +    m_parent->activeStatusChanged();

Can m_parent be null? If it shouldn't be, we should take it as a reference in the constructor. Otherwise, we need to null-check here.
Comment 4 Eric Carlson 2015-07-17 07:47:09 PDT
Comment on attachment 256717 [details]
Patch

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

> Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaStreamAVFObjC.mm:66
> +void VideoTrackPrivateMediaStreamAVFObjC::setAssetTrack(AVAssetTrack *track)
> +{
> +    m_impl = std::make_unique<AVTrackPrivateAVFObjCImpl>(track);
> +    resetPropertiesFromTrack();
> +}
> +
> +AVAssetTrack* VideoTrackPrivateMediaStreamAVFObjC::assetTrack() const
> +{
> +    return m_impl->assetTrack();
> +}

Is it possible to have an AVAssetTrack now, or is this for the future? If the later, remove it for now and we can add it when it is needed.

> Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaStreamAVFObjC.mm:86
> +FloatSize VideoTrackPrivateMediaStreamAVFObjC::naturalSize() const
> +{
> +    return FloatSize([assetTrack() naturalSize]);
> +}

What about the nature size of a media stream track that does not have an AVAssetTrack?