Changeset 207584 in webkit
- Timestamp:
- Oct 19, 2016 8:10:12 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207583 r207584 1 2016-10-19 Jer Noble <jer.noble@apple.com> 2 3 REGRESSION (r206025): All YouTube videos play with black bars on all four sides 4 https://bugs.webkit.org/show_bug.cgi?id=163308 5 6 Reviewed by Darin Adler. 7 8 * media/media-source/media-source-resize-expected.txt: Added. 9 * media/media-source/media-source-resize.html: Added. 10 1 11 2016-10-19 Nan Wang <n_wang@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r207583 r207584 1 2016-10-19 Jer Noble <jer.noble@apple.com> 2 3 REGRESSION (r206025): All YouTube videos play with black bars on all four sides 4 https://bugs.webkit.org/show_bug.cgi?id=163308 5 6 Reviewed by Darin Adler. 7 8 Test: media/media-source/media-source-resize.html 9 10 After r206025, we do not fire resize events when the size change notification happens equal- 11 to-or-before the current time, which can happen at the very beginning of a stream. Take care 12 of this case by checking that the target time isn't actually in the past inside of 13 sizeWillChangeAtTime(), and also always skip the boundary time observer when there was no 14 previous size (such as after a flush due to a seek). 15 16 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: 17 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: 18 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime): 19 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize): 20 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: 21 (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples): 22 (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): 23 1 24 2016-10-19 Nan Wang <n_wang@apple.com> 2 25 -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
r206811 r207584 85 85 void effectiveRateChanged(); 86 86 void sizeWillChangeAtTime(const MediaTime&, const FloatSize&); 87 void setNaturalSize(const FloatSize&); 87 88 void flushPendingSizeChanges(); 88 89 void characteristicsChanged(); -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
r206811 r207584 690 690 if (!weakThis) 691 691 return; 692 RetainPtr<id> observer = weakThis->m_sizeChangeObservers.takeFirst(); 693 weakThis->m_naturalSize = size; 694 weakThis->m_player->sizeChanged(); 692 weakThis->m_sizeChangeObservers.removeFirst(); 693 weakThis->setNaturalSize(size); 695 694 }]; 696 695 m_sizeChangeObservers.append(WTFMove(observer)); 696 697 if (currentMediaTime() >= time) 698 setNaturalSize(size); 699 } 700 701 void MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize(const FloatSize& size) 702 { 703 if (size == m_naturalSize) 704 return; 705 706 m_naturalSize = size; 707 m_player->sizeChanged(); 697 708 } 698 709 -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h
r206518 r207584 158 158 CDMSessionMediaSourceAVFObjC* m_session { nullptr }; 159 159 160 FloatSizem_cachedSize;160 Optional<FloatSize> m_cachedSize; 161 161 FloatSize m_currentSize; 162 162 bool m_parsingSucceeded; -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
r207523 r207584 963 963 } 964 964 965 m_cachedSize = Nullopt; 966 965 967 if (m_mediaSource) { 966 968 m_mediaSource->player()->setHasAvailableVideoFrame(false); … … 986 988 CMFormatDescriptionRef formatDescription = CMSampleBufferGetFormatDescription(platformSample.sample.cmSampleBuffer); 987 989 FloatSize formatSize = FloatSize(CMVideoFormatDescriptionGetPresentationDimensions(formatDescription, true, true)); 988 if ( formatSize != m_cachedSize) {990 if (!m_cachedSize || formatSize != m_cachedSize.value()) { 989 991 LOG(MediaSource, "SourceBufferPrivateAVFObjC::enqueueSample(%p) - size change detected: {width=%lf, height=%lf}", formatSize.width(), formatSize.height()); 992 bool sizeWasNull = !m_cachedSize; 990 993 m_cachedSize = formatSize; 991 if (m_mediaSource) 992 m_mediaSource->player()->sizeWillChangeAtTime(mediaSample->presentationTime(), formatSize); 994 if (m_mediaSource) { 995 if (sizeWasNull) 996 m_mediaSource->player()->setNaturalSize(formatSize); 997 else 998 m_mediaSource->player()->sizeWillChangeAtTime(mediaSample->presentationTime(), formatSize); 999 } 993 1000 } 994 1001 … … 1034 1041 FloatSize SourceBufferPrivateAVFObjC::naturalSize() 1035 1042 { 1036 return m_cachedSize ;1043 return m_cachedSize.valueOr(FloatSize()); 1037 1044 } 1038 1045
Note: See TracChangeset
for help on using the changeset viewer.