⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 169099 in webkit


Ignore:
Timestamp:
May 19, 2014, 7:56:33 PM (12 years ago)
Author:
matthew_hanson@apple.com
Message:

Rollout r169074.

Location:
branches/safari-538.34-branch/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-538.34-branch/Source/WebCore/ChangeLog

    r169076 r169099  
     12014-05-19  Matthew Hanson  <matthew_hanson@apple.com>
     2
     3        Rollout r169074.
     4
    152014-05-19  Matthew Hanson  <matthew_hanson@apple.com>
    26
  • branches/safari-538.34-branch/Source/WebCore/Modules/mediasource/SourceBuffer.cpp

    r169074 r169099  
    108108    , m_removeTimer(this, &SourceBuffer::removeTimerFired)
    109109{
     110    ASSERT(m_private);
    110111    ASSERT(m_source);
    111112
    … …  
    474475    // 1. Loop Top: If the input buffer is empty, then jump to the need more data step below.
    475476    if (!m_pendingAppendData.size()) {
    476         sourceBufferPrivateAppendComplete(&m_private.get(), AppendSucceeded);
     477        sourceBufferPrivateAppendComplete(m_private.get(), AppendSucceeded);
    477478        return;
    478479    }
  • branches/safari-538.34-branch/Source/WebCore/Modules/mediasource/SourceBuffer.h

    r169074 r169099  
    157157    void removeCodedFrames(const MediaTime& start, const MediaTime& end);
    158158
    159     Ref<SourceBufferPrivate> m_private;
     159    RefPtr<SourceBufferPrivate> m_private;
    160160    MediaSource* m_source;
    161161    GenericEventQueue m_asyncEventQueue;
  • branches/safari-538.34-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm

    r169075 r169099  
    8686
    8787    pos = m_sourceBuffers.find(buffer);
    88     m_sourceBuffers[pos]->clearMediaSource();
    8988    m_sourceBuffers.remove(pos);
    9089}
    … …  
    159158#endif
    160159
    161 static bool MediaSourcePrivateAVFObjCHasAudio(SourceBufferPrivateAVFObjC* sourceBuffer)
    162 {
     160static bool MediaSourcePrivateAVFObjCHasAudio(PassRefPtr<SourceBufferPrivateAVFObjC> prpSourceBuffer)
     161{
     162    RefPtr<SourceBufferPrivateAVFObjC> sourceBuffer = prpSourceBuffer;
    163163    return sourceBuffer->hasAudio();
    164164}
    … …  
    169169}
    170170
    171 static bool MediaSourcePrivateAVFObjCHasVideo(SourceBufferPrivateAVFObjC* sourceBuffer)
    172 {
     171static bool MediaSourcePrivateAVFObjCHasVideo(PassRefPtr<SourceBufferPrivateAVFObjC> prpSourceBuffer)
     172{
     173    RefPtr<SourceBufferPrivateAVFObjC> sourceBuffer = prpSourceBuffer;
    173174    return sourceBuffer->hasVideo();
    174175}
  • branches/safari-538.34-branch/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h

    r169074 r169099  
    3737#include <wtf/RetainPtr.h>
    3838#include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
    4039#include <wtf/text/AtomicString.h>
    4140
    … …  
    115114    void destroyRenderers();
    116115
    117     WeakPtr<SourceBufferPrivateAVFObjC> createWeakPtr() { return m_weakFactory.createWeakPtr(); }
    118 
    119116    Vector<RefPtr<VideoTrackPrivateMediaSourceAVFObjC>> m_videoTracks;
    120117    Vector<RefPtr<AudioTrackPrivateMediaSourceAVFObjC>> m_audioTracks;
    121 
    122     WeakPtrFactory<SourceBufferPrivateAVFObjC> m_weakFactory;
    123118
    124119    RetainPtr<AVStreamDataParser> m_parser;
  • branches/safari-538.34-branch/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm

    r169074 r169099  
    154154
    155155@interface WebAVStreamDataParserListener : NSObject {
    156     WeakPtr<WebCore::SourceBufferPrivateAVFObjC> _parent;
     156    WebCore::SourceBufferPrivateAVFObjC* _parent;
    157157    AVStreamDataParser* _parser;
    158158}
    159 - (id)initWithParser:(AVStreamDataParser*)parser parent:(WeakPtr<WebCore::SourceBufferPrivateAVFObjC>)parent;
     159- (id)initWithParser:(AVStreamDataParser*)parser parent:(WebCore::SourceBufferPrivateAVFObjC*)parent;
    160160@end
    161161
    162162@implementation WebAVStreamDataParserListener
    163 - (id)initWithParser:(AVStreamDataParser*)parser parent:(WeakPtr<WebCore::SourceBufferPrivateAVFObjC>)parent
     163- (id)initWithParser:(AVStreamDataParser*)parser parent:(WebCore::SourceBufferPrivateAVFObjC*)parent
    164164{
    165165    self = [super init];
    … …  
    183183{
    184184    [_parser setDelegate:nil];
     185    _parent = nullptr;
    185186    _parser = nullptr;
    186187}
    … …  
    192193#endif
    193194    ASSERT(streamDataParser == _parser);
    194     RetainPtr<WebAVStreamDataParserListener> strongSelf = self;
     195    RefPtr<WebCore::SourceBufferPrivateAVFObjC> strongParent = _parent;
     196    if (!strongParent)
     197        return;
    195198
    196199    RetainPtr<AVAsset*> strongAsset = asset;
    197     callOnMainThread([strongSelf, strongAsset] {
    198         if (strongSelf->_parent)
    199             strongSelf->_parent->didParseStreamDataAsAsset(strongAsset.get());
     200    callOnMainThread([strongParent, strongAsset] {
     201        strongParent->didParseStreamDataAsAsset(strongAsset.get());
    200202    });
    201203}
    … …  
    208210#endif
    209211    ASSERT(streamDataParser == _parser);
    210     RetainPtr<WebAVStreamDataParserListener> strongSelf = self;
     212    RefPtr<WebCore::SourceBufferPrivateAVFObjC> strongParent = _parent;
     213    if (!strongParent)
     214        return;
    211215
    212216    RetainPtr<AVAsset*> strongAsset = asset;
    213     callOnMainThread([strongSelf, strongAsset] {
    214         if (strongSelf->_parent)
    215             strongSelf->_parent->didParseStreamDataAsAsset(strongAsset.get());
     217    callOnMainThread([strongParent, strongAsset] {
     218        strongParent->didParseStreamDataAsAsset(strongAsset.get());
    216219    });
    217220}
    … …  
    223226#endif
    224227    ASSERT(streamDataParser == _parser);
    225     RetainPtr<WebAVStreamDataParserListener> strongSelf = self;
     228    RefPtr<WebCore::SourceBufferPrivateAVFObjC> strongParent = _parent;
     229    if (!strongParent)
     230        return;
    226231
    227232    RetainPtr<NSError> strongError = error;
    228     callOnMainThread([strongSelf, strongError] {
    229         if (strongSelf->_parent)
    230             strongSelf->_parent->didFailToParseStreamDataWithError(strongError.get());
     233    callOnMainThread([strongParent, strongError] {
     234        strongParent->didFailToParseStreamDataWithError(strongError.get());
    231235    });
    232236}
    … …  
    238242#endif
    239243    ASSERT(streamDataParser == _parser);
    240     RetainPtr<WebAVStreamDataParserListener> strongSelf = self;
     244    RefPtr<WebCore::SourceBufferPrivateAVFObjC> strongParent = _parent;
     245    if (!strongParent)
     246        return;
    241247
    242248    RetainPtr<CMSampleBufferRef> strongSample = sample;
    243249    String mediaType = nsMediaType;
    244     callOnMainThread([strongSelf, strongSample, trackID, mediaType, flags] {
    245         if (strongSelf->_parent)
    246             strongSelf->_parent->didProvideMediaDataForTrackID(trackID, strongSample.get(), mediaType, flags);
     250    callOnMainThread([strongParent, strongSample, trackID, mediaType, flags] {
     251        strongParent->didProvideMediaDataForTrackID(trackID, strongSample.get(), mediaType, flags);
    247252    });
    248253}
    … …  
    254259#endif
    255260    ASSERT(streamDataParser == _parser);
    256     RetainPtr<WebAVStreamDataParserListener> strongSelf = self;
     261    RefPtr<WebCore::SourceBufferPrivateAVFObjC> strongParent = _parent;
     262    if (!strongParent)
     263        return;
    257264
    258265    String mediaType = nsMediaType;
    259     callOnMainThread([strongSelf, trackID, mediaType] {
    260         if (strongSelf->_parent)
    261             strongSelf->_parent->didReachEndOfTrackWithTrackID(trackID, mediaType);
     266    callOnMainThread([strongParent, trackID, mediaType] {
     267        strongParent->didReachEndOfTrackWithTrackID(trackID, mediaType);
    262268    });
    263269}
    … …  
    269275#endif
    270276    ASSERT(streamDataParser == _parser);
    271     RetainPtr<WebAVStreamDataParserListener> strongSelf = self;
     277    RefPtr<WebCore::SourceBufferPrivateAVFObjC> strongParent = _parent;
     278    if (!strongParent)
     279        return;
    272280
    273281    RetainPtr<NSData> strongData = initData;
    274     callOnMainThread([strongSelf, strongData, trackID] {
    275         if (strongSelf->_parent)
    276             strongSelf->_parent->didProvideContentKeyRequestInitializationDataForTrackID(strongData.get(), trackID);
     282    callOnMainThread([strongParent, strongData, trackID] {
     283        strongParent->didProvideContentKeyRequestInitializationDataForTrackID(strongData.get(), trackID);
    277284    });
    278285}
    … …  
    380387
    381388SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC(MediaSourcePrivateAVFObjC* parent)
    382     : m_weakFactory(this)
    383     , m_parser(adoptNS([[getAVStreamDataParserClass() alloc] init]))
    384     , m_delegate(adoptNS([[WebAVStreamDataParserListener alloc] initWithParser:m_parser.get() parent:createWeakPtr()]))
     389    : m_parser(adoptNS([[getAVStreamDataParserClass() alloc] init]))
     390    , m_delegate(adoptNS([[WebAVStreamDataParserListener alloc] initWithParser:m_parser.get() parent:this]))
    385391    , m_mediaSource(parent)
    386392    , m_client(0)
    … …  
    393399SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC()
    394400{
    395     ASSERT(!m_client);
    396401    destroyParser();
    397402    destroyRenderers();
    … …  
    465470            LOG(Media, "SourceBufferPrivateAVFObjC::processCodedFrame(%p) - size change detected: {width=%lf, height=%lf", formatSize.width(), formatSize.height());
    466471            m_cachedSize = formatSize;
    467             if (m_mediaSource)
    468                 m_mediaSource->player()->sizeChanged();
     472            m_mediaSource->player()->sizeChanged();
    469473        }
    470474    }
    … …  
    484488void SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID(NSData* initData, int trackID)
    485489{
    486     if (!m_mediaSource)
    487         return;
    488 
    489490    UNUSED_PARAM(trackID);
    490491#if ENABLE(ENCRYPTED_MEDIA_V2)
    … …  
    519520
    520521    RetainPtr<NSData> nsData = adoptNS([[NSData alloc] initWithBytes:data length:length]);
    521     WeakPtr<SourceBufferPrivateAVFObjC> weakThis = createWeakPtr();
    522     RetainPtr<AVStreamDataParser> parser = m_parser;
    523     RetainPtr<WebAVStreamDataParserListener> delegate = m_delegate;
     522    RefPtr<SourceBufferPrivateAVFObjC> strongThis = this;
    524523
    525524    m_parsingSucceeded = true;
    526525
    527     dispatch_async(globalDataParserQueue(), [nsData, weakThis, parser, delegate] {
    528 
    529         [parser appendStreamData:nsData.get()];
    530 
    531         callOnMainThread([weakThis] {
    532             if (weakThis)
    533                 weakThis->appendCompleted();
     526    dispatch_async(globalDataParserQueue(), [nsData, strongThis] {
     527        [strongThis->m_parser appendStreamData:nsData.get()];
     528
     529        callOnMainThread([strongThis] {
     530            strongThis->appendCompleted();
    534531        });
    535532    });
Note: See TracChangeset for help on using the changeset viewer.