<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[160251] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/160251">160251</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2013-12-06 14:43:46 -0800 (Fri, 06 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>[MSE][Mac] Add a new MSE-compatible MediaPlayerPrivate implementation, MediaPlayerPrivateMediaSourceAVFObjC
https://bugs.webkit.org/show_bug.cgi?id=123378

Reviewed by Eric Carlson.

Add an AVFoundation implementation of MediaPlayerPrivate which creates and uses
MediaSourcePrivate and SourceBufferPrivate subclasses.

Add the new media engine to the list of installed engines:
* platform/MediaSample.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::installedMediaEngines):
* platform/graphics/MediaPlayer.h:

Add the new files to the project:
* WebCore.xcodeproj/project.pbxproj:

Drive by fix for ports who implement seekDouble():
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::seekWithTolerance):

Add new Video and AudioTrackPrivate types which handle their own enable state:
* platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp: Added
(WebCore::AudioTrackPrivateMediaSourceAVFObjC::AudioTrackPrivateMediaSourceAVFObjC):
(WebCore::AudioTrackPrivateMediaSourceAVFObjC::resetPropertiesFromTrack):
(WebCore::AudioTrackPrivateMediaSourceAVFObjC::setAssetTrack):
(WebCore::AudioTrackPrivateMediaSourceAVFObjC::assetTrack):
(WebCore::AudioTrackPrivateMediaSourceAVFObjC::setEnabled):
* platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h: Added
* platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.cpp: Added.
(WebCore::VideoTrackPrivateMediaSourceAVFObjC::VideoTrackPrivateMediaSourceAVFObjC):
(WebCore::VideoTrackPrivateMediaSourceAVFObjC::resetPropertiesFromTrack):
(WebCore::VideoTrackPrivateMediaSourceAVFObjC::setAssetTrack):
(WebCore::VideoTrackPrivateMediaSourceAVFObjC::assetTrack):
(WebCore::VideoTrackPrivateMediaSourceAVFObjC::setSelected):
* platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h: Added.

Add a new MediaPlayerPrivate which can handle MediaSource objects:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: Added.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: Added.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::create):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
(WebCore::mimeTypeCache):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cancelLoad):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::prepareToPlay):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformMedia):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformLayer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paused):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsScanning):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::naturalSize):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::hasVideo):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::hasAudio):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationDouble):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentTimeDouble):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startTimeDouble):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initialTime):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seeking):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setRateDouble):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::networkState):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::readyState):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekable):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::maxTimeSeekableDouble):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::minTimeSeekable):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::buffered):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::didLoadingProgress):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setSize):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::hasAvailableVideoFrame):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsAcceleratedRendering):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::movieLoadType):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::prepareForRendering):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::engineDescription):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::languageOfPrimaryAudioTrack):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::extraMemoryCost):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateDuration):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateStates):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer):

Add a new MediaSourcePrivate implementation:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: Added.
(WebCore::MediaSourcePrivateAVFObjC::player):
(WebCore::MediaSourcePrivateAVFObjC::activeSourceBuffers):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: Added.
(WebCore::MediaSourcePrivateAVFObjC::create):
(WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC):
(WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC):
(WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
(WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer):
(WebCore::MediaSourcePrivateAVFObjC::duration):
(WebCore::MediaSourcePrivateAVFObjC::setDuration):
(WebCore::MediaSourcePrivateAVFObjC::markEndOfStream):
(WebCore::MediaSourcePrivateAVFObjC::unmarkEndOfStream):
(WebCore::MediaSourcePrivateAVFObjC::readyState):
(WebCore::MediaSourcePrivateAVFObjC::setReadyState):
(WebCore::MediaSourcePrivateAVFObjC::sourceBufferPrivateDidChangeActiveState):
(WebCore::MediaSourcePrivateAVFObjCHasAudio):
(WebCore::MediaSourcePrivateAVFObjC::hasAudio):
(WebCore::MediaSourcePrivateAVFObjCHasVideo):
(WebCore::MediaSourcePrivateAVFObjC::hasVideo):
(WebCore::MediaSourcePrivateAVFObjC::seekToTime):

Add a new SourceBufferPrivate implementation:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: Added.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: Added.
(-[WebAVStreamDataParserListener initWithParser:parent:WebCore::]):
(-[WebAVStreamDataParserListener dealloc]):
(-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]):
(-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]):
(-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]):
(-[WebAVStreamDataParserListener streamDataParser:didReachEndOfTrackWithTrackID:mediaType:]):
(WebCore::MediaSampleAVFObjC::create):
(WebCore::MediaSampleAVFObjC::~MediaSampleAVFObjC):
(WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC):
(WebCore::MediaSampleAVFObjC::platformSample):
(WebCore::CMSampleBufferIsRandomAccess):
(WebCore::MediaSampleAVFObjC::flags):
(WebCore::MediaDescriptionAVFObjC::create):
(WebCore::MediaDescriptionAVFObjC::~MediaDescriptionAVFObjC):
(WebCore::MediaDescriptionAVFObjC::MediaDescriptionAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::create):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
(WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
(WebCore::callProcessCodedFrameForEachSample):
(WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
(WebCore::SourceBufferPrivateAVFObjC::didReachEndOfTrackWithTrackID):
(WebCore::SourceBufferPrivateAVFObjC::setClient):
(WebCore::SourceBufferPrivateAVFObjC::append):
(WebCore::SourceBufferPrivateAVFObjC::abort):
(WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource):
(WebCore::SourceBufferPrivateAVFObjC::readyState):
(WebCore::SourceBufferPrivateAVFObjC::setReadyState):
(WebCore::SourceBufferPrivateAVFObjC::evictCodedFrames):
(WebCore::SourceBufferPrivateAVFObjC::isFull):
(WebCore::SourceBufferPrivateAVFObjC::hasVideo):
(WebCore::SourceBufferPrivateAVFObjC::hasAudio):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::createNonDisplayingCopy):
(WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples):
(WebCore::SourceBufferPrivateAVFObjC::setActive):
(WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime):
(WebCore::SourceBufferPrivateAVFObjC::seekToTime):
* platform/mac/PlatformClockCM.h:

Add a SOFT_LINK_CLASS_OPTIONAL macro:
* platform/mac/SoftLinking.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceSourceBuffercpp">trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformMediaSampleh">trunk/Source/WebCore/platform/MediaSample.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayercpp">trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerh">trunk/Source/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh">trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacPlatformClockCMh">trunk/Source/WebCore/platform/mac/PlatformClockCM.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacSoftLinkingh">trunk/Source/WebCore/platform/mac/SoftLinking.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcAudioTrackPrivateMediaSourceAVFObjCcpp">trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcAudioTrackPrivateMediaSourceAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSourcePrivateAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSourcePrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcVideoTrackPrivateMediaSourceAVFObjCcpp">trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcVideoTrackPrivateMediaSourceAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160250 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-06 22:31:39 UTC (rev 160250)
+++ trunk/Source/WebCore/ChangeLog        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -1,3 +1,176 @@
</span><ins>+2013-11-15  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        [MSE][Mac] Add a new MSE-compatible MediaPlayerPrivate implementation, MediaPlayerPrivateMediaSourceAVFObjC
+        https://bugs.webkit.org/show_bug.cgi?id=123378
+
+        Reviewed by Eric Carlson.
+
+        Add an AVFoundation implementation of MediaPlayerPrivate which creates and uses
+        MediaSourcePrivate and SourceBufferPrivate subclasses.
+
+        Add the new media engine to the list of installed engines:
+        * platform/MediaSample.h:
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::installedMediaEngines):
+        * platform/graphics/MediaPlayer.h:
+
+        Add the new files to the project:
+        * WebCore.xcodeproj/project.pbxproj:
+
+        Drive by fix for ports who implement seekDouble():
+        * platform/graphics/MediaPlayerPrivate.h:
+        (WebCore::MediaPlayerPrivateInterface::seekWithTolerance):
+
+        Add new Video and AudioTrackPrivate types which handle their own enable state:
+        * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp: Added
+        (WebCore::AudioTrackPrivateMediaSourceAVFObjC::AudioTrackPrivateMediaSourceAVFObjC):
+        (WebCore::AudioTrackPrivateMediaSourceAVFObjC::resetPropertiesFromTrack):
+        (WebCore::AudioTrackPrivateMediaSourceAVFObjC::setAssetTrack):
+        (WebCore::AudioTrackPrivateMediaSourceAVFObjC::assetTrack):
+        (WebCore::AudioTrackPrivateMediaSourceAVFObjC::setEnabled):
+        * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h: Added
+        * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.cpp: Added.
+        (WebCore::VideoTrackPrivateMediaSourceAVFObjC::VideoTrackPrivateMediaSourceAVFObjC):
+        (WebCore::VideoTrackPrivateMediaSourceAVFObjC::resetPropertiesFromTrack):
+        (WebCore::VideoTrackPrivateMediaSourceAVFObjC::setAssetTrack):
+        (WebCore::VideoTrackPrivateMediaSourceAVFObjC::assetTrack):
+        (WebCore::VideoTrackPrivateMediaSourceAVFObjC::setSelected):
+        * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h: Added.
+
+        Add a new MediaPlayerPrivate which can handle MediaSource objects:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: Added.
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: Added.
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::create):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
+        (WebCore::mimeTypeCache):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cancelLoad):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::prepareToPlay):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformMedia):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformLayer):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paused):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsScanning):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::naturalSize):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::hasVideo):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::hasAudio):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationDouble):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentTimeDouble):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startTimeDouble):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initialTime):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seeking):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setRateDouble):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::networkState):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::readyState):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekable):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::maxTimeSeekableDouble):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::minTimeSeekable):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::buffered):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::didLoadingProgress):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setSize):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::hasAvailableVideoFrame):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsAcceleratedRendering):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::movieLoadType):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::prepareForRendering):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::engineDescription):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::languageOfPrimaryAudioTrack):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::extraMemoryCost):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateDuration):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateStates):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer):
+
+        Add a new MediaSourcePrivate implementation:
+        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: Added.
+        (WebCore::MediaSourcePrivateAVFObjC::player):
+        (WebCore::MediaSourcePrivateAVFObjC::activeSourceBuffers):
+        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: Added.
+        (WebCore::MediaSourcePrivateAVFObjC::create):
+        (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC):
+        (WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC):
+        (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
+        (WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer):
+        (WebCore::MediaSourcePrivateAVFObjC::duration):
+        (WebCore::MediaSourcePrivateAVFObjC::setDuration):
+        (WebCore::MediaSourcePrivateAVFObjC::markEndOfStream):
+        (WebCore::MediaSourcePrivateAVFObjC::unmarkEndOfStream):
+        (WebCore::MediaSourcePrivateAVFObjC::readyState):
+        (WebCore::MediaSourcePrivateAVFObjC::setReadyState):
+        (WebCore::MediaSourcePrivateAVFObjC::sourceBufferPrivateDidChangeActiveState):
+        (WebCore::MediaSourcePrivateAVFObjCHasAudio):
+        (WebCore::MediaSourcePrivateAVFObjC::hasAudio):
+        (WebCore::MediaSourcePrivateAVFObjCHasVideo):
+        (WebCore::MediaSourcePrivateAVFObjC::hasVideo):
+        (WebCore::MediaSourcePrivateAVFObjC::seekToTime):
+
+        Add a new SourceBufferPrivate implementation:
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: Added.
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: Added.
+        (-[WebAVStreamDataParserListener initWithParser:parent:WebCore::]):
+        (-[WebAVStreamDataParserListener dealloc]):
+        (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]):
+        (-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]):
+        (-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]):
+        (-[WebAVStreamDataParserListener streamDataParser:didReachEndOfTrackWithTrackID:mediaType:]):
+        (WebCore::MediaSampleAVFObjC::create):
+        (WebCore::MediaSampleAVFObjC::~MediaSampleAVFObjC):
+        (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC):
+        (WebCore::MediaSampleAVFObjC::platformSample):
+        (WebCore::CMSampleBufferIsRandomAccess):
+        (WebCore::MediaSampleAVFObjC::flags):
+        (WebCore::MediaDescriptionAVFObjC::create):
+        (WebCore::MediaDescriptionAVFObjC::~MediaDescriptionAVFObjC):
+        (WebCore::MediaDescriptionAVFObjC::MediaDescriptionAVFObjC):
+        (WebCore::SourceBufferPrivateAVFObjC::create):
+        (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
+        (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
+        (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
+        (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
+        (WebCore::callProcessCodedFrameForEachSample):
+        (WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID):
+        (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
+        (WebCore::SourceBufferPrivateAVFObjC::didReachEndOfTrackWithTrackID):
+        (WebCore::SourceBufferPrivateAVFObjC::setClient):
+        (WebCore::SourceBufferPrivateAVFObjC::append):
+        (WebCore::SourceBufferPrivateAVFObjC::abort):
+        (WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource):
+        (WebCore::SourceBufferPrivateAVFObjC::readyState):
+        (WebCore::SourceBufferPrivateAVFObjC::setReadyState):
+        (WebCore::SourceBufferPrivateAVFObjC::evictCodedFrames):
+        (WebCore::SourceBufferPrivateAVFObjC::isFull):
+        (WebCore::SourceBufferPrivateAVFObjC::hasVideo):
+        (WebCore::SourceBufferPrivateAVFObjC::hasAudio):
+        (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
+        (WebCore::createNonDisplayingCopy):
+        (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
+        (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
+        (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples):
+        (WebCore::SourceBufferPrivateAVFObjC::setActive):
+        (WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime):
+        (WebCore::SourceBufferPrivateAVFObjC::seekToTime):
+        * platform/mac/PlatformClockCM.h:
+
+        Add a SOFT_LINK_CLASS_OPTIONAL macro:
+        * platform/mac/SoftLinking.h:
+
</ins><span class="cx"> 2013-12-06  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove some duplicate checks from SerializedScriptValue
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (160250 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2013-12-06 22:31:39 UTC (rev 160250)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -993,12 +993,12 @@
</span><span class="cx"> 
</span><span class="cx"> bool SourceBuffer::sourceBufferPrivateHasAudio(const SourceBufferPrivate*) const
</span><span class="cx"> {
</span><del>-    return m_audioTracks-&gt;length();
</del><ins>+    return m_audioTracks &amp;&amp; m_audioTracks-&gt;length();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool SourceBuffer::sourceBufferPrivateHasVideo(const SourceBufferPrivate*) const
</span><span class="cx"> {
</span><del>-    return m_videoTracks-&gt;length();
</del><ins>+    return m_videoTracks &amp;&amp; m_videoTracks-&gt;length();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SourceBuffer::videoTrackSelectedChanged(VideoTrack* track)
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (160250 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-06 22:31:39 UTC (rev 160250)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -5344,6 +5344,8 @@
</span><span class="cx">                 CD4AC52A1496AE9A0087C4EF /* Composite.wav in Copy Audio Resources */ = {isa = PBXBuildFile; fileRef = CD4AC5281496AE2F0087C4EF /* Composite.wav */; };
</span><span class="cx">                 CD5393D3175E018600C07123 /* JSMemoryInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5393D1175E018600C07123 /* JSMemoryInfo.cpp */; };
</span><span class="cx">                 CD5393D4175E018600C07123 /* JSMemoryInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5393D2175E018600C07123 /* JSMemoryInfo.h */; };
</span><ins>+                CD54A762180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD54A760180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.cpp */; };
+                CD54A763180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CD54A761180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h */; };
</ins><span class="cx">                 CD54DE4717468B6F005E5B36 /* AudioSessionManagerMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD54DE4517468B6F005E5B36 /* AudioSessionManagerMac.cpp */; };
</span><span class="cx">                 CD54DE4B17469C6D005E5B36 /* AudioSessionMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD54DE4917469C6D005E5B36 /* AudioSessionMac.cpp */; };
</span><span class="cx">                 CD61FE671794AADB004101EB /* MediaSourceRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1A942E115B5CE2200D525D1 /* MediaSourceRegistry.cpp */; };
</span><span class="lines">@@ -5359,6 +5361,8 @@
</span><span class="cx">                 CD82030D1395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD8203091395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm */; };
</span><span class="cx">                 CD8203101395ACE700F956C6 /* WebWindowAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CD8203111395ACE700F956C6 /* WebWindowAnimation.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */; };
</span><ins>+                CD8B5A42180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD8B5A40180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.cpp */; };
+                CD8B5A43180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B5A41180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h */; };
</ins><span class="cx">                 CD8B5A46180DFF4E008B8E65 /* VideoTrackMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B5A45180DFF4E008B8E65 /* VideoTrackMediaSource.h */; };
</span><span class="cx">                 CD8B5A49180E138B008B8E65 /* TextTrackMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B5A48180E138B008B8E65 /* TextTrackMediaSource.h */; };
</span><span class="cx">                 CD8B5A4C180E17C0008B8E65 /* AudioTrackMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B5A4B180E17C0008B8E65 /* AudioTrackMediaSource.h */; };
</span><span class="lines">@@ -5401,6 +5405,12 @@
</span><span class="cx">                 CDC69DD71632026C007C38DF /* WebCoreFullScreenWarningView.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC69DD51632026C007C38DF /* WebCoreFullScreenWarningView.mm */; };
</span><span class="cx">                 CDC69DDA16371FD4007C38DF /* WebCoreFullScreenPlaceholderView.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC69DD816371FD3007C38DF /* WebCoreFullScreenPlaceholderView.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CDC69DDB16371FD4007C38DF /* WebCoreFullScreenPlaceholderView.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC69DD916371FD3007C38DF /* WebCoreFullScreenPlaceholderView.mm */; };
</span><ins>+                CDC8B5A2180463470016E685 /* MediaPlayerPrivateMediaSourceAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC8B5A0180463470016E685 /* MediaPlayerPrivateMediaSourceAVFObjC.mm */; };
+                CDC8B5A3180463470016E685 /* MediaPlayerPrivateMediaSourceAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC8B5A1180463470016E685 /* MediaPlayerPrivateMediaSourceAVFObjC.h */; };
+                CDC8B5A6180474F70016E685 /* MediaSourcePrivateAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC8B5A4180474F70016E685 /* MediaSourcePrivateAVFObjC.mm */; };
+                CDC8B5A7180474F70016E685 /* MediaSourcePrivateAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC8B5A5180474F70016E685 /* MediaSourcePrivateAVFObjC.h */; };
+                CDC8B5AA18047FF10016E685 /* SourceBufferPrivateAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC8B5A818047FF10016E685 /* SourceBufferPrivateAVFObjC.mm */; };
+                CDC8B5AB18047FF10016E685 /* SourceBufferPrivateAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC8B5A918047FF10016E685 /* SourceBufferPrivateAVFObjC.h */; };
</ins><span class="cx">                 CDC8B5AD1804AE5D0016E685 /* SourceBufferPrivateClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC8B5AC1804AE5D0016E685 /* SourceBufferPrivateClient.h */; };
</span><span class="cx">                 CDD525D7145B6DD0008D204D /* JSHTMLMediaElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDF65CCC145B6AFE00C4C7AA /* JSHTMLMediaElementCustom.cpp */; };
</span><span class="cx">                 CDD7089618359F6F002B3DC6 /* SampleMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDD7089418359F6E002B3DC6 /* SampleMap.cpp */; };
</span><span class="lines">@@ -12429,6 +12439,8 @@
</span><span class="cx">                 CD5393D1175E018600C07123 /* JSMemoryInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMemoryInfo.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD5393D2175E018600C07123 /* JSMemoryInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMemoryInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD54A75E180F535000B076C9 /* MediaSourcePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSourcePrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                CD54A760180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AudioTrackPrivateMediaSourceAVFObjC.cpp; path = objc/AudioTrackPrivateMediaSourceAVFObjC.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CD54A761180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioTrackPrivateMediaSourceAVFObjC.h; path = objc/AudioTrackPrivateMediaSourceAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CD54DE4517468B6F005E5B36 /* AudioSessionManagerMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSessionManagerMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD54DE4917469C6D005E5B36 /* AudioSessionMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSessionMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD641EB11818F5ED00EE4C41 /* MediaSourcePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSourcePrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12444,6 +12456,8 @@
</span><span class="cx">                 CD8203091395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenHUDWindowController.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebWindowAnimation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebWindowAnimation.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                CD8B5A40180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VideoTrackPrivateMediaSourceAVFObjC.cpp; path = objc/VideoTrackPrivateMediaSourceAVFObjC.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CD8B5A41180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VideoTrackPrivateMediaSourceAVFObjC.h; path = objc/VideoTrackPrivateMediaSourceAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CD8B5A44180DD8D6008B8E65 /* VideoTrackMediaSource.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = VideoTrackMediaSource.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD8B5A45180DFF4E008B8E65 /* VideoTrackMediaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoTrackMediaSource.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD8B5A47180E1361008B8E65 /* TextTrackMediaSource.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = TextTrackMediaSource.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12516,6 +12530,12 @@
</span><span class="cx">                 CDC69DD51632026C007C38DF /* WebCoreFullScreenWarningView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreFullScreenWarningView.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDC69DD816371FD3007C38DF /* WebCoreFullScreenPlaceholderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreFullScreenPlaceholderView.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDC69DD916371FD3007C38DF /* WebCoreFullScreenPlaceholderView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreFullScreenPlaceholderView.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                CDC8B5A0180463470016E685 /* MediaPlayerPrivateMediaSourceAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MediaPlayerPrivateMediaSourceAVFObjC.mm; path = objc/MediaPlayerPrivateMediaSourceAVFObjC.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDC8B5A1180463470016E685 /* MediaPlayerPrivateMediaSourceAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MediaPlayerPrivateMediaSourceAVFObjC.h; path = objc/MediaPlayerPrivateMediaSourceAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDC8B5A4180474F70016E685 /* MediaSourcePrivateAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MediaSourcePrivateAVFObjC.mm; path = objc/MediaSourcePrivateAVFObjC.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDC8B5A5180474F70016E685 /* MediaSourcePrivateAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MediaSourcePrivateAVFObjC.h; path = objc/MediaSourcePrivateAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDC8B5A818047FF10016E685 /* SourceBufferPrivateAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SourceBufferPrivateAVFObjC.mm; path = objc/SourceBufferPrivateAVFObjC.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDC8B5A918047FF10016E685 /* SourceBufferPrivateAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SourceBufferPrivateAVFObjC.h; path = objc/SourceBufferPrivateAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CDC8B5AC1804AE5D0016E685 /* SourceBufferPrivateClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBufferPrivateClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDCE5CD014633BC900D47CCA /* EventTargetFactory.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EventTargetFactory.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDD1E525167BA56400CE820B /* TextTrackRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackRepresentation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -20439,20 +20459,30 @@
</span><span class="cx">                 DF9AFD6F13FC31B00015FEB7 /* objc */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                CDE3A85617F6020400C5BE20 /* AudioTrackPrivateAVFObjC.h */,
+                                CDE3A85517F6020400C5BE20 /* AudioTrackPrivateAVFObjC.mm */,
+                                CD54A760180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.cpp */,
+                                CD54A761180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h */,
+                                CD336F6017F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.h */,
</ins><span class="cx">                                 CD336F5F17F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.mm */,
</span><del>-                                CD336F6017F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.h */,
-                                CDE3A85517F6020400C5BE20 /* AudioTrackPrivateAVFObjC.mm */,
-                                CDE3A85617F6020400C5BE20 /* AudioTrackPrivateAVFObjC.h */,
</del><span class="cx">                                 07AA6B69166D019500D45671 /* InbandTextTrackPrivateAVFObjC.h */,
</span><span class="cx">                                 07AA6B6A166D019500D45671 /* InbandTextTrackPrivateAVFObjC.mm */,
</span><span class="cx">                                 07367DDD172CA67F00D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.h */,
</span><span class="cx">                                 07367DDE172CA67F00D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.mm */,
</span><span class="cx">                                 DF9AFD7013FC31D80015FEB7 /* MediaPlayerPrivateAVFoundationObjC.h */,
</span><span class="cx">                                 DF9AFD7113FC31D80015FEB7 /* MediaPlayerPrivateAVFoundationObjC.mm */,
</span><ins>+                                CDC8B5A1180463470016E685 /* MediaPlayerPrivateMediaSourceAVFObjC.h */,
+                                CDC8B5A0180463470016E685 /* MediaPlayerPrivateMediaSourceAVFObjC.mm */,
+                                CDC8B5A5180474F70016E685 /* MediaSourcePrivateAVFObjC.h */,
+                                CDC8B5A4180474F70016E685 /* MediaSourcePrivateAVFObjC.mm */,
+                                CDC8B5A918047FF10016E685 /* SourceBufferPrivateAVFObjC.h */,
+                                CDC8B5A818047FF10016E685 /* SourceBufferPrivateAVFObjC.mm */,
+                                CD336F6517FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.cpp */,
+                                CD336F6617FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.h */,
+                                CD8B5A40180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.cpp */,
+                                CD8B5A41180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h */,
</ins><span class="cx">                                 CD7E05201651A84100C1201F /* WebCoreAVFResourceLoader.h */,
</span><span class="cx">                                 CD7E05211651A84100C1201F /* WebCoreAVFResourceLoader.mm */,
</span><del>-                                CD336F6517FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.cpp */,
-                                CD336F6617FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.h */,
</del><span class="cx">                         );
</span><span class="cx">                         name = objc;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -22695,6 +22725,7 @@
</span><span class="cx">                                 85BCBC130ABBA87D00381160 /* DOMHTMLDocument.h in Headers */,
</span><span class="cx">                                 85E711A60AC5D5350053270F /* DOMHTMLDocumentInternal.h in Headers */,
</span><span class="cx">                                 85DF2EED0AA387CB00AD64C5 /* DOMHTMLElement.h in Headers */,
</span><ins>+                                CDC8B5A7180474F70016E685 /* MediaSourcePrivateAVFObjC.h in Headers */,
</ins><span class="cx">                                 85E711A70AC5D5350053270F /* DOMHTMLElementInternal.h in Headers */,
</span><span class="cx">                                 8540756A0AD6CBF900620C57 /* DOMHTMLEmbedElement.h in Headers */,
</span><span class="cx">                                 855247D00AD850B80012093B /* DOMHTMLEmbedElementInternal.h in Headers */,
</span><span class="lines">@@ -22963,6 +22994,7 @@
</span><span class="cx">                                 85031B420A44EFC700F992E0 /* Event.h in Headers */,
</span><span class="cx">                                 4138D3351244054800323D33 /* EventContext.h in Headers */,
</span><span class="cx">                                 CDAB6D2917C7DE6C00C60B34 /* MediaControlsHost.h in Headers */,
</span><ins>+                                CDC8B5A3180463470016E685 /* MediaPlayerPrivateMediaSourceAVFObjC.h in Headers */,
</ins><span class="cx">                                 418A06D0133C04D500CD379C /* EventDispatcher.h in Headers */,
</span><span class="cx">                                 BC60D90C0D2A17CE00B9918F /* EventException.h in Headers */,
</span><span class="cx">                                 97665013144FAA4200F6BB51 /* EventFactory.h in Headers */,
</span><span class="lines">@@ -23944,6 +23976,7 @@
</span><span class="cx">                                 078E091517D14D1C00420AA1 /* MediaStream.h in Headers */,
</span><span class="cx">                                 0C45342810CDBBFA00869157 /* JSWebGLUniformLocation.h in Headers */,
</span><span class="cx">                                 77EF62F412F9DB7400C77BD2 /* JSWebGLVertexArrayObjectOES.h in Headers */,
</span><ins>+                                CDC8B5AB18047FF10016E685 /* SourceBufferPrivateAVFObjC.h in Headers */,
</ins><span class="cx">                                 31C0FF3E0E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.h in Headers */,
</span><span class="cx">                                 A2E8AE3816A49840006BB3AA /* JSWebKitCSSFilterRule.h in Headers */,
</span><span class="cx">                                 310603751432819C00ABF4BA /* JSWebKitCSSFilterValue.h in Headers */,
</span><span class="lines">@@ -24611,6 +24644,7 @@
</span><span class="cx">                                 E4AFD00C0DAF335400F5F55C /* SMILTime.h in Headers */,
</span><span class="cx">                                 E4AFD00E0DAF335500F5F55C /* SMILTimeContainer.h in Headers */,
</span><span class="cx">                                 51ABAE1B103C18FF008C5260 /* SocketStreamError.h in Headers */,
</span><ins>+                                CD54A763180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h in Headers */,
</ins><span class="cx">                                 510D4A34103165EE0049EA54 /* SocketStreamErrorBase.h in Headers */,
</span><span class="cx">                                 51ABAE1E103C1913008C5260 /* SocketStreamHandle.h in Headers */,
</span><span class="cx">                                 51D719BE181106E00016DC51 /* IDBCallbacks.h in Headers */,
</span><span class="lines">@@ -24667,6 +24701,7 @@
</span><span class="cx">                                 1A2E6E5A0CC55213004A2062 /* SQLValue.h in Headers */,
</span><span class="cx">                                 93F1996308245E59001E9ABC /* SSLKeyGenerator.h in Headers */,
</span><span class="cx">                                 BC7FA62D0D1F0EFF00DB22A9 /* StaticNodeList.h in Headers */,
</span><ins>+                                CD8B5A43180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h in Headers */,
</ins><span class="cx">                                 A5AFB350115151A700B045CB /* StepRange.h in Headers */,
</span><span class="cx">                                 1AC2D845171734A100652FC0 /* Storage.h in Headers */,
</span><span class="cx">                                 51BE37E00DAEE00E001085FC /* StorageArea.h in Headers */,
</span><span class="lines">@@ -26246,6 +26281,7 @@
</span><span class="cx">                                 A7CFB3D10B7ED10A0070C32D /* DragImage.cpp in Sources */,
</span><span class="cx">                                 A7CFB3D50B7ED1180070C32D /* DragImageMac.mm in Sources */,
</span><span class="cx">                                 498770DB1242C535002226BA /* DrawingBuffer.cpp in Sources */,
</span><ins>+                                CDC8B5A6180474F70016E685 /* MediaSourcePrivateAVFObjC.mm in Sources */,
</ins><span class="cx">                                 498771531243F9FA002226BA /* DrawingBufferMac.mm in Sources */,
</span><span class="cx">                                 078E091217D14CEE00420AA1 /* UserMediaController.cpp in Sources */,
</span><span class="cx">                                 FD6ED2C7136B8E66003CF072 /* DynamicsCompressor.cpp in Sources */,
</span><span class="lines">@@ -26281,6 +26317,7 @@
</span><span class="cx">                                 07969DB917D14151007FF842 /* JSRTCPeerConnection.cpp in Sources */,
</span><span class="cx">                                 E0FEF372B27C53EAC1C1FBEE /* EventSource.cpp in Sources */,
</span><span class="cx">                                 E12EDBEA0B308E0B002704B6 /* EventTarget.cpp in Sources */,
</span><ins>+                                CD8B5A42180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.cpp in Sources */,
</ins><span class="cx">                                 BC60D8F20D2A11E000B9918F /* ExceptionBase.cpp in Sources */,
</span><span class="cx">                                 973DC63F145A9409002842C2 /* ExceptionCodeDescription.cpp in Sources */,
</span><span class="cx">                                 A7CACDB113CE875C00BBBE3F /* ExceptionCodePlaceholder.cpp in Sources */,
</span><span class="lines">@@ -26379,6 +26416,7 @@
</span><span class="cx">                                 F50664F7157F52DC00AC226F /* FormController.cpp in Sources */,
</span><span class="cx">                                 514C766F0CE923A1007EF3CD /* FormData.cpp in Sources */,
</span><span class="cx">                                 085B92BA0EFDE73D00E6123C /* FormDataBuilder.cpp in Sources */,
</span><ins>+                                CDC8B5AA18047FF10016E685 /* SourceBufferPrivateAVFObjC.mm in Sources */,
</ins><span class="cx">                                 A8136D390973A8E700D74463 /* FormDataList.cpp in Sources */,
</span><span class="cx">                                 7EE6846612D26E3800E79415 /* FormDataStreamCFNet.cpp in Sources */,
</span><span class="cx">                                 514C764F0CE9234E007EF3CD /* FormDataStreamMac.mm in Sources */,
</span><span class="lines">@@ -26799,6 +26837,7 @@
</span><span class="cx">                                 65DF31F909D1CC60000BE325 /* JSElement.cpp in Sources */,
</span><span class="cx">                                 BC2ED5550C6B9BD300920BFF /* JSElementCustom.cpp in Sources */,
</span><span class="cx">                                 65DF322F09D1DDBC000BE325 /* JSEntity.cpp in Sources */,
</span><ins>+                                CD54A762180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.cpp in Sources */,
</ins><span class="cx">                                 93F9B7740BA5FDDC00854064 /* JSEntityReference.cpp in Sources */,
</span><span class="cx">                                 2ECF7ADC10162B3800427DE7 /* JSErrorEvent.cpp in Sources */,
</span><span class="cx">                                 F3D461481161D53200CA0D09 /* JSErrorHandler.cpp in Sources */,
</span><span class="lines">@@ -28088,6 +28127,7 @@
</span><span class="cx">                                 B2227A560D00BF220071B782 /* SVGParserUtilities.cpp in Sources */,
</span><span class="cx">                                 84C6784C1214814700A92902 /* SVGPathBlender.cpp in Sources */,
</span><span class="cx">                                 8476C9EA11DF6A2900555B02 /* SVGPathBuilder.cpp in Sources */,
</span><ins>+                                CDC8B5A2180463470016E685 /* MediaPlayerPrivateMediaSourceAVFObjC.mm in Sources */,
</ins><span class="cx">                                 8419D2A8120D92D000141F8F /* SVGPathByteStreamBuilder.cpp in Sources */,
</span><span class="cx">                                 8419D2AC120D92FC00141F8F /* SVGPathByteStreamSource.cpp in Sources */,
</span><span class="cx">                                 B2227A580D00BF220071B782 /* SVGPathElement.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMediaSampleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MediaSample.h (160250 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MediaSample.h        2013-12-06 22:31:39 UTC (rev 160250)
+++ trunk/Source/WebCore/platform/MediaSample.h        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -33,14 +33,17 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class MockSampleBox;
</span><ins>+typedef struct opaqueCMSampleBuffer *CMSampleBufferRef;
</ins><span class="cx"> 
</span><span class="cx"> struct PlatformSample {
</span><span class="cx">     enum {
</span><span class="cx">         None,
</span><span class="cx">         MockSampleBoxType,
</span><ins>+        CMSampleBufferType,
</ins><span class="cx">     } type;
</span><span class="cx">     union {
</span><span class="cx">         MockSampleBox* mockSampleBox;
</span><ins>+        CMSampleBufferRef cmSampleBuffer;
</ins><span class="cx">     } sample;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -56,6 +59,7 @@
</span><span class="cx">     enum SampleFlags {
</span><span class="cx">         None = 0,
</span><span class="cx">         IsSync = 1 &lt;&lt; 0,
</span><ins>+        NonDisplaying = 1 &lt;&lt; 1,
</ins><span class="cx">     };
</span><span class="cx">     virtual SampleFlags flags() const = 0;
</span><span class="cx">     virtual PlatformSample platformSample() = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (160250 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2013-12-06 22:31:39 UTC (rev 160250)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -57,7 +57,10 @@
</span><span class="cx"> #include &quot;MediaPlayerPrivateQTKit.h&quot;
</span><span class="cx"> #if USE(AVFOUNDATION)
</span><span class="cx"> #include &quot;MediaPlayerPrivateAVFoundationObjC.h&quot;
</span><ins>+#if ENABLE(MEDIA_SOURCE)
+#include &quot;MediaPlayerPrivateMediaSourceAVFObjC.h&quot;
</ins><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> #elif OS(WINCE)
</span><span class="cx"> #include &quot;MediaPlayerPrivateWinCE.h&quot;
</span><span class="cx"> #define PlatformMediaEngineClassName MediaPlayerPrivate
</span><span class="lines">@@ -213,6 +216,9 @@
</span><span class="cx">         if (Settings::isAVFoundationEnabled()) {
</span><span class="cx"> #if PLATFORM(MAC) || PLATFORM(IOS)
</span><span class="cx">             MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(addMediaEngine);
</span><ins>+#if ENABLE(MEDIA_SOURCE)
+            MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine(addMediaEngine);
+#endif
</ins><span class="cx"> #elif PLATFORM(WIN)
</span><span class="cx">             MediaPlayerPrivateAVFoundationCF::registerMediaEngine(addMediaEngine);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (160250 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2013-12-06 22:31:39 UTC (rev 160250)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -43,8 +43,9 @@
</span><span class="cx"> #include &lt;runtime/Uint8Array.h&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><ins>+#include &lt;wtf/MediaTime.h&gt;
+#include &lt;wtf/Noncopyable.h&gt;
</ins><span class="cx"> #include &lt;wtf/OwnPtr.h&gt;
</span><del>-#include &lt;wtf/Noncopyable.h&gt;
</del><span class="cx"> #include &lt;wtf/PassOwnPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringHash.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -56,6 +57,7 @@
</span><span class="cx"> #include &quot;PlatformTextTrackMenu.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+OBJC_CLASS AVAsset;
</ins><span class="cx"> OBJC_CLASS AVPlayer;
</span><span class="cx"> OBJC_CLASS QTMovie;
</span><span class="cx"> 
</span><span class="lines">@@ -86,7 +88,8 @@
</span><span class="cx">         ChromiumMediaPlayerType,
</span><span class="cx">         QtMediaPlayerType,
</span><span class="cx">         AVFoundationMediaPlayerType,
</span><del>-        AVFoundationCFMediaPlayerType
</del><ins>+        AVFoundationCFMediaPlayerType,
+        AVFoundationAssetType,
</ins><span class="cx">     } type;
</span><span class="cx"> 
</span><span class="cx">     union {
</span><span class="lines">@@ -97,6 +100,7 @@
</span><span class="cx">         MediaPlayerPrivateInterface* qtMediaPlayer;
</span><span class="cx">         AVPlayer* avfMediaPlayer;
</span><span class="cx">         AVCFPlayer* avcfMediaPlayer;
</span><ins>+        AVAsset* avfAsset;
</ins><span class="cx">     } media;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (160250 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2013-12-06 22:31:39 UTC (rev 160250)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void seek(float) { }
</span><span class="cx">     virtual void seekDouble(double time) { seek(time); }
</span><del>-    virtual void seekWithTolerance(double time, double, double) { seek(time); }
</del><ins>+    virtual void seekWithTolerance(double time, double, double) { seekDouble(time); }
</ins><span class="cx"> 
</span><span class="cx">     virtual bool seeking() const = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcAudioTrackPrivateMediaSourceAVFObjCcppfromrev160250trunkSourceWebCoreplatformMediaSampleh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp (from rev 160250, trunk/Source/WebCore/platform/MediaSample.h) (0 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;AudioTrackPrivateMediaSourceAVFObjC.h&quot;
+
+#if ENABLE(MEDIA_SOURCE) &amp;&amp; ENABLE(VIDEO_TRACK)
+
+#include &quot;AVTrackPrivateAVFObjCImpl.h&quot;
+#include &quot;SourceBufferPrivateAVFObjC.h&quot;
+
+namespace WebCore {
+
+AudioTrackPrivateMediaSourceAVFObjC::AudioTrackPrivateMediaSourceAVFObjC(AVAssetTrack* track, SourceBufferPrivateAVFObjC* parent)
+    : m_impl(std::make_unique&lt;AVTrackPrivateAVFObjCImpl&gt;(track))
+    , m_parent(parent)
+    , m_trackID(-1)
+    , m_enabled(false)
+{
+    resetPropertiesFromTrack();
+}
+
+void AudioTrackPrivateMediaSourceAVFObjC::resetPropertiesFromTrack()
+{
+    m_trackID = m_impl-&gt;trackID();
+
+    setKind(m_impl-&gt;audioKind());
+    setId(m_impl-&gt;id());
+    setLabel(m_impl-&gt;label());
+    setLanguage(m_impl-&gt;language());
+}
+
+void AudioTrackPrivateMediaSourceAVFObjC::setAssetTrack(AVAssetTrack *track)
+{
+    m_impl = std::make_unique&lt;AVTrackPrivateAVFObjCImpl&gt;(track);
+    resetPropertiesFromTrack();
+}
+
+AVAssetTrack* AudioTrackPrivateMediaSourceAVFObjC::assetTrack()
+{
+    return m_impl-&gt;assetTrack();
+}
+
+bool AudioTrackPrivateMediaSourceAVFObjC::enabled() const
+{
+    return m_enabled;
+}
+
+void AudioTrackPrivateMediaSourceAVFObjC::setEnabled(bool enabled)
+{
+    if (m_enabled == enabled)
+        return;
+
+    m_enabled = enabled;
+    m_parent-&gt;trackDidChangeEnabled(this);
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcAudioTrackPrivateMediaSourceAVFObjChfromrev160250trunkSourceWebCoreplatformMediaSampleh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h (from rev 160250, trunk/Source/WebCore/platform/MediaSample.h) (0 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef AudioTrackPrivateMediaSourceAVFObjC_h
+#define AudioTrackPrivateMediaSourceAVFObjC_h
+
+#include &quot;AudioTrackPrivateAVF.h&quot;
+
+#if ENABLE(MEDIA_SOURCE) &amp;&amp; ENABLE(VIDEO_TRACK)
+
+OBJC_CLASS AVAssetTrack;
+OBJC_CLASS AVPlayerItemTrack;
+
+namespace WebCore {
+
+class AVTrackPrivateAVFObjCImpl;
+class SourceBufferPrivateAVFObjC;
+
+class AudioTrackPrivateMediaSourceAVFObjC FINAL : public AudioTrackPrivateAVF {
+    WTF_MAKE_NONCOPYABLE(AudioTrackPrivateMediaSourceAVFObjC)
+public:
+    static RefPtr&lt;AudioTrackPrivateMediaSourceAVFObjC&gt; create(AVAssetTrack* track, SourceBufferPrivateAVFObjC* parent)
+    {
+        return adoptRef(new AudioTrackPrivateMediaSourceAVFObjC(track, parent));
+    }
+
+    virtual bool enabled() const OVERRIDE;
+    virtual void setEnabled(bool) OVERRIDE;
+
+    void setAssetTrack(AVAssetTrack*);
+    AVAssetTrack* assetTrack();
+
+    int trackID() { return m_trackID; }
+
+private:
+    explicit AudioTrackPrivateMediaSourceAVFObjC(AVAssetTrack*, SourceBufferPrivateAVFObjC* parent);
+    
+    void resetPropertiesFromTrack();
+
+    std::unique_ptr&lt;AVTrackPrivateAVFObjCImpl&gt; m_impl;
+    SourceBufferPrivateAVFObjC* m_parent;
+    int m_trackID;
+    bool m_enabled;
+};
+
+}
+
+#endif // ENABLE(MEDIA_SOURCE) &amp;&amp; ENABLE(VIDEO_TRACK)
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h (0 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -0,0 +1,162 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MediaPlayerPrivateMediaSourceAVFObjC_h
+#define MediaPlayerPrivateMediaSourceAVFObjC_h
+
+#if ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
+
+#include &quot;MediaPlayerPrivate.h&quot;
+#include &quot;SourceBufferPrivateClient.h&quot;
+#include &lt;wtf/MediaTime.h&gt;
+
+OBJC_CLASS AVAsset;
+OBJC_CLASS AVSampleBufferDisplayLayer;
+
+typedef struct OpaqueCMTimebase* CMTimebaseRef;
+
+namespace WebCore {
+
+class PlatformClockCM;
+class MediaSourcePrivateAVFObjC;
+
+class MediaPlayerPrivateMediaSourceAVFObjC : public MediaPlayerPrivateInterface {
+public:
+    MediaPlayerPrivateMediaSourceAVFObjC(MediaPlayer*);
+    virtual ~MediaPlayerPrivateMediaSourceAVFObjC();
+
+    static void registerMediaEngine(MediaEngineRegistrar);
+
+    void addDisplayLayer(AVSampleBufferDisplayLayer*);
+    void removeDisplayLayer(AVSampleBufferDisplayLayer*);
+
+    virtual MediaPlayer::NetworkState networkState() const OVERRIDE;
+    virtual MediaPlayer::ReadyState readyState() const OVERRIDE;
+    void setReadyState(MediaPlayer::ReadyState);
+    void setNetworkState(MediaPlayer::NetworkState);
+
+    void seekInternal(double, double, double);
+    void setLoadingProgresssed(bool flag) { m_loadingProgressed = flag; }
+    void setHasAvailableVideoFrame(bool flag) { m_hasAvailableVideoFrame = flag; }
+
+private:
+    // MediaPlayerPrivateInterface
+    virtual void load(const String&amp; url) OVERRIDE;
+    virtual void load(const String&amp; url, PassRefPtr&lt;HTMLMediaSource&gt;) OVERRIDE;
+    virtual void cancelLoad() OVERRIDE;
+
+    virtual void prepareToPlay() OVERRIDE;
+    virtual PlatformMedia platformMedia() const OVERRIDE;
+#if USE(ACCELERATED_COMPOSITING)
+    virtual PlatformLayer* platformLayer() const OVERRIDE;
+#endif
+
+    virtual void play() OVERRIDE;
+    void playInternal();
+
+    virtual void pause() OVERRIDE;
+    void pauseInternal();
+
+    virtual bool paused() const OVERRIDE;
+
+    virtual bool supportsScanning() const OVERRIDE;
+
+    virtual IntSize naturalSize() const OVERRIDE;
+
+    virtual bool hasVideo() const OVERRIDE;
+    virtual bool hasAudio() const OVERRIDE;
+
+    virtual void setVisible(bool) OVERRIDE;
+
+    virtual double durationDouble() const OVERRIDE;
+    virtual double currentTimeDouble() const OVERRIDE;
+    virtual double startTimeDouble() const OVERRIDE;
+    virtual double initialTime() const OVERRIDE;
+
+    virtual void seekWithTolerance(double time, double negativeThreshold, double positiveThreshold) OVERRIDE;
+    virtual bool seeking() const OVERRIDE;
+    virtual void setRateDouble(double) OVERRIDE;
+
+    virtual PassRefPtr&lt;TimeRanges&gt; seekable() const OVERRIDE;
+    virtual double maxTimeSeekableDouble() const OVERRIDE;
+    virtual double minTimeSeekable() const OVERRIDE;
+    virtual PassRefPtr&lt;TimeRanges&gt; buffered() const OVERRIDE;
+
+    virtual bool didLoadingProgress() const OVERRIDE;
+
+    virtual void setSize(const IntSize&amp;) OVERRIDE;
+
+    virtual void paint(GraphicsContext*, const IntRect&amp;) OVERRIDE;
+    virtual void paintCurrentFrameInContext(GraphicsContext*, const IntRect&amp;) OVERRIDE;
+
+    virtual bool hasAvailableVideoFrame() const OVERRIDE;
+
+#if USE(ACCELERATED_COMPOSITING)
+    virtual bool supportsAcceleratedRendering() const OVERRIDE;
+    // called when the rendering system flips the into or out of accelerated rendering mode.
+    virtual void acceleratedRenderingStateChanged() OVERRIDE;
+#endif
+
+    virtual MediaPlayer::MovieLoadType movieLoadType() const OVERRIDE;
+
+    virtual void prepareForRendering() OVERRIDE;
+
+    virtual String engineDescription() const OVERRIDE;
+
+    virtual String languageOfPrimaryAudioTrack() const OVERRIDE;
+
+    virtual size_t extraMemoryCost() const OVERRIDE;
+
+    void ensureLayer();
+    void destroyLayer();
+    void durationChanged();
+
+    // MediaPlayer Factory Methods
+    static PassOwnPtr&lt;MediaPlayerPrivateInterface&gt; create(MediaPlayer*);
+    static bool isAvailable();
+    static void getSupportedTypes(HashSet&lt;String&gt;&amp; types);
+    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;);
+
+    friend class MediaSourcePrivateAVFObjC;
+
+    MediaPlayer* m_player;
+    RefPtr&lt;HTMLMediaSource&gt; m_mediaSource;
+    RefPtr&lt;MediaSourcePrivateAVFObjC&gt; m_mediaSourcePrivate;
+    RetainPtr&lt;AVAsset&gt; m_asset;
+    RetainPtr&lt;AVSampleBufferDisplayLayer&gt; m_sampleBufferDisplayLayer;
+    std::unique_ptr&lt;PlatformClockCM&gt; m_clock;
+    MediaPlayer::NetworkState m_networkState;
+    MediaPlayer::ReadyState m_readyState;
+    bool m_seeking;
+    mutable bool m_loadingProgressed;
+    bool m_hasAvailableVideoFrame;
+};
+
+}
+
+#endif // ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
+
+#endif // MediaPlayerPrivateMediaSourceAVFObjC_h
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (0 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -0,0 +1,438 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;config.h&quot;
+#import &quot;MediaPlayerPrivateMediaSourceAVFObjC.h&quot;
+
+#if ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
+
+#import &quot;HTMLMediaSource.h&quot;
+#import &quot;MediaSourcePrivateAVFObjC.h&quot;
+#import &quot;PlatformClockCM.h&quot;
+#import &quot;SoftLinking.h&quot;
+#import &lt;AVFoundation/AVSampleBufferDisplayLayer.h&gt;
+#import &lt;AVFoundation/AVAsset.h&gt;
+#import &lt;CoreMedia/CMSync.h&gt;
+#import &lt;objc_runtime.h&gt;
+#import &lt;wtf/NeverDestroyed.h&gt;
+#import &lt;wtf/Functional.h&gt;
+#import &lt;wtf/MainThread.h&gt;
+
+#pragma mark -
+#pragma mark Soft Linking
+
+SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
+SOFT_LINK_FRAMEWORK_OPTIONAL(CoreMedia)
+
+SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVAsset)
+SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVURLAsset)
+SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVSampleBufferDisplayLayer)
+SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVStreamDataParser)
+
+namespace WebCore {
+
+#pragma mark -
+#pragma mark MediaPlayerPrivateMediaSourceAVFObjC
+
+MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC(MediaPlayer* player)
+    : m_player(player)
+    , m_clock(new PlatformClockCM())
+    , m_networkState(MediaPlayer::Empty)
+    , m_readyState(MediaPlayer::HaveNothing)
+    , m_seeking(false)
+    , m_loadingProgressed(false)
+{
+}
+
+MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC()
+{
+}
+
+#pragma mark -
+#pragma mark MediaPlayer Factory Methods
+
+void MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine(MediaEngineRegistrar registrar)
+{
+    if (isAvailable())
+        registrar(create, getSupportedTypes, supportsType, 0, 0, 0);
+}
+
+PassOwnPtr&lt;MediaPlayerPrivateInterface&gt; MediaPlayerPrivateMediaSourceAVFObjC::create(MediaPlayer* player)
+{
+    return adoptPtr(new MediaPlayerPrivateMediaSourceAVFObjC(player));
+}
+
+bool MediaPlayerPrivateMediaSourceAVFObjC::isAvailable()
+{
+    return AVFoundationLibrary() &amp;&amp; CoreMediaLibrary() &amp;&amp; getAVStreamDataParserClass();
+}
+
+static HashSet&lt;String&gt; mimeTypeCache()
+{
+    DEFINE_STATIC_LOCAL(HashSet&lt;String&gt;, cache, ());
+    static bool typeListInitialized = false;
+
+    if (typeListInitialized)
+        return cache;
+    typeListInitialized = true;
+
+    NSArray *types = [getAVURLAssetClass() audiovisualMIMETypes];
+    for (NSString *mimeType in types)
+        cache.add(mimeType);
+    
+    return cache;
+} 
+
+void MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes(HashSet&lt;String&gt;&amp; types)
+{
+    types = mimeTypeCache();
+}
+
+MediaPlayer::SupportsType MediaPlayerPrivateMediaSourceAVFObjC::supportsType(const MediaEngineSupportParameters&amp; parameters)
+{
+    // This engine does not support non-media-source sources.
+    if (!parameters.isMediaSource)
+        return MediaPlayer::IsNotSupported;
+
+    if (!mimeTypeCache().contains(parameters.type))
+        return MediaPlayer::IsNotSupported;
+
+    // The spec says:
+    // &quot;Implementors are encouraged to return &quot;maybe&quot; unless the type can be confidently established as being supported or not.&quot;
+    if (parameters.codecs.isEmpty())
+        return MediaPlayer::MayBeSupported;
+
+    NSString *typeString = [NSString stringWithFormat:@&quot;%@; codecs=\&quot;%@\&quot;&quot;, (NSString *)parameters.type, (NSString *)parameters.codecs];
+    return [getAVURLAssetClass() isPlayableExtendedMIMEType:typeString] ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;;
+}
+
+#pragma mark -
+#pragma mark MediaPlayerPrivateInterface Overrides
+
+void MediaPlayerPrivateMediaSourceAVFObjC::load(const String&amp;)
+{
+    ASSERT_NOT_REACHED();
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::load(const String&amp; url, PassRefPtr&lt;HTMLMediaSource&gt; source)
+{
+    UNUSED_PARAM(url);
+
+    m_mediaSource = source;
+    m_mediaSourcePrivate = MediaSourcePrivateAVFObjC::create(this);
+
+    m_mediaSource-&gt;setPrivateAndOpen(*m_mediaSourcePrivate);
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::cancelLoad()
+{
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::prepareToPlay()
+{
+}
+
+PlatformMedia MediaPlayerPrivateMediaSourceAVFObjC::platformMedia() const
+{
+    PlatformMedia pm;
+    pm.type = PlatformMedia::AVFoundationAssetType;
+    pm.media.avfAsset = m_asset.get();
+    return pm;
+}
+
+#if USE(ACCELERATED_COMPOSITING)
+PlatformLayer* MediaPlayerPrivateMediaSourceAVFObjC::platformLayer() const
+{
+    return m_sampleBufferDisplayLayer.get();
+}
+#endif
+
+void MediaPlayerPrivateMediaSourceAVFObjC::play()
+{
+    callOnMainThread(WTF::bind(&amp;MediaPlayerPrivateMediaSourceAVFObjC::playInternal, this));
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::playInternal()
+{
+    m_clock-&gt;start();
+    m_player-&gt;rateChanged();
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::pause()
+{
+    callOnMainThread(WTF::bind(&amp;MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal, this));
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal()
+{
+    m_clock-&gt;stop();
+    m_player-&gt;rateChanged();
+}
+
+bool MediaPlayerPrivateMediaSourceAVFObjC::paused() const
+{
+    return !m_clock-&gt;isRunning();
+}
+
+bool MediaPlayerPrivateMediaSourceAVFObjC::supportsScanning() const
+{
+    return true;
+}
+
+IntSize MediaPlayerPrivateMediaSourceAVFObjC::naturalSize() const
+{
+    // FIXME(125156): Report the intrinsic size of the enabled video track.
+    return IntSize();
+}
+
+bool MediaPlayerPrivateMediaSourceAVFObjC::hasVideo() const
+{
+    return m_mediaSourcePrivate-&gt;hasVideo();
+}
+
+bool MediaPlayerPrivateMediaSourceAVFObjC::hasAudio() const
+{
+    return m_mediaSourcePrivate-&gt;hasAudio();
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::setVisible(bool)
+{
+    // No-op.
+}
+
+double MediaPlayerPrivateMediaSourceAVFObjC::durationDouble() const
+{
+    return m_mediaSource-&gt;duration();
+}
+
+double MediaPlayerPrivateMediaSourceAVFObjC::currentTimeDouble() const
+{
+    return m_clock-&gt;currentTime();
+}
+
+double MediaPlayerPrivateMediaSourceAVFObjC::startTimeDouble() const
+{
+    return 0;
+}
+
+double MediaPlayerPrivateMediaSourceAVFObjC::initialTime() const
+{
+    return 0;
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance(double time, double negativeThreshold, double positiveThreshold)
+{
+    m_seeking = true;
+    callOnMainThread(WTF::bind(&amp;MediaPlayerPrivateMediaSourceAVFObjC::seekInternal, this, time, negativeThreshold, positiveThreshold));
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::seekInternal(double time, double negativeThreshold, double positiveThreshold)
+{
+    MediaTime seekTime = m_mediaSourcePrivate-&gt;seekToTime(MediaTime::createWithDouble(time), MediaTime::createWithDouble(positiveThreshold), MediaTime::createWithDouble(negativeThreshold));
+    m_clock-&gt;setCurrentMediaTime(seekTime);
+    m_seeking = false;
+    m_player-&gt;timeChanged();
+}
+
+bool MediaPlayerPrivateMediaSourceAVFObjC::seeking() const
+{
+    return m_seeking;
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::setRateDouble(double rate)
+{
+    m_clock-&gt;setPlayRate(rate);
+    m_player-&gt;rateChanged();
+}
+
+MediaPlayer::NetworkState MediaPlayerPrivateMediaSourceAVFObjC::networkState() const
+{
+    return m_networkState;
+}
+
+MediaPlayer::ReadyState MediaPlayerPrivateMediaSourceAVFObjC::readyState() const
+{
+    return m_readyState;
+}
+
+PassRefPtr&lt;TimeRanges&gt; MediaPlayerPrivateMediaSourceAVFObjC::seekable() const
+{
+    return TimeRanges::create(minTimeSeekable(), maxTimeSeekableDouble());
+}
+
+double MediaPlayerPrivateMediaSourceAVFObjC::maxTimeSeekableDouble() const
+{
+    return durationDouble();
+}
+
+double MediaPlayerPrivateMediaSourceAVFObjC::minTimeSeekable() const
+{
+    return startTimeDouble();
+}
+
+PassRefPtr&lt;TimeRanges&gt; MediaPlayerPrivateMediaSourceAVFObjC::buffered() const
+{
+    return m_mediaSource-&gt;buffered();
+}
+
+bool MediaPlayerPrivateMediaSourceAVFObjC::didLoadingProgress() const
+{
+    bool loadingProgressed = m_loadingProgressed;
+    m_loadingProgressed = false;
+    return loadingProgressed;
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::setSize(const IntSize&amp;)
+{
+    // No-op.
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::paint(GraphicsContext*, const IntRect&amp;)
+{
+    // FIXME(125157): Implement painting.
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext(GraphicsContext*, const IntRect&amp;)
+{
+    // FIXME(125157): Implement painting.
+}
+
+bool MediaPlayerPrivateMediaSourceAVFObjC::hasAvailableVideoFrame() const
+{
+    return m_hasAvailableVideoFrame;
+}
+
+#if USE(ACCELERATED_COMPOSITING)
+bool MediaPlayerPrivateMediaSourceAVFObjC::supportsAcceleratedRendering() const
+{
+    return true;
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged()
+{
+    if (m_player-&gt;mediaPlayerClient()-&gt;mediaPlayerRenderingCanBeAccelerated(m_player))
+        ensureLayer();
+    else
+        destroyLayer();
+}
+#endif
+
+MediaPlayer::MovieLoadType MediaPlayerPrivateMediaSourceAVFObjC::movieLoadType() const
+{
+    return MediaPlayer::StoredStream;
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::prepareForRendering()
+{
+    // No-op.
+}
+
+String MediaPlayerPrivateMediaSourceAVFObjC::engineDescription() const
+{
+    static NeverDestroyed&lt;String&gt; description(ASCIILiteral(&quot;AVFoundation MediaSource Engine&quot;));
+    return description;
+}
+
+String MediaPlayerPrivateMediaSourceAVFObjC::languageOfPrimaryAudioTrack() const
+{
+    // FIXME(125158): implement languageOfPrimaryAudioTrack()
+    return emptyString();
+}
+
+size_t MediaPlayerPrivateMediaSourceAVFObjC::extraMemoryCost() const
+{
+    return 0;
+}
+
+#pragma mark -
+#pragma mark Utility Methods
+
+void MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer()
+{
+    if (m_sampleBufferDisplayLayer)
+        return;
+
+    m_sampleBufferDisplayLayer = adoptNS([[getAVSampleBufferDisplayLayerClass() alloc] init]);
+    [m_sampleBufferDisplayLayer setControlTimebase:m_clock-&gt;timebase()];
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer()
+{
+    if (!m_sampleBufferDisplayLayer)
+        return;
+
+    [m_sampleBufferDisplayLayer setControlTimebase:0];
+    m_sampleBufferDisplayLayer = nullptr;
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::durationChanged()
+{
+    m_player-&gt;durationChanged();
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::setReadyState(MediaPlayer::ReadyState readyState)
+{
+    if (m_readyState == readyState)
+        return;
+
+    m_readyState = readyState;
+    m_player-&gt;readyStateChanged();
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState(MediaPlayer::NetworkState networkState)
+{
+    if (m_networkState == networkState)
+        return;
+
+    m_networkState = networkState;
+    m_player-&gt;networkStateChanged();
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer(AVSampleBufferDisplayLayer* displayLayer)
+{
+    ASSERT(displayLayer);
+    if (displayLayer == m_sampleBufferDisplayLayer)
+        return;
+
+    m_sampleBufferDisplayLayer = displayLayer;
+    [m_sampleBufferDisplayLayer setControlTimebase:m_clock-&gt;timebase()];
+    m_player-&gt;mediaPlayerClient()-&gt;mediaPlayerRenderingModeChanged(m_player);
+
+    // FIXME: move this somewhere appropriate:
+    m_player-&gt;firstVideoFrameAvailable();
+}
+
+void MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer(AVSampleBufferDisplayLayer* displayLayer)
+{
+    if (displayLayer != m_sampleBufferDisplayLayer)
+        return;
+
+    m_sampleBufferDisplayLayer = nullptr;
+    m_player-&gt;mediaPlayerClient()-&gt;mediaPlayerRenderingModeChanged(m_player);
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSourcePrivateAVFObjCh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h (0 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef MediaSourcePrivateAVFObjC_h
+#define MediaSourcePrivateAVFObjC_h
+
+#if ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
+
+#include &quot;MediaSourcePrivate.h&quot;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+OBJC_CLASS AVAsset;
+OBJC_CLASS AVStreamDataParser;
+OBJC_CLASS NSError;
+OBJC_CLASS NSObject;
+typedef struct opaqueCMSampleBuffer *CMSampleBufferRef;
+
+namespace WebCore {
+
+class MediaPlayerPrivateMediaSourceAVFObjC;
+class SourceBufferPrivateAVFObjC;
+class TimeRanges;
+
+class MediaSourcePrivateAVFObjC FINAL : public MediaSourcePrivate {
+public:
+    static RefPtr&lt;MediaSourcePrivateAVFObjC&gt; create(MediaPlayerPrivateMediaSourceAVFObjC*);
+    virtual ~MediaSourcePrivateAVFObjC();
+
+    MediaPlayerPrivateMediaSourceAVFObjC* player() const { return m_player; }
+    const Vector&lt;SourceBufferPrivateAVFObjC*&gt;&amp; activeSourceBuffers() const { return m_activeSourceBuffers; }
+
+    virtual AddStatus addSourceBuffer(const ContentType&amp;, RefPtr&lt;SourceBufferPrivate&gt;&amp;) OVERRIDE;
+    virtual double duration() OVERRIDE;
+    virtual void setDuration(double) OVERRIDE;
+    virtual void markEndOfStream(EndOfStreamStatus) OVERRIDE;
+    virtual void unmarkEndOfStream() OVERRIDE;
+    virtual MediaPlayer::ReadyState readyState() const OVERRIDE;
+    virtual void setReadyState(MediaPlayer::ReadyState) OVERRIDE;
+
+    bool hasAudio() const;
+    bool hasVideo() const;
+
+    MediaTime seekToTime(MediaTime, MediaTime negativeThreshold, MediaTime positiveThreshold);
+
+private:
+    MediaSourcePrivateAVFObjC(MediaPlayerPrivateMediaSourceAVFObjC*);
+
+    void sourceBufferPrivateDidChangeActiveState(SourceBufferPrivateAVFObjC*, bool active);
+    void sourceBufferPrivateDidReceiveInitializationSegment(SourceBufferPrivateAVFObjC*);
+    void monitorSourceBuffers();
+    void removeSourceBuffer(SourceBufferPrivate*);
+
+    friend class SourceBufferPrivateAVFObjC;
+
+    MediaPlayerPrivateMediaSourceAVFObjC* m_player;
+    double m_duration;
+    Vector&lt;RefPtr&lt;SourceBufferPrivateAVFObjC&gt;&gt; m_sourceBuffers;
+    Vector&lt;SourceBufferPrivateAVFObjC*&gt; m_activeSourceBuffers;
+    bool m_isEnded;
+};
+
+}
+
+#endif // ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSourcePrivateAVFObjCmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm (0 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -0,0 +1,175 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;MediaSourcePrivateAVFObjC.h&quot;
+
+#if ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
+
+#import &quot;ContentType.h&quot;
+#import &quot;ExceptionCodePlaceholder.h&quot;
+#import &quot;MediaPlayerPrivateMediaSourceAVFObjC.h&quot;
+#import &quot;SourceBufferPrivateAVFObjC.h&quot;
+#import &quot;NotImplemented.h&quot;
+#import &quot;SoftLinking.h&quot;
+#import &lt;objc/runtime.h&gt;
+#import &lt;wtf/text/AtomicString.h&gt;
+#import &lt;wtf/text/StringBuilder.h&gt;
+
+namespace WebCore {
+
+#pragma mark -
+#pragma mark MediaSourcePrivateAVFObjC
+
+RefPtr&lt;MediaSourcePrivateAVFObjC&gt; MediaSourcePrivateAVFObjC::create(MediaPlayerPrivateMediaSourceAVFObjC* parent)
+{
+    return adoptRef(new MediaSourcePrivateAVFObjC(parent));
+}
+
+MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC(MediaPlayerPrivateMediaSourceAVFObjC* parent)
+    : m_player(parent)
+    , m_duration(std::numeric_limits&lt;double&gt;::quiet_NaN())
+    , m_isEnded(false)
+{
+}
+
+MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC()
+{
+}
+
+MediaSourcePrivate::AddStatus MediaSourcePrivateAVFObjC::addSourceBuffer(const ContentType&amp; contentType, RefPtr&lt;SourceBufferPrivate&gt;&amp; outPrivate)
+{
+    MediaEngineSupportParameters parameters;
+    parameters.isMediaSource = true;
+    parameters.type = contentType.type();
+    parameters.codecs = contentType.parameter(ASCIILiteral(&quot;codecs&quot;));
+    if (MediaPlayerPrivateMediaSourceAVFObjC::supportsType(parameters) == MediaPlayer::IsNotSupported)
+        return NotSupported;
+
+    m_sourceBuffers.append(SourceBufferPrivateAVFObjC::create(this));
+    outPrivate = m_sourceBuffers.last();
+
+    return Ok;
+}
+
+void MediaSourcePrivateAVFObjC::removeSourceBuffer(SourceBufferPrivate* buffer)
+{
+    ASSERT(m_sourceBuffers.contains(buffer));
+
+    size_t pos = m_activeSourceBuffers.find(buffer);
+    if (pos != notFound)
+        m_activeSourceBuffers.remove(pos);
+
+    pos = m_sourceBuffers.find(buffer);
+    m_sourceBuffers.remove(pos);
+}
+
+double MediaSourcePrivateAVFObjC::duration()
+{
+    return m_duration;
+}
+
+void MediaSourcePrivateAVFObjC::setDuration(double duration)
+{
+    if (duration == m_duration)
+        return;
+
+    m_duration = duration;
+}
+
+void MediaSourcePrivateAVFObjC::markEndOfStream(EndOfStreamStatus) 
+{
+    // FIXME(125159): implement markEndOfStream()
+    m_isEnded = true;
+}
+
+void MediaSourcePrivateAVFObjC::unmarkEndOfStream() 
+{
+    // FIXME(125159): implement unmarkEndOfStream()
+    m_isEnded = false;
+}
+
+MediaPlayer::ReadyState MediaSourcePrivateAVFObjC::readyState() const
+{
+    return m_player-&gt;readyState();
+}
+
+void MediaSourcePrivateAVFObjC::setReadyState(MediaPlayer::ReadyState readyState)
+{
+    m_player-&gt;setReadyState(readyState);
+}
+
+void MediaSourcePrivateAVFObjC::sourceBufferPrivateDidChangeActiveState(SourceBufferPrivateAVFObjC* buffer, bool active)
+{
+    if (active &amp;&amp; !m_activeSourceBuffers.contains(buffer))
+        m_activeSourceBuffers.append(buffer);
+
+    if (!active) {
+        size_t position = m_activeSourceBuffers.find(buffer);
+        if (position != notFound)
+            m_activeSourceBuffers.remove(position);
+    }
+}
+
+static bool MediaSourcePrivateAVFObjCHasAudio(PassRefPtr&lt;SourceBufferPrivateAVFObjC&gt; prpSourceBuffer)
+{
+    RefPtr&lt;SourceBufferPrivateAVFObjC&gt; sourceBuffer = prpSourceBuffer;
+    return sourceBuffer-&gt;hasAudio();
+}
+
+bool MediaSourcePrivateAVFObjC::hasAudio() const
+{
+    return std::any_of(m_activeSourceBuffers.begin(), m_activeSourceBuffers.end(), MediaSourcePrivateAVFObjCHasAudio);
+}
+
+static bool MediaSourcePrivateAVFObjCHasVideo(PassRefPtr&lt;SourceBufferPrivateAVFObjC&gt; prpSourceBuffer)
+{
+    RefPtr&lt;SourceBufferPrivateAVFObjC&gt; sourceBuffer = prpSourceBuffer;
+    return sourceBuffer-&gt;hasVideo();
+}
+
+bool MediaSourcePrivateAVFObjC::hasVideo() const
+{
+    return std::any_of(m_activeSourceBuffers.begin(), m_activeSourceBuffers.end(), MediaSourcePrivateAVFObjCHasVideo);
+}
+
+MediaTime MediaSourcePrivateAVFObjC::seekToTime(MediaTime targetTime, MediaTime negativeThreshold, MediaTime positiveThreshold)
+{
+    MediaTime seekTime = targetTime;
+    for (auto it = m_activeSourceBuffers.begin(), end = m_activeSourceBuffers.end(); it != end; ++it) {
+        MediaTime sourceSeekTime = (*it)-&gt;fastSeekTimeForMediaTime(targetTime, negativeThreshold, positiveThreshold);
+        if (abs(targetTime - sourceSeekTime) &gt; abs(targetTime - seekTime))
+            seekTime = sourceSeekTime;
+    }
+
+    for (auto it = m_activeSourceBuffers.begin(), end = m_activeSourceBuffers.end(); it != end; ++it)
+        (*it)-&gt;seekToTime(seekTime);
+
+    return seekTime;
+}
+
+}
+
+#endif // ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h (0 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -0,0 +1,115 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef SourceBufferPrivateAVFObjC_h
+#define SourceBufferPrivateAVFObjC_h
+
+#if ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
+
+#include &quot;SourceBufferPrivate.h&quot;
+#include &lt;wtf/Deque.h&gt;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/MediaTime.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/Vector.h&gt;
+#include &lt;wtf/text/AtomicString.h&gt;
+
+OBJC_CLASS AVAsset;
+OBJC_CLASS AVStreamDataParser;
+OBJC_CLASS AVSampleBufferDisplayLayer;
+OBJC_CLASS NSError;
+OBJC_CLASS NSObject;
+typedef struct opaqueCMSampleBuffer *CMSampleBufferRef;
+typedef const struct opaqueCMFormatDescription *CMFormatDescriptionRef;
+
+namespace WebCore {
+
+class MediaSourcePrivateAVFObjC;
+class TimeRanges;
+class AudioTrackPrivate;
+class VideoTrackPrivate;
+class AudioTrackPrivateMediaSourceAVFObjC;
+class VideoTrackPrivateMediaSourceAVFObjC;
+
+class SourceBufferPrivateAVFObjC FINAL : public SourceBufferPrivate {
+public:
+    static RefPtr&lt;SourceBufferPrivateAVFObjC&gt; create(MediaSourcePrivateAVFObjC*);
+    virtual ~SourceBufferPrivateAVFObjC();
+
+    // AVStreamDataParser delegate methods
+    void didParseStreamDataAsAsset(AVAsset*);
+    void didFailToParseStreamDataWithError(NSError*);
+    void didProvideMediaDataForTrackID(int trackID, CMSampleBufferRef, const String&amp; mediaType, unsigned flags);
+    void didReachEndOfTrackWithTrackID(int trackID, const String&amp; mediaType);
+
+    bool processCodedFrame(int trackID, CMSampleBufferRef, const String&amp; mediaType);
+
+    bool hasVideo() const;
+    bool hasAudio() const;
+
+    void trackDidChangeEnabled(VideoTrackPrivateMediaSourceAVFObjC*);
+    void trackDidChangeEnabled(AudioTrackPrivateMediaSourceAVFObjC*);
+
+    void seekToTime(MediaTime);
+    MediaTime fastSeekTimeForMediaTime(MediaTime, MediaTime negativeThreshold, MediaTime positiveThreshold);
+
+private:
+    explicit SourceBufferPrivateAVFObjC(MediaSourcePrivateAVFObjC*);
+
+    // SourceBufferPrivate overrides
+    virtual void setClient(SourceBufferPrivateClient*) OVERRIDE;
+    virtual AppendResult append(const unsigned char* data, unsigned length) OVERRIDE;
+    virtual void abort() OVERRIDE;
+    virtual void removedFromMediaSource() OVERRIDE;
+    virtual MediaPlayer::ReadyState readyState() const OVERRIDE;
+    virtual void setReadyState(MediaPlayer::ReadyState) OVERRIDE;
+    virtual void evictCodedFrames() OVERRIDE;
+    virtual bool isFull() OVERRIDE;
+    virtual void flushAndEnqueueNonDisplayingSamples(Vector&lt;RefPtr&lt;MediaSample&gt;&gt;, AtomicString trackID) OVERRIDE;
+    virtual void enqueueSample(PassRefPtr&lt;MediaSample&gt;, AtomicString trackID) OVERRIDE;
+    virtual bool isReadyForMoreSamples() OVERRIDE;
+    virtual void setActive(bool) OVERRIDE;
+
+    Vector&lt;RefPtr&lt;VideoTrackPrivate&gt;&gt; m_videoTracks;
+    Vector&lt;RefPtr&lt;AudioTrackPrivate&gt;&gt; m_audioTracks;
+
+    RetainPtr&lt;AVStreamDataParser&gt; m_parser;
+    RetainPtr&lt;AVAsset&gt; m_asset;
+    RetainPtr&lt;AVSampleBufferDisplayLayer&gt; m_displayLayer;
+    RetainPtr&lt;NSObject&gt; m_delegate;
+
+    MediaSourcePrivateAVFObjC* m_parent;
+    SourceBufferPrivateClient* m_client;
+
+    bool m_parsingSucceeded;
+    int m_enabledVideoTrackID;
+};
+
+}
+
+#endif // ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (0 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -0,0 +1,554 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;config.h&quot;
+#import &quot;SourceBufferPrivateAVFObjC.h&quot;
+
+#if ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
+
+#import &quot;ExceptionCodePlaceholder.h&quot;
+#import &quot;Logging.h&quot;
+#import &quot;MediaDescription.h&quot;
+#import &quot;MediaPlayerPrivateMediaSourceAVFObjC.h&quot;
+#import &quot;MediaSample.h&quot;
+#import &quot;MediaSourcePrivateAVFObjC.h&quot;
+#import &quot;MediaTimeMac.h&quot;
+#import &quot;NotImplemented.h&quot;
+#import &quot;SoftLinking.h&quot;
+#import &quot;SourceBufferPrivateClient.h&quot;
+#import &quot;TimeRanges.h&quot;
+#import &quot;AudioTrackPrivateMediaSourceAVFObjC.h&quot;
+#import &quot;VideoTrackPrivateMediaSourceAVFObjC.h&quot;
+#import &quot;InbandTextTrackPrivateAVFObjC.h&quot;
+#import &lt;AVFoundation/AVAssetTrack.h&gt;
+#import &lt;AVFoundation/AVSampleBufferDisplayLayer.h&gt;
+#import &lt;objc/runtime.h&gt;
+#import &lt;wtf/text/AtomicString.h&gt;
+#import &lt;wtf/text/CString.h&gt;
+#import &lt;wtf/HashCountedSet.h&gt;
+#import &lt;wtf/WeakPtr.h&gt;
+#import &lt;map&gt;
+
+#pragma mark -
+#pragma mark Soft Linking
+
+SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
+SOFT_LINK_FRAMEWORK_OPTIONAL(CoreMedia)
+
+SOFT_LINK_CLASS(AVFoundation, AVAssetTrack)
+SOFT_LINK_CLASS(AVFoundation, AVStreamDataParser)
+SOFT_LINK_CLASS(AVFoundation, AVSampleBufferDisplayLayer)
+
+SOFT_LINK_POINTER_OPTIONAL(AVFoundation, AVMediaTypeVideo, NSString *)
+SOFT_LINK_POINTER_OPTIONAL(AVFoundation, AVMediaTypeAudio, NSString *)
+SOFT_LINK_POINTER_OPTIONAL(AVFoundation, AVMediaTypeText, NSString *)
+
+SOFT_LINK_CONSTANT(CoreMedia, kCMTimeZero, CMTime);
+SOFT_LINK_CONSTANT(CoreMedia, kCMTimeInvalid, CMTime);
+SOFT_LINK_CONSTANT(CoreMedia, kCMSampleAttachmentKey_DoNotDisplay, CFStringRef)
+SOFT_LINK_CONSTANT(CoreMedia, kCMSampleAttachmentKey_NotSync, CFStringRef)
+SOFT_LINK_CONSTANT(CoreMedia, kCMSampleBufferAttachmentKey_DrainAfterDecoding, CFStringRef)
+SOFT_LINK_CONSTANT(CoreMedia, kCMSampleBufferAttachmentKey_ResetDecoderBeforeDecoding, CFStringRef)
+SOFT_LINK_CONSTANT(CoreMedia, kCMSampleBufferAttachmentKey_EmptyMedia, CFStringRef)
+SOFT_LINK_CONSTANT(CoreMedia, kCMSampleBufferAttachmentKey_DisplayEmptyMediaImmediately, CFStringRef)
+
+SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicVisual, NSString*)
+SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicAudible, NSString*)
+SOFT_LINK_CONSTANT(AVFoundation, AVMediaCharacteristicLegible, NSString*)
+
+SOFT_LINK(CoreMedia, CMFormatDescriptionGetMediaType, CMMediaType, (CMFormatDescriptionRef desc), (desc))
+SOFT_LINK(CoreMedia, CMSampleBufferCreate, OSStatus, (CFAllocatorRef allocator, CMBlockBufferRef dataBuffer, Boolean dataReady, CMSampleBufferMakeDataReadyCallback makeDataReadyCallback, void *makeDataReadyRefcon, CMFormatDescriptionRef formatDescription, CMItemCount numSamples, CMItemCount numSampleTimingEntries, const CMSampleTimingInfo *sampleTimingArray, CMItemCount numSampleSizeEntries, const size_t *sampleSizeArray, CMSampleBufferRef *sBufOut), (allocator, dataBuffer, dataReady, makeDataReadyCallback, makeDataReadyRefcon, formatDescription, numSamples, numSampleTimingEntries, sampleTimingArray, numSampleSizeEntries, sampleSizeArray, sBufOut))
+SOFT_LINK(CoreMedia, CMSampleBufferCreateCopy, OSStatus, (CFAllocatorRef allocator, CMSampleBufferRef sbuf, CMSampleBufferRef *sbufCopyOut), (allocator, sbuf, sbufCopyOut))
+SOFT_LINK(CoreMedia, CMSampleBufferCallForEachSample, OSStatus, (CMSampleBufferRef sbuf, OSStatus (*callback)( CMSampleBufferRef sampleBuffer, CMItemCount index, void *refcon), void *refcon), (sbuf, callback, refcon))
+SOFT_LINK(CoreMedia, CMSampleBufferGetDecodeTimeStamp, CMTime, (CMSampleBufferRef sbuf), (sbuf))
+SOFT_LINK(CoreMedia, CMSampleBufferGetDuration, CMTime, (CMSampleBufferRef sbuf), (sbuf))
+SOFT_LINK(CoreMedia, CMSampleBufferGetPresentationTimeStamp, CMTime, (CMSampleBufferRef sbuf), (sbuf))
+SOFT_LINK(CoreMedia, CMSampleBufferGetSampleAttachmentsArray, CFArrayRef, (CMSampleBufferRef sbuf, Boolean createIfNecessary), (sbuf, createIfNecessary))
+SOFT_LINK(CoreMedia, CMFormatDescriptionGetMediaSubType, FourCharCode, (CMFormatDescriptionRef desc), (desc))
+SOFT_LINK(CoreMedia, CMSetAttachment, void, (CMAttachmentBearerRef target, CFStringRef key, CFTypeRef value, CMAttachmentMode attachmentMode), (target, key, value, attachmentMode))
+
+#define AVMediaTypeVideo getAVMediaTypeVideo()
+#define AVMediaTypeAudio getAVMediaTypeAudio()
+#define AVMediaTypeText getAVMediaTypeText()
+#define kCMTimeZero getkCMTimeZero()
+#define kCMTimeInvalid getkCMTimeInvalid()
+#define kCMSampleAttachmentKey_NotSync getkCMSampleAttachmentKey_NotSync()
+#define kCMSampleAttachmentKey_DoNotDisplay getkCMSampleAttachmentKey_DoNotDisplay()
+#define kCMSampleBufferAttachmentKey_ResetDecoderBeforeDecoding getkCMSampleBufferAttachmentKey_ResetDecoderBeforeDecoding()
+#define kCMSampleBufferAttachmentKey_DrainAfterDecoding getkCMSampleBufferAttachmentKey_DrainAfterDecoding()
+#define kCMSampleBufferAttachmentKey_EmptyMedia getkCMSampleBufferAttachmentKey_EmptyMedia()
+#define kCMSampleBufferAttachmentKey_DisplayEmptyMediaImmediately getkCMSampleBufferAttachmentKey_DisplayEmptyMediaImmediately()
+
+#define AVMediaCharacteristicVisual getAVMediaCharacteristicVisual()
+#define AVMediaCharacteristicAudible getAVMediaCharacteristicAudible()
+#define AVMediaCharacteristicLegible getAVMediaCharacteristicLegible()
+
+#pragma mark -
+#pragma mark AVStreamDataParser
+@class AVStreamDataParserInternal;
+
+NS_CLASS_AVAILABLE(TBD, TBD)
+@interface AVStreamDataParser : NSObject
+- (void)setDelegate:(id)delegate;
+- (void)appendStreamData:(NSData *)data;
+- (void)setShouldProvideMediaData:(BOOL)shouldProvideMediaData forTrackID:(CMPersistentTrackID)trackID;
+- (BOOL)shouldProvideMediaDataForTrackID:(CMPersistentTrackID)trackID;
+@end
+
+#pragma mark -
+#pragma mark WebAVStreamDataParserListener
+
+@interface WebAVStreamDataParserListener : NSObject {
+    WebCore::SourceBufferPrivateAVFObjC* _parent;
+    AVStreamDataParser* _parser;
+}
+- (id)initWithParser:(AVStreamDataParser*)parser parent:(WebCore::SourceBufferPrivateAVFObjC*)parent;
+@end
+
+@implementation WebAVStreamDataParserListener
+- (id)initWithParser:(AVStreamDataParser*)parser parent:(WebCore::SourceBufferPrivateAVFObjC*)parent
+{
+    self = [super init];
+    if (!self)
+        return nil;
+
+    ASSERT(parent);
+    _parent = parent;
+    _parser = parser;
+    [_parser setDelegate:self];
+    return self;
+}
+
+- (void)dealloc
+{
+    [_parser setDelegate:nil];
+    [super dealloc];
+}
+
+- (void)streamDataParser:(AVStreamDataParser *)streamDataParser didParseStreamDataAsAsset:(AVAsset *)asset
+{
+#if ASSERT_DISABLED
+    UNUSED_PARAM(streamDataParser);
+#endif
+    ASSERT(streamDataParser == _parser);
+    _parent-&gt;didParseStreamDataAsAsset(asset);
+}
+
+- (void)streamDataParser:(AVStreamDataParser *)streamDataParser didFailToParseStreamDataWithError:(NSError *)error
+{
+#if ASSERT_DISABLED
+    UNUSED_PARAM(streamDataParser);
+#endif
+    ASSERT(streamDataParser == _parser);
+    _parent-&gt;didFailToParseStreamDataWithError(error);
+}
+
+- (void)streamDataParser:(AVStreamDataParser *)streamDataParser didProvideMediaData:(CMSampleBufferRef)mediaData forTrackID:(CMPersistentTrackID)trackID mediaType:(NSString *)mediaType flags:(NSUInteger)flags
+{
+#if ASSERT_DISABLED
+    UNUSED_PARAM(streamDataParser);
+#endif
+    ASSERT(streamDataParser == _parser);
+    _parent-&gt;didProvideMediaDataForTrackID(trackID, mediaData, mediaType, flags);
+}
+
+- (void)streamDataParser:(AVStreamDataParser *)streamDataParser didReachEndOfTrackWithTrackID:(CMPersistentTrackID)trackID mediaType:(NSString *)mediaType
+{
+#if ASSERT_DISABLED
+    UNUSED_PARAM(streamDataParser);
+#endif
+    ASSERT(streamDataParser == _parser);
+    _parent-&gt;didReachEndOfTrackWithTrackID(trackID, mediaType);
+}
+@end
+
+namespace WebCore {
+
+#pragma mark -
+#pragma mark MediaSampleAVFObjC
+
+class MediaSampleAVFObjC FINAL : public MediaSample {
+public:
+    static RefPtr&lt;MediaSampleAVFObjC&gt; create(CMSampleBufferRef sample, int trackID) { return adoptRef(new MediaSampleAVFObjC(sample, trackID)); }
+    virtual ~MediaSampleAVFObjC() { }
+
+    virtual MediaTime presentationTime() const OVERRIDE { return toMediaTime(CMSampleBufferGetPresentationTimeStamp(m_sample.get())); }
+    virtual MediaTime decodeTime() const OVERRIDE { return toMediaTime(CMSampleBufferGetDecodeTimeStamp(m_sample.get())); }
+    virtual MediaTime duration() const OVERRIDE { return toMediaTime(CMSampleBufferGetDuration(m_sample.get())); }
+    virtual AtomicString trackID() const OVERRIDE { return m_id; }
+
+    virtual SampleFlags flags() const OVERRIDE;
+    virtual PlatformSample platformSample() OVERRIDE;
+
+protected:
+    MediaSampleAVFObjC(CMSampleBufferRef sample, int trackID)
+        : m_sample(sample)
+        , m_id(String::format(&quot;%d&quot;, trackID))
+    {
+    }
+
+    RetainPtr&lt;CMSampleBufferRef&gt; m_sample;
+    AtomicString m_id;
+};
+
+PlatformSample MediaSampleAVFObjC::platformSample()
+{
+    PlatformSample sample = { PlatformSample::CMSampleBufferType, { .cmSampleBuffer = m_sample.get() } };
+    return sample;
+}
+
+static bool CMSampleBufferIsRandomAccess(CMSampleBufferRef sample)
+{
+    CFArrayRef attachments = CMSampleBufferGetSampleAttachmentsArray(sample, false);
+    for (CFIndex i = 0, count = CFArrayGetCount(attachments); i &lt; count; ++i) {
+        CFDictionaryRef attachmentDict = (CFDictionaryRef)CFArrayGetValueAtIndex(attachments, i);
+        if (!CFDictionaryContainsKey(attachmentDict, kCMSampleAttachmentKey_NotSync))
+            return true;
+    }
+    return false;
+}
+
+MediaSample::SampleFlags MediaSampleAVFObjC::flags() const
+{
+    int returnValue = MediaSample::None;
+
+    if (CMSampleBufferIsRandomAccess(m_sample.get()))
+        returnValue |= MediaSample::IsSync;
+
+    return SampleFlags(returnValue);
+}
+
+#pragma mark -
+#pragma mark MediaDescriptionAVFObjC
+
+class MediaDescriptionAVFObjC FINAL : public MediaDescription {
+public:
+    static RefPtr&lt;MediaDescriptionAVFObjC&gt; create(AVAssetTrack* track) { return adoptRef(new MediaDescriptionAVFObjC(track)); }
+    virtual ~MediaDescriptionAVFObjC() { }
+
+    virtual AtomicString codec() const OVERRIDE { return m_codec; }
+    virtual bool isVideo() const OVERRIDE { return m_isVideo; }
+    virtual bool isAudio() const OVERRIDE { return m_isAudio; }
+    virtual bool isText() const OVERRIDE { return m_isText; }
+    
+protected:
+    MediaDescriptionAVFObjC(AVAssetTrack* track)
+        : m_isVideo([track hasMediaCharacteristic:AVMediaCharacteristicVisual])
+        , m_isAudio([track hasMediaCharacteristic:AVMediaCharacteristicAudible])
+        , m_isText([track hasMediaCharacteristic:AVMediaCharacteristicLegible])
+    {
+        NSArray* formatDescriptions = [track formatDescriptions];
+        CMFormatDescriptionRef description = [formatDescriptions count] ? (CMFormatDescriptionRef)[formatDescriptions objectAtIndex:0] : 0;
+        if (description) {
+            FourCharCode codec = CMFormatDescriptionGetMediaSubType(description);
+            m_codec = AtomicString(reinterpret_cast&lt;LChar*&gt;(&amp;codec), 4);
+        }
+    }
+
+    AtomicString m_codec;
+    bool m_isVideo;
+    bool m_isAudio;
+    bool m_isText;
+};
+
+#pragma mark -
+#pragma mark SourceBufferPrivateAVFObjC
+
+RefPtr&lt;SourceBufferPrivateAVFObjC&gt; SourceBufferPrivateAVFObjC::create(MediaSourcePrivateAVFObjC* parent)
+{
+    return adoptRef(new SourceBufferPrivateAVFObjC(parent));
+}
+
+SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC(MediaSourcePrivateAVFObjC* parent)
+    : m_parser(adoptNS([[getAVStreamDataParserClass() alloc] init]))
+    , m_delegate(adoptNS([[WebAVStreamDataParserListener alloc] initWithParser:m_parser.get() parent:this]))
+    , m_parent(parent)
+    , m_client(0)
+    , m_parsingSucceeded(true)
+{
+}
+
+SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC()
+{
+    if (m_displayLayer) {
+        m_parent-&gt;player()-&gt;removeDisplayLayer(m_displayLayer.get());
+        [m_displayLayer flushAndRemoveImage];
+        [m_displayLayer stopRequestingMediaData];
+        m_displayLayer = nullptr;
+    }
+}
+
+void SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset(AVAsset* asset)
+{
+    LOG(Media, &quot;SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset(%p)&quot;, this);
+
+    m_asset = asset;
+
+    SourceBufferPrivateClient::InitializationSegment segment;
+    segment.duration = toMediaTime([m_asset duration]);
+
+    for (AVAssetTrack* track in [m_asset tracks]) {
+        if ([track hasMediaCharacteristic:AVMediaCharacteristicVisual]) {
+            SourceBufferPrivateClient::InitializationSegment::VideoTrackInformation info;
+            info.track = VideoTrackPrivateMediaSourceAVFObjC::create(track, this);
+            info.description = MediaDescriptionAVFObjC::create(track);
+            segment.videoTracks.append(info);
+        } else if ([track hasMediaCharacteristic:AVMediaCharacteristicAudible]) {
+            SourceBufferPrivateClient::InitializationSegment::AudioTrackInformation info;
+            info.track = AudioTrackPrivateMediaSourceAVFObjC::create(track, this);
+            info.description = MediaDescriptionAVFObjC::create(track);
+            segment.audioTracks.append(info);
+        }
+
+        // FIXME(125161): Add TextTrack support
+    }
+
+    if (m_client)
+        m_client-&gt;sourceBufferPrivateDidReceiveInitializationSegment(this, segment);
+}
+
+void SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError(NSError* error)
+{
+#if LOG_DISABLED
+    UNUSED_PARAM(error);
+#endif
+    LOG(Media, &quot;SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError(%p) - error:\&quot;%s\&quot;&quot;, this, String([error description]).utf8().data());
+
+    m_parsingSucceeded = false;
+}
+
+struct ProcessCodedFrameInfo {
+    SourceBufferPrivateAVFObjC* sourceBuffer;
+    int trackID;
+    const String&amp; mediaType;
+};
+
+static OSStatus callProcessCodedFrameForEachSample(CMSampleBufferRef sampleBuffer, CMItemCount, void *refcon)
+{
+    ProcessCodedFrameInfo* info = static_cast&lt;ProcessCodedFrameInfo*&gt;(refcon);
+    return info-&gt;sourceBuffer-&gt;processCodedFrame(info-&gt;trackID, sampleBuffer, info-&gt;mediaType);
+}
+
+void SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID(int trackID, CMSampleBufferRef sampleBuffer, const String&amp; mediaType, unsigned flags)
+{
+    UNUSED_PARAM(flags);
+
+    ProcessCodedFrameInfo info = {this, trackID, mediaType};
+    CMSampleBufferCallForEachSample(sampleBuffer, &amp;callProcessCodedFrameForEachSample, &amp;info);
+}
+
+bool SourceBufferPrivateAVFObjC::processCodedFrame(int trackID, CMSampleBufferRef sampleBuffer, const String&amp;)
+{
+    if (m_client)
+        m_client-&gt;sourceBufferPrivateDidReceiveSample(this, MediaSampleAVFObjC::create(sampleBuffer, trackID));
+
+    return true;
+}
+
+void SourceBufferPrivateAVFObjC::didReachEndOfTrackWithTrackID(int trackID, const String&amp; mediaType)
+{
+    UNUSED_PARAM(mediaType);
+    UNUSED_PARAM(trackID);
+    notImplemented();
+}
+
+void SourceBufferPrivateAVFObjC::setClient(SourceBufferPrivateClient* client)
+{
+    m_client = client;
+}
+
+SourceBufferPrivate::AppendResult SourceBufferPrivateAVFObjC::append(const unsigned char* data, unsigned length)
+{
+    m_parsingSucceeded = true;
+
+    LOG(Media, &quot;SourceBufferPrivateAVFObjC::append(%p) - data:%p, length:%d&quot;, this, data, length);
+    [m_parser appendStreamData:[NSData dataWithBytes:data length:length]];
+
+    if (m_parsingSucceeded)
+        m_parent-&gt;player()-&gt;setLoadingProgresssed(true);
+
+    return m_parsingSucceeded ? AppendSucceeded : ParsingFailed;
+}
+
+void SourceBufferPrivateAVFObjC::abort()
+{
+    notImplemented();
+}
+
+void SourceBufferPrivateAVFObjC::removedFromMediaSource()
+{
+    if (m_displayLayer) {
+        m_parent-&gt;player()-&gt;removeDisplayLayer(m_displayLayer.get());
+        [m_displayLayer flush];
+        [m_displayLayer stopRequestingMediaData];
+        m_displayLayer = nullptr;
+    }
+
+    m_parent-&gt;removeSourceBuffer(this);
+}
+
+MediaPlayer::ReadyState SourceBufferPrivateAVFObjC::readyState() const
+{
+    return m_parent-&gt;player()-&gt;readyState();
+}
+
+void SourceBufferPrivateAVFObjC::setReadyState(MediaPlayer::ReadyState readyState)
+{
+    m_parent-&gt;player()-&gt;setReadyState(readyState);
+}
+
+void SourceBufferPrivateAVFObjC::evictCodedFrames()
+{
+    notImplemented();
+}
+
+bool SourceBufferPrivateAVFObjC::isFull()
+{
+    notImplemented();
+    return false;
+}
+
+
+bool SourceBufferPrivateAVFObjC::hasVideo() const
+{
+    if (!m_client)
+        return false;
+
+    return m_client-&gt;sourceBufferPrivateHasVideo(this);
+}
+
+bool SourceBufferPrivateAVFObjC::hasAudio() const
+{
+    if (!m_client)
+        return false;
+
+    return m_client-&gt;sourceBufferPrivateHasAudio(this);
+}
+
+void SourceBufferPrivateAVFObjC::trackDidChangeEnabled(VideoTrackPrivateMediaSourceAVFObjC* track)
+{
+    int trackID = track-&gt;trackID();
+    if (!track-&gt;selected() &amp;&amp; m_enabledVideoTrackID == trackID) {
+        m_enabledVideoTrackID = -1;
+        [m_parser setShouldProvideMediaData:NO forTrackID:trackID];
+    } else if (track-&gt;selected()) {
+        m_enabledVideoTrackID = trackID;
+        [m_parser setShouldProvideMediaData:YES forTrackID:trackID];
+        if (!m_displayLayer) {
+            m_displayLayer = [[getAVSampleBufferDisplayLayerClass() alloc] init];
+            [m_displayLayer requestMediaDataWhenReadyOnQueue:dispatch_get_main_queue() usingBlock:^{
+                if (m_client)
+                    m_client-&gt;sourceBufferPrivateDidBecomeReadyForMoreSamples(this);
+            }];
+            m_parent-&gt;player()-&gt;addDisplayLayer(m_displayLayer.get());
+        }
+    }
+}
+
+void SourceBufferPrivateAVFObjC::trackDidChangeEnabled(AudioTrackPrivateMediaSourceAVFObjC*)
+{
+    // No-op.
+}
+
+static RetainPtr&lt;CMSampleBufferRef&gt; createNonDisplayingCopy(CMSampleBufferRef sampleBuffer)
+{
+    CMSampleBufferRef newSampleBuffer = 0;
+    CMSampleBufferCreateCopy(kCFAllocatorDefault, sampleBuffer, &amp;newSampleBuffer);
+    if (!newSampleBuffer)
+        return sampleBuffer;
+
+    CFArrayRef attachmentsArray = CMSampleBufferGetSampleAttachmentsArray(newSampleBuffer, true);
+    for (CFIndex i = 0; i &lt; CFArrayGetCount(attachmentsArray); ++i) {
+        CFMutableDictionaryRef attachments = (CFMutableDictionaryRef)CFArrayGetValueAtIndex(attachmentsArray, i);
+        CFDictionarySetValue(attachments, kCMSampleAttachmentKey_DoNotDisplay, kCFBooleanTrue);
+    }
+
+    return adoptCF(newSampleBuffer);
+}
+
+void SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples(Vector&lt;RefPtr&lt;MediaSample&gt;&gt; mediaSamples, AtomicString trackID)
+{
+    if (trackID.toInt() != m_enabledVideoTrackID)
+        return;
+
+    LOG(Media, &quot;SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples(%p) samples: %d samples, trackId: %d&quot;, this, mediaSamples.size(), trackID.toInt());
+
+    [m_displayLayer flush];
+
+    for (auto it = mediaSamples.begin(), end = mediaSamples.end(); it != end; ++it) {
+        RefPtr&lt;MediaSample&gt;&amp; mediaSample = *it;
+
+        PlatformSample platformSample = mediaSample-&gt;platformSample();
+        ASSERT(platformSample.type == PlatformSample::CMSampleBufferType);
+
+        RetainPtr&lt;CMSampleBufferRef&gt; sampleBuffer = createNonDisplayingCopy(platformSample.sample.cmSampleBuffer);
+
+        [m_displayLayer enqueueSampleBuffer:sampleBuffer.get()];
+    }
+
+    m_parent-&gt;player()-&gt;setHasAvailableVideoFrame(false);
+}
+
+void SourceBufferPrivateAVFObjC::enqueueSample(PassRefPtr&lt;MediaSample&gt; prpMediaSample, AtomicString trackID)
+{
+    if (trackID.toInt() != m_enabledVideoTrackID)
+        return;
+
+    RefPtr&lt;MediaSample&gt; mediaSample = prpMediaSample;
+
+    PlatformSample platformSample = mediaSample-&gt;platformSample();
+    if (platformSample.type != PlatformSample::CMSampleBufferType)
+        return;
+
+    [m_displayLayer enqueueSampleBuffer:platformSample.sample.cmSampleBuffer];
+    m_parent-&gt;player()-&gt;setHasAvailableVideoFrame(true);
+}
+
+bool SourceBufferPrivateAVFObjC::isReadyForMoreSamples()
+{
+    return [m_displayLayer isReadyForMoreMediaData];
+}
+
+void SourceBufferPrivateAVFObjC::setActive(bool isActive)
+{
+    m_parent-&gt;sourceBufferPrivateDidChangeActiveState(this, isActive);
+}
+
+MediaTime SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime(MediaTime time, MediaTime negativeThreshold, MediaTime positiveThreshold)
+{
+    if (m_client)
+        return m_client-&gt;sourceBufferPrivateFastSeekTimeForMediaTime(this, time, negativeThreshold, positiveThreshold);
+    return time;
+}
+
+void SourceBufferPrivateAVFObjC::seekToTime(MediaTime time)
+{
+    if (m_client)
+        m_client-&gt;sourceBufferPrivateSeekToTime(this, time);
+}
+
+}
+
+#endif // ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcVideoTrackPrivateMediaSourceAVFObjCcppfromrev160250trunkSourceWebCoreplatformMediaSampleh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.cpp (from rev 160250, trunk/Source/WebCore/platform/MediaSample.h) (0 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.cpp        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;VideoTrackPrivateMediaSourceAVFObjC.h&quot;
+
+#if ENABLE(MEDIA_SOURCE) &amp;&amp; ENABLE(VIDEO_TRACK)
+
+#include &quot;AVTrackPrivateAVFObjCImpl.h&quot;
+#include &quot;SourceBufferPrivateAVFObjC.h&quot;
+
+namespace WebCore {
+
+VideoTrackPrivateMediaSourceAVFObjC::VideoTrackPrivateMediaSourceAVFObjC(AVAssetTrack* track, SourceBufferPrivateAVFObjC* parent)
+    : m_impl(std::make_unique&lt;AVTrackPrivateAVFObjCImpl&gt;(track))
+    , m_parent(parent)
+    , m_trackID(-1)
+    , m_selected(false)
+{
+    resetPropertiesFromTrack();
+}
+
+void VideoTrackPrivateMediaSourceAVFObjC::resetPropertiesFromTrack()
+{
+    m_trackID = m_impl-&gt;trackID();
+
+    setKind(m_impl-&gt;videoKind());
+    setId(m_impl-&gt;id());
+    setLabel(m_impl-&gt;label());
+    setLanguage(m_impl-&gt;language());
+}
+
+void VideoTrackPrivateMediaSourceAVFObjC::setAssetTrack(AVAssetTrack *track)
+{
+    m_impl = std::make_unique&lt;AVTrackPrivateAVFObjCImpl&gt;(track);
+    resetPropertiesFromTrack();
+}
+
+AVAssetTrack* VideoTrackPrivateMediaSourceAVFObjC::assetTrack()
+{
+    return m_impl-&gt;assetTrack();
+}
+
+
+bool VideoTrackPrivateMediaSourceAVFObjC::selected() const
+{
+    return m_selected;
+}
+
+void VideoTrackPrivateMediaSourceAVFObjC::setSelected(bool selected)
+{
+    if (m_selected == selected)
+        return;
+
+    m_selected = selected;
+    m_parent-&gt;trackDidChangeEnabled(this);
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcVideoTrackPrivateMediaSourceAVFObjChfromrev160250trunkSourceWebCoreplatformMediaSampleh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h (from rev 160250, trunk/Source/WebCore/platform/MediaSample.h) (0 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef VideoTrackPrivateMediaSourceAVFObjC_h
+#define VideoTrackPrivateMediaSourceAVFObjC_h
+
+#include &quot;VideoTrackPrivateAVF.h&quot;
+
+#if ENABLE(MEDIA_SOURCE) &amp;&amp; ENABLE(VIDEO_TRACK)
+
+OBJC_CLASS AVAssetTrack;
+OBJC_CLASS AVPlayerItemTrack;
+
+namespace WebCore {
+
+class AVTrackPrivateAVFObjCImpl;
+class SourceBufferPrivateAVFObjC;
+
+class VideoTrackPrivateMediaSourceAVFObjC FINAL : public VideoTrackPrivateAVF {
+    WTF_MAKE_NONCOPYABLE(VideoTrackPrivateMediaSourceAVFObjC)
+public:
+    static RefPtr&lt;VideoTrackPrivateMediaSourceAVFObjC&gt; create(AVAssetTrack* track, SourceBufferPrivateAVFObjC* parent)
+    {
+        return adoptRef(new VideoTrackPrivateMediaSourceAVFObjC(track, parent));
+    }
+
+    virtual bool selected() const OVERRIDE;
+    virtual void setSelected(bool) OVERRIDE;
+
+    void setAssetTrack(AVAssetTrack*);
+    AVAssetTrack* assetTrack();
+
+    int trackID() { return m_trackID; }
+
+private:
+    explicit VideoTrackPrivateMediaSourceAVFObjC(AVAssetTrack*, SourceBufferPrivateAVFObjC* parent);
+    
+    void resetPropertiesFromTrack();
+
+    std::unique_ptr&lt;AVTrackPrivateAVFObjCImpl&gt; m_impl;
+    SourceBufferPrivateAVFObjC* m_parent;
+    int m_trackID;
+    bool m_selected;
+};
+
+}
+
+#endif // ENABLE(MEDIA_SOURCE) &amp;&amp; ENABLE(VIDEO_TRACK)
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacPlatformClockCMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PlatformClockCM.h (160250 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PlatformClockCM.h        2013-12-06 22:31:39 UTC (rev 160250)
+++ trunk/Source/WebCore/platform/mac/PlatformClockCM.h        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -55,6 +55,8 @@
</span><span class="cx">     virtual void stop() OVERRIDE;
</span><span class="cx">     virtual bool isRunning() const OVERRIDE { return m_running; }
</span><span class="cx"> 
</span><ins>+    CMTimebaseRef timebase() const { return m_timebase.get(); }
+
</ins><span class="cx"> private:
</span><span class="cx">     void initializeWithTimingSource(CMClockRef);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacSoftLinkingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/SoftLinking.h (160250 => 160251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/SoftLinking.h        2013-12-06 22:31:39 UTC (rev 160250)
+++ trunk/Source/WebCore/platform/mac/SoftLinking.h        2013-12-06 22:43:46 UTC (rev 160251)
</span><span class="lines">@@ -118,6 +118,24 @@
</span><span class="cx">         return class##className; \
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#define SOFT_LINK_CLASS_OPTIONAL(framework, className) \
+    static Class init##className(); \
+    static Class (*get##className##Class)() = init##className; \
+    static Class class##className; \
+    \
+    static Class className##Function() \
+    { \
+        return class##className; \
+    }\
+    \
+    static Class init##className() \
+    { \
+        framework##Library(); \
+        class##className = objc_getClass(#className); \
+        get##className##Class = className##Function; \
+        return class##className; \
+    }
+
</ins><span class="cx"> #define SOFT_LINK_POINTER(framework, name, type) \
</span><span class="cx">     static type init##name(); \
</span><span class="cx">     static type (*get##name)() = init##name; \
</span></span></pre>
</div>
</div>

</body>
</html>