Title: [166408] trunk/Source/WebCore
- Revision
- 166408
- Author
- [email protected]
- Date
- 2014-03-28 08:49:39 -0700 (Fri, 28 Mar 2014)
Log Message
[Mac] HLS streams will report an incorrect natural size.
https://bugs.webkit.org/show_bug.cgi?id=130859
Reviewed by Eric Carlson.
Some HLS streams will report incorrect naturalSizes due to the asset's preferredTransform
property not being available at the same time as the track's natural size. Given that
AVFoundation only allows one video track to be selected at a time, simply use the asset's
presentation size, cached in m_cachedPresentation size in all cases.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (166407 => 166408)
--- trunk/Source/WebCore/ChangeLog 2014-03-28 15:36:40 UTC (rev 166407)
+++ trunk/Source/WebCore/ChangeLog 2014-03-28 15:49:39 UTC (rev 166408)
@@ -1,3 +1,18 @@
+2014-03-28 Jer Noble <[email protected]>
+
+ [Mac] HLS streams will report an incorrect natural size.
+ https://bugs.webkit.org/show_bug.cgi?id=130859
+
+ Reviewed by Eric Carlson.
+
+ Some HLS streams will report incorrect naturalSizes due to the asset's preferredTransform
+ property not being available at the same time as the track's natural size. Given that
+ AVFoundation only allows one video track to be selected at a time, simply use the asset's
+ presentation size, cached in m_cachedPresentation size in all cases.
+
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
+
2014-03-28 Antti Koivisto <[email protected]>
Remove NodeListRootType flag
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (166407 => 166408)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2014-03-28 15:36:40 UTC (rev 166407)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2014-03-28 15:49:39 UTC (rev 166408)
@@ -1520,31 +1520,7 @@
if (!m_avAsset)
return;
- // Some assets don't report track properties until they are completely ready to play, but we
- // want to report a size as early as possible so use presentationSize when an asset has no tracks.
- if (m_avPlayerItem && ![m_cachedTracks count]) {
- setNaturalSize(roundedIntSize(m_cachedPresentationSize));
- return;
- }
-
- // AVAsset's 'naturalSize' property only considers the movie's first video track, so we need to compute
- // the union of all visual track rects.
- CGRect trackUnionRect = CGRectZero;
- for (AVPlayerItemTrack *track in m_cachedTracks.get()) {
- AVAssetTrack* assetTrack = [track assetTrack];
- CGSize trackSize = [assetTrack naturalSize];
- CGRect trackRect = CGRectMake(0, 0, trackSize.width, trackSize.height);
- trackUnionRect = CGRectUnion(trackUnionRect, CGRectApplyAffineTransform(trackRect, [assetTrack preferredTransform]));
- }
-
- // The movie is always displayed at 0,0 so move the track rect to the origin before using width and height.
- trackUnionRect = CGRectOffset(trackUnionRect, trackUnionRect.origin.x, trackUnionRect.origin.y);
-
- // Also look at the asset's preferred transform so we account for a movie matrix.
- CGSize naturalSize = CGSizeApplyAffineTransform(trackUnionRect.size, [m_avAsset.get() preferredTransform]);
-
- // Cache the natural size (setNaturalSize will notify the player if it has changed).
- setNaturalSize(IntSize(naturalSize));
+ setNaturalSize(roundedIntSize(m_cachedPresentationSize));
}
#if PLATFORM(IOS)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes