Bug 93591 - Use the new AVPlayerItemVideoOutput API in MediaPlayerPrivateAVFoundation.
Summary: Use the new AVPlayerItemVideoOutput API in MediaPlayerPrivateAVFoundation.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-09 01:10 PDT by Jer Noble
Modified: 2012-08-10 13:13 PDT (History)
3 users (show)

See Also:


Attachments
Patch (20.38 KB, patch)
2012-08-09 13:58 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (17.95 KB, patch)
2012-08-09 14:33 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (17.93 KB, patch)
2012-08-10 09:58 PDT, 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 2012-08-09 01:10:58 PDT
Use the new AVPlayerItemVideoOutput API in MediaPlayerPrivateAVFoundation.
Comment 1 Jer Noble 2012-08-09 13:58:18 PDT
Created attachment 157542 [details]
Patch
Comment 2 Simon Fraser (smfr) 2012-08-09 14:07:48 PDT
Comment on attachment 157542 [details]
Patch

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

> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:837
> +    m_imageGenerator = [AVAssetImageGenerator assetImageGeneratorWithAsset:m_avAsset.get()];

Shouldn't this use an adopt?
Comment 3 Jer Noble 2012-08-09 14:11:41 PDT
Comment on attachment 157542 [details]
Patch

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

>> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:837
>> +    m_imageGenerator = [AVAssetImageGenerator assetImageGeneratorWithAsset:m_avAsset.get()];
> 
> Shouldn't this use an adopt?

It isn't clear that this function was simply moved, but if you look above (at original line 196), you see that this has always been like this.

It could be re-written to use the non-autoreleased version of the constructor, which would then need an adopt.  Or I could move this back to where it originally was and just add more  #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080.  But either way, modifying the old path is probably out of scope for this bug.
Comment 4 Jer Noble 2012-08-09 14:33:31 PDT
Created attachment 157552 [details]
Patch
Comment 5 Jer Noble 2012-08-10 09:58:04 PDT
Created attachment 157752 [details]
Patch

Fixed a logic error in setUpVideorendering()
Comment 6 Eric Carlson 2012-08-10 10:45:15 PDT
Comment on attachment 157752 [details]
Patch

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

> Source/WebCore/ChangeLog:23
> +        Pull out existing the AVAssetImageGenerator into its own functions:

Nit: typo "Pull out existing the ..." -> "Pull out the existing ..."

> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:833
> +    NSDictionary* attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInt:k32BGRAPixelFormat], kCVPixelBufferPixelFormatTypeKey,

I assume you are using k32BGRAPixelFormat because it is the most efficient format to draw? A comment about why this is so (is that the format <canvas> uses?) would be helpful.

Nit: I would prefer (slightly) if we didn't use autoreleased NSObjects.
Comment 7 Jer Noble 2012-08-10 10:57:15 PDT
(In reply to comment #6)
> (From update of attachment 157752 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=157752&action=review
> 
> > Source/WebCore/ChangeLog:23
> > +        Pull out existing the AVAssetImageGenerator into its own functions:
> 
> Nit: typo "Pull out existing the ..." -> "Pull out the existing ..."

Fixed.

> > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:833
> > +    NSDictionary* attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInt:k32BGRAPixelFormat], kCVPixelBufferPixelFormatTypeKey,
> 
> I assume you are using k32BGRAPixelFormat because it is the most efficient format to draw? A comment about why this is so (is that the format <canvas> uses?) would be helpful.

Indeed.  I'll add a comment.

> Nit: I would prefer (slightly) if we didn't use autoreleased NSObjects.

I'd prefer if we could use dictionary literals.  One day... (Fixed)
Comment 8 Jer Noble 2012-08-10 13:13:14 PDT
Committed r125318: <http://trac.webkit.org/changeset/125318>