Title: [178890] branches/safari-600.5-branch/Source/WebCore

Diff

Modified: branches/safari-600.5-branch/Source/WebCore/ChangeLog (178889 => 178890)


--- branches/safari-600.5-branch/Source/WebCore/ChangeLog	2015-01-22 07:53:01 UTC (rev 178889)
+++ branches/safari-600.5-branch/Source/WebCore/ChangeLog	2015-01-22 08:02:10 UTC (rev 178890)
@@ -1,3 +1,22 @@
+2015-01-21  Matthew Hanson  <matthew_han...@apple.com>
+
+        Merge 171357. rdar://problem/19451349
+
+    2014-07-22  Brent Fulgham  <bfulg...@apple.com>
+
+            [Win] Fix Crash when handling Legible Output callbacks
+            https://bugs.webkit.org/show_bug.cgi?id=134946
+
+            Reviewed by Dean Jackson.
+
+            * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
+            (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Remove
+            Windows-specific 'ASSERT_NOT_REACHED' code path.
+            * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+            (WebCore::createLegibleOutputSubtypes): Added.
+            (WebCore::AVFWrapper::createPlayerItem): Updated to request native
+            samples from AVFoundationCF.
+
 2015-01-16  Brent Fulgham  <bfulg...@apple.com>
 
         Merge r174295. rdar://problem/19501151

Modified: branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp (178889 => 178890)


--- branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp	2015-01-22 07:53:01 UTC (rev 178889)
+++ branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp	2015-01-22 08:02:10 UTC (rev 178890)
@@ -69,6 +69,21 @@
 SOFT_LINK(CoreMedia, CMSampleBufferGetSampleTimingInfo, OSStatus, (CMSampleBufferRef sbuf, CMItemIndex sampleIndex, CMSampleTimingInfo* timingInfoOut), (sbuf, sampleIndex, timingInfoOut))
 SOFT_LINK(CoreMedia, CMFormatDescriptionGetExtensions, CFDictionaryRef, (CMFormatDescriptionRef desc), (desc))
 SOFT_LINK(CoreMedia, CMSampleBufferGetFormatDescription, CMFormatDescriptionRef, (CMSampleBufferRef sbuf), (sbuf))
+#else
+SOFT_LINK_DLL_IMPORT(CoreMedia, CMTimeGetSeconds, Float64, __cdecl, (CMTime time), (time))
+#define CMTimeGetSeconds softLink_CMTimeGetSeconds
+SOFT_LINK_DLL_IMPORT(CoreMedia, CMSampleBufferGetDataBuffer, CMBlockBufferRef, __cdecl, (CMSampleBufferRef sbuf), (sbuf))
+#define CMSampleBufferGetDataBuffer softLink_CMSampleBufferGetDataBuffer
+SOFT_LINK_DLL_IMPORT(CoreMedia, CMBlockBufferCopyDataBytes, OSStatus, __cdecl, (CMBlockBufferRef theSourceBuffer, size_t offsetToData, size_t dataLength, void* destination), (theSourceBuffer, offsetToData, dataLength, destination))
+#define CMBlockBufferCopyDataBytes softLink_CMBlockBufferCopyDataBytes
+SOFT_LINK_DLL_IMPORT(CoreMedia, CMBlockBufferGetDataLength, size_t, __cdecl, (CMBlockBufferRef theBuffer), (theBuffer))
+#define CMBlockBufferGetDataLength softLink_CMBlockBufferGetDataLength
+SOFT_LINK_DLL_IMPORT(CoreMedia, CMSampleBufferGetSampleTimingInfo, OSStatus, __cdecl, (CMSampleBufferRef sbuf, CMItemIndex sampleIndex, CMSampleTimingInfo* timingInfoOut), (sbuf, sampleIndex, timingInfoOut))
+#define CMSampleBufferGetSampleTimingInfo softLink_CMSampleBufferGetSampleTimingInfo
+SOFT_LINK_DLL_IMPORT(CoreMedia, CMFormatDescriptionGetExtensions, CFDictionaryRef, __cdecl, (CMFormatDescriptionRef desc), (desc))
+#define CMFormatDescriptionGetExtensions softLink_CMFormatDescriptionGetExtensions
+SOFT_LINK_DLL_IMPORT(CoreMedia, CMSampleBufferGetFormatDescription, CMFormatDescriptionRef, __cdecl, (CMSampleBufferRef sbuf), (sbuf))
+#define CMSampleBufferGetFormatDescription softLink_CMSampleBufferGetFormatDescription
 #endif
 
 SOFT_LINK_AVF_POINTER(CoreMedia, kCMTextMarkupAttribute_Alignment, CFStringRef)
@@ -546,11 +561,6 @@
 
 void InbandTextTrackPrivateAVF::processNativeSamples(CFArrayRef nativeSamples, const MediaTime& presentationTime)
 {
-#if PLATFORM(WIN)
-    UNUSED_PARAM(nativeSamples);
-    UNUSED_PARAM(presentationTime);
-    ASSERT_NOT_REACHED();
-#else
     if (!nativeSamples)
         return;
 
@@ -640,7 +650,6 @@
 
         m_sampleInputBuffer.remove(0, boxLength);
     }
-#endif
 }
 
 } // namespace WebCore

Modified: branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (178889 => 178890)


--- branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2015-01-22 07:53:01 UTC (rev 178889)
+++ branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2015-01-22 08:02:10 UTC (rev 178890)
@@ -1524,6 +1524,16 @@
     m_timeObserver = adoptCF(AVCFPlayerCreatePeriodicTimeObserverForInterval(playerRef, CMTimeMake(veryLongInterval, 10), m_notificationQueue, &periodicTimeObserverCallback, callbackContext()));
 }
 
+#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP) && HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
+static RetainPtr<CFArrayRef> createLegibleOutputSubtypes()
+{
+    int webVTTInt = kCMSubtitleFormatType_WebVTT;
+    RetainPtr<CFNumberRef> webVTTNumber = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &webVTTInt));
+    CFTypeRef formatTypes[] = { webVTTNumber.get() };
+    return adoptCF(CFArrayCreate(0, formatTypes, WTF_ARRAY_LENGTH(formatTypes), &kCFTypeArrayCallBacks));
+}
+#endif
+
 void AVFWrapper::createPlayerItem()
 {
     ASSERT(isMainThread());
@@ -1557,7 +1567,7 @@
 #if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP) && HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
     const CFTimeInterval legibleOutputAdvanceInterval = 2;
 
-    m_legibleOutput = adoptCF(AVCFPlayerItemLegibleOutputCreateWithMediaSubtypesForNativeRepresentation(kCFAllocatorDefault, 0));
+    m_legibleOutput = adoptCF(AVCFPlayerItemLegibleOutputCreateWithMediaSubtypesForNativeRepresentation(kCFAllocatorDefault, createLegibleOutputSubtypes().get()));
     AVCFPlayerItemOutputSetSuppressPlayerRendering(m_legibleOutput.get(), TRUE);
 
     AVCFPlayerItemLegibleOutputCallbacks callbackInfo;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to