Changeset 244716 in webkit


Ignore:
Timestamp:
Apr 26, 2019 10:38:40 PM (5 years ago)
Author:
jer.noble@apple.com
Message:

Reduce the number of copies made during SourceBufferPrivateAVFObjC::append() using SharedBuffer
https://bugs.webkit.org/show_bug.cgi?id=197335
<rdar://problem/49175604>

Rubber-stamped by Alex Christensen.

  • platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:

(WebCore::SourceBufferPrivateAVFObjC::append):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r244714 r244716  
     12019-04-26  Jer Noble  <jer.noble@apple.com>
     2
     3        Reduce the number of copies made during SourceBufferPrivateAVFObjC::append() using SharedBuffer
     4        https://bugs.webkit.org/show_bug.cgi?id=197335
     5        <rdar://problem/49175604>
     6
     7        Rubber-stamped by Alex Christensen.
     8
     9        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
     10        (WebCore::SourceBufferPrivateAVFObjC::append):
     11
    1122019-04-26  Jessie Berlin  <jberlin@webkit.org>
    213
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm

    r244704 r244716  
    707707    DEBUG_LOG(LOGIDENTIFIER, "data length = ", data.size());
    708708
    709     // FIXME: Avoid the data copy by wrapping around the Vector<> object.
    710     RetainPtr<NSData> nsData = adoptNS([[NSData alloc] initWithBytes:data.data() length:data.size()]);
    711     WeakPtr<SourceBufferPrivateAVFObjC> weakThis = m_appendWeakFactory.createWeakPtr(*this);
    712     RetainPtr<AVStreamDataParser> parser = m_parser;
    713     RetainPtr<WebAVStreamDataParserListener> delegate = m_delegate;
    714 
    715709    m_parsingSucceeded = true;
    716710    dispatch_group_enter(m_isAppendingGroup.get());
    717711
    718     dispatch_async(globalDataParserQueue(), [nsData, weakThis, parser, delegate, isAppendingGroup = m_isAppendingGroup, parserStateWasReset = m_parserStateWasReset] {
     712    dispatch_async(globalDataParserQueue(), [data = WTFMove(data), weakThis = m_appendWeakFactory.createWeakPtr(*this), parser = m_parser, delegate = m_delegate, isAppendingGroup = m_isAppendingGroup, parserStateWasReset = m_parserStateWasReset] () mutable {
     713        auto sharedData = SharedBuffer::create(WTFMove(data));
     714        auto nsData = sharedData->createNSData();
    719715        if (parserStateWasReset)
    720716            [parser appendStreamData:nsData.get() withFlags:AVStreamDataParserStreamDataDiscontinuity];
Note: See TracChangeset for help on using the changeset viewer.