Commit 96aeb999 authored by roger_fong@apple.com's avatar roger_fong@apple.com

Update AVFoundationCF code following http://trac.webkit.org/changeset/148291.

https://bugs.webkit.org/show_bug.cgi?id=114548.

Reviewed by Eric Carlson.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::seekToTime):
(WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable):
(WebCore):
(WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
(MediaPlayerPrivateAVFoundationCF):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 741f9888
2013-04-09 Roger Fong <roger_fong@apple.com>
Update AVFoundationCF code following http://trac.webkit.org/changeset/148291.
https://bugs.webkit.org/show_bug.cgi?id=114548.
Reviewed by Eric Carlson.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::seekToTime):
(WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable):
(WebCore):
(WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
(MediaPlayerPrivateAVFoundationCF):
2013-04-12 Simon Fraser <simon.fraser@apple.com>
Demystify some code in RenderLayer::updateScrollableAreaSet()
......@@ -3606,6 +3606,7 @@
<ClCompile Include="..\html\canvas\CanvasPathMethods.cpp" />
<ClCompile Include="..\html\parser\HTMLIdentifier.cpp" />
<ClCompile Include="..\html\track\TextTrackCueGeneric.cpp" />
<ClCompile Include="..\html\track\TrackListBase.cpp" />
<ClCompile Include="..\html\track\WebVTTElement.cpp" />
<ClCompile Include="..\inspector\TimelineTraceEventProcessor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
......@@ -11186,6 +11187,7 @@
<ClInclude Include="..\ForwardingHeaders\yarr\YarrJIT.h" />
<ClInclude Include="..\html\canvas\CanvasPathMethods.h" />
<ClInclude Include="..\html\track\TextTrackCueGeneric.h" />
<ClInclude Include="..\html\track\TrackListBase.h" />
<ClInclude Include="..\html\track\WebVTTElement.h" />
<ClInclude Include="..\inspector\TimelineTraceEventProcessor.h" />
<ClInclude Include="..\Modules\filesystem\AsyncFileWriter.h" />
......@@ -13624,4 +13626,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
\ No newline at end of file
......@@ -2412,9 +2412,6 @@
<ClCompile Include="..\loader\cache\CachedRawResource.cpp">
<Filter>loader\cache</Filter>
</ClCompile>
<ClCompile Include="..\loader\cache\CachedRawResourceClient.cpp">
<Filter>loader\cache</Filter>
</ClCompile>
<ClCompile Include="..\loader\cache\CachedResource.cpp">
<Filter>loader\cache</Filter>
</ClCompile>
......@@ -6859,6 +6856,9 @@
<ClCompile Include="..\platform\graphics\cg\SubimageCacheWithTimer.cpp">
<Filter>platform\graphics\cg</Filter>
</ClCompile>
<ClCompile Include="..\html\track\TrackListBase.cpp">
<Filter>html\track</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\CSSGrammar.h">
......@@ -14375,6 +14375,11 @@
<ClInclude Include="..\platform\graphics\cg\SubimageCacheWithTimer.h">
<Filter>platform\graphics\cg</Filter>
</ClInclude>
<ClInclude Include="..\loader\cache\CachedRawResourceClient.h" />
<ClInclude Include="..\platform\VisitedLinkStrategy.h" />
<ClInclude Include="..\html\track\TrackListBase.h">
<Filter>html\track</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\css\CSSGrammar.y.in">
......@@ -15324,4 +15329,4 @@
<Filter>rendering</Filter>
</CustomBuildStep>
</ItemGroup>
</Project>
</Project>
\ No newline at end of file
......@@ -489,7 +489,7 @@ float MediaPlayerPrivateAVFoundationCF::currentTime() const
return 0;
}
void MediaPlayerPrivateAVFoundationCF::seekToTime(float time)
void MediaPlayerPrivateAVFoundationCF::seekToTime(double time)
{
if (!m_avfWrapper)
return;
......@@ -568,7 +568,31 @@ PassRefPtr<TimeRanges> MediaPlayerPrivateAVFoundationCF::platformBufferedTimeRan
return timeRanges.release();
}
float MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable() const
double MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable() const
{
RetainPtr<CFArrayRef> seekableRanges(AdoptCF, AVCFPlayerItemCopySeekableTimeRanges(avPlayerItem(m_avfWrapper)));
if (!seekableRanges)
return 0;
double minTimeSeekable = std::numeric_limits<double>::infinity();
bool hasValidRange = false;
CFIndex rangeCount = CFArrayGetCount(seekableRanges.get());
for (CFIndex i = 0; i < rangeCount; i++) {
CFDictionaryRef range = static_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(seekableRanges.get(), i));
CMTime start = CMTimeMakeFromDictionary(static_cast<CFDictionaryRef>(CFDictionaryGetValue(range, CMTimeRangeStartKey())));
CMTime duration = CMTimeMakeFromDictionary(static_cast<CFDictionaryRef>(CFDictionaryGetValue(range, CMTimeRangeDurationKey())));
if (!timeRangeIsValidAndNotEmpty(start, duration))
continue;
hasValidRange = true;
double startOfRange = CMTimeGetSeconds(start);
if (minTimeSeekable > startOfRange)
minTimeSeekable = startOfRange;
}
return hasValidRange ? minTimeSeekable : 0;
}
double MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable() const
{
if (!avPlayerItem(m_avfWrapper))
return 0;
......@@ -577,7 +601,7 @@ float MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable() const
if (!seekableRanges)
return 0;
float maxTimeSeekable = 0;
double maxTimeSeekable = 0;
CFIndex rangeCount = CFArrayGetCount(seekableRanges.get());
for (CFIndex i = 0; i < rangeCount; i++) {
CFDictionaryRef range = static_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(seekableRanges.get(), i));
......@@ -586,7 +610,7 @@ float MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable() const
if (!timeRangeIsValidAndNotEmpty(start, duration))
continue;
float endOfRange = narrowPrecisionToFloat(CMTimeGetSeconds(CMTimeAdd(start, duration)));
double endOfRange = CMTimeGetSeconds(CMTimeAdd(start, duration));
if (maxTimeSeekable < endOfRange)
maxTimeSeekable = endOfRange;
}
......
......@@ -74,10 +74,11 @@ private:
virtual void checkPlayability();
virtual void updateRate();
virtual float rate() const;
virtual void seekToTime(float time);
virtual void seekToTime(double time);
virtual unsigned totalBytes() const;
virtual PassRefPtr<TimeRanges> platformBufferedTimeRanges() const;
virtual float platformMaxTimeSeekable() const;
virtual double platformMinTimeSeekable() const;
virtual double platformMaxTimeSeekable() const;
virtual float platformDuration() const;
virtual float platformMaxTimeLoaded() const;
virtual void beginLoadingMetadata();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment