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

Changeset 176594 in webkit


Ignore:
Timestamp:
Dec 1, 2014, 11:01:50 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[MSE] Unset timestamps of trackbuffers during Reset Parser State algorithm.
https://bugs.webkit.org/show_bug.cgi?id=139075.

Patch by Bartlomiej Gajda <b.gajda@samsung.com> on 2014-12-01
Reviewed by Jer Noble.

Source/WebCore:

Specification requires from us to unset timestamps for trackBuffers
during abort() method.

Test: media/media-source/media-source-append-nonsync-sample-after-abort.html

  • Modules/mediasource/SourceBuffer.cpp:

(WebCore::SourceBuffer::resetParserState):
(WebCore::SourceBuffer::abort):

  • Modules/mediasource/SourceBuffer.h:

LayoutTests:

Specification requires from us to unset timestamps for trackBuffers during abort() method.
Tests appendBuffer() with first sync sample, then aborts after a few more samples, and emits
a few more non-sync samples, so they should be dropped, as trackBuffer will have
needRandomAccessFlag set.

  • media/media-source/media-source-append-nonsync-sample-after-abort-expected.txt: Added.
  • media/media-source/media-source-append-nonsync-sample-after-abort.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r176556 r176594  
     12014-12-01  Bartlomiej Gajda  <b.gajda@samsung.com>
     2
     3        [MSE] Unset timestamps of trackbuffers during Reset Parser State algorithm.
     4        https://bugs.webkit.org/show_bug.cgi?id=139075.
     5
     6        Reviewed by Jer Noble.
     7
     8        Specification requires from us to unset timestamps for trackBuffers during abort() method.
     9        Tests appendBuffer() with first sync sample, then aborts after a few more samples, and emits
     10        a few more non-sync samples, so they should be dropped, as trackBuffer will have
     11        needRandomAccessFlag set.
     12
     13        * media/media-source/media-source-append-nonsync-sample-after-abort-expected.txt: Added.
     14        * media/media-source/media-source-append-nonsync-sample-after-abort.html: Added.
     15
    1162014-11-28  Andrzej Badowski  <a.badowski@samsung.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r176593 r176594  
     12014-12-01  Bartlomiej Gajda  <b.gajda@samsung.com>
     2
     3        [MSE] Unset timestamps of trackbuffers during Reset Parser State algorithm.
     4        https://bugs.webkit.org/show_bug.cgi?id=139075.
     5
     6        Reviewed by Jer Noble.
     7
     8        Specification requires from us to unset timestamps for trackBuffers
     9        during abort() method.
     10
     11        Test: media/media-source/media-source-append-nonsync-sample-after-abort.html
     12
     13        * Modules/mediasource/SourceBuffer.cpp:
     14        (WebCore::SourceBuffer::resetParserState):
     15        (WebCore::SourceBuffer::abort):
     16        * Modules/mediasource/SourceBuffer.h:
     17
    1182014-12-01  Chris Dumez  <cdumez@apple.com>
    219
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp

    r176459 r176594  
    218218}
    219219
     220void SourceBuffer::resetParserState()
     221{
     222    // Section 3.5.2 Reset Parser State algorithm steps.
     223    // http://www.w3.org/TR/2014/CR-media-source-20140717/#sourcebuffer-reset-parser-state
     224    // 1. If the append state equals PARSING_MEDIA_SEGMENT and the input buffer contains some complete coded frames,
     225    //    then run the coded frame processing algorithm until all of these complete coded frames have been processed.
     226    // FIXME: If any implementation will work in pulling mode (instead of async push to SourceBufferPrivate, and forget)
     227    //     this should be handled somehow either here, or in m_private->abort();
     228
     229    // 2. Unset the last decode timestamp on all track buffers.
     230    // 3. Unset the last frame duration on all track buffers.
     231    // 4. Unset the highest presentation timestamp on all track buffers.
     232    // 5. Set the need random access point flag on all track buffers to true.
     233    for (auto& trackBufferPair : m_trackBufferMap.values()) {
     234        trackBufferPair.lastDecodeTimestamp = MediaTime::invalidTime();
     235        trackBufferPair.lastFrameDuration = MediaTime::invalidTime();
     236        trackBufferPair.highestPresentationTimestamp = MediaTime::invalidTime();
     237        trackBufferPair.needRandomAccessFlag = true;
     238    }
     239    // 6. Remove all bytes from the input buffer.
     240    // Note: this is handled by abortIfUpdating()
     241    // 7. Set append state to WAITING_FOR_SEGMENT.
     242    m_appendState = WaitingForSegment;
     243
     244    m_private->abort();
     245}
     246
    220247void SourceBuffer::abort(ExceptionCode& ec)
    221248{
     
    235262
    236263    // 4. Run the reset parser state algorithm.
    237     m_private->abort();
     264    resetParserState();
    238265
    239266    // FIXME(229408) Add steps 5-6 update appendWindowStart & appendWindowEnd.
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h

    r176459 r176594  
    154154    void appendBufferInternal(unsigned char*, unsigned, ExceptionCode&);
    155155    void appendBufferTimerFired();
     156    void resetParserState();
    156157
    157158    void setActive(bool);
Note: See TracChangeset for help on using the changeset viewer.