[MSE][Mac] Add AVSampleBufferAudioRenderer support.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Dec 2013 01:14:26 +0000 (01:14 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Dec 2013 01:14:26 +0000 (01:14 +0000)
commit11f0927b0023848f8ef4f0e42b123664ad9ba865
treef0b032b75f1db94904a169970a86a9988c0e8e24
parentd3738b17941368d8abf0ab5cc797875af6cd57bd
[MSE][Mac] Add AVSampleBufferAudioRenderer support.
https://bugs.webkit.org/show_bug.cgi?id=125905

Reviewed by Eric Carlson.

On platforms which support AVSampleBufferAudioRenderer, add support
for playback of audio CMSampleBufferRefs generated by AVStreamDataParser.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable): Require AVSampleBufferAudioRenderer.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume): Pass through to every audio renderer.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): Slave the renderer's
    timebase to the master clock.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): Drive by fix; initialize
    m_enabledVideoTrackID.
(WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): Call destroyRenderers().
(WebCore::callProcessCodedFrameForEachSample): Drive by fix; convert the bool return to an OSErr.
(WebCore::SourceBufferPrivateAVFObjC::destroyRenderers): Added; flush and destroy the audio
    renderers.
(WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource): Call destroyRenderers().
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): Enable or disable the audio
    renderer in response.
(WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples): Added audio
    specific version.
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm