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

Changeset 269795 in webkit


Ignore:
Timestamp:
Nov 13, 2020, 2:16:45 PM (6 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r269121. rdar://problem/71381839

[MSE] Handle trackId changing across Initialization Segments
https://bugs.webkit.org/show_bug.cgi?id=218294
<rdar://problem/70771306>

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-source/media-source-trackid-change.html

When appending an initialization segment after the receivedFirstInitializationSegment flag is
true, and when the number of video or audio tracks is 1, the trackId is allowed to change across
initialiaztion segments. When this occurs, move the TrackBuffer inside the trackBufferMap to
refer to the new trackId, so that when MediaSamples are parsed, they're put into the correct
TrackBuffer.

  • Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
  • html/track/AudioTrack.cpp: (WebCore::AudioTrack::setPrivate):
  • html/track/InbandTextTrack.cpp: (WebCore::InbandTextTrack::setPrivate):
  • html/track/VideoTrack.cpp: (WebCore::VideoTrack::setPrivate):

LayoutTests:

  • media/media-source/media-source-trackid-change-expected.txt: Added.
  • media/media-source/media-source-trackid-change.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269121 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-610-branch
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-610-branch/LayoutTests/ChangeLog

    r269389 r269795  
     12020-11-13  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r269121. rdar://problem/71381839
     4
     5    [MSE] Handle trackId changing across Initialization Segments
     6    https://bugs.webkit.org/show_bug.cgi?id=218294
     7    <rdar://problem/70771306>
     8   
     9    Reviewed by Eric Carlson.
     10   
     11    Source/WebCore:
     12   
     13    Test: media/media-source/media-source-trackid-change.html
     14   
     15    When appending an initialization segment after the receivedFirstInitializationSegment flag is
     16    true, and when the number of video or audio tracks is 1, the trackId is allowed to change across
     17    initialiaztion segments. When this occurs, move the TrackBuffer inside the trackBufferMap to
     18    refer to the new trackId, so that when MediaSamples are parsed, they're put into the correct
     19    TrackBuffer.
     20   
     21    * Modules/mediasource/SourceBuffer.cpp:
     22    (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
     23    * html/track/AudioTrack.cpp:
     24    (WebCore::AudioTrack::setPrivate):
     25    * html/track/InbandTextTrack.cpp:
     26    (WebCore::InbandTextTrack::setPrivate):
     27    * html/track/VideoTrack.cpp:
     28    (WebCore::VideoTrack::setPrivate):
     29   
     30    LayoutTests:
     31   
     32    * media/media-source/media-source-trackid-change-expected.txt: Added.
     33    * media/media-source/media-source-trackid-change.html: Added.
     34   
     35   
     36    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     37
     38    2020-10-28  Jer Noble  <jer.noble@apple.com>
     39
     40            [MSE] Handle trackId changing across Initialization Segments
     41            https://bugs.webkit.org/show_bug.cgi?id=218294
     42            <rdar://problem/70771306>
     43
     44            Reviewed by Eric Carlson.
     45
     46            * media/media-source/media-source-trackid-change-expected.txt: Added.
     47            * media/media-source/media-source-trackid-change.html: Added.
     48
    1492020-11-04  Alan Coon  <alancoon@apple.com>
    250
  • branches/safari-610-branch/Source/WebCore/ChangeLog

    r269794 r269795  
     12020-11-13  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r269121. rdar://problem/71381839
     4
     5    [MSE] Handle trackId changing across Initialization Segments
     6    https://bugs.webkit.org/show_bug.cgi?id=218294
     7    <rdar://problem/70771306>
     8   
     9    Reviewed by Eric Carlson.
     10   
     11    Source/WebCore:
     12   
     13    Test: media/media-source/media-source-trackid-change.html
     14   
     15    When appending an initialization segment after the receivedFirstInitializationSegment flag is
     16    true, and when the number of video or audio tracks is 1, the trackId is allowed to change across
     17    initialiaztion segments. When this occurs, move the TrackBuffer inside the trackBufferMap to
     18    refer to the new trackId, so that when MediaSamples are parsed, they're put into the correct
     19    TrackBuffer.
     20   
     21    * Modules/mediasource/SourceBuffer.cpp:
     22    (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
     23    * html/track/AudioTrack.cpp:
     24    (WebCore::AudioTrack::setPrivate):
     25    * html/track/InbandTextTrack.cpp:
     26    (WebCore::InbandTextTrack::setPrivate):
     27    * html/track/VideoTrack.cpp:
     28    (WebCore::VideoTrack::setPrivate):
     29   
     30    LayoutTests:
     31   
     32    * media/media-source/media-source-trackid-change-expected.txt: Added.
     33    * media/media-source/media-source-trackid-change.html: Added.
     34   
     35   
     36    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     37
     38    2020-10-28  Jer Noble  <jer.noble@apple.com>
     39
     40            [MSE] Handle trackId changing across Initialization Segments
     41            https://bugs.webkit.org/show_bug.cgi?id=218294
     42            <rdar://problem/70771306>
     43
     44            Reviewed by Eric Carlson.
     45
     46            Test: media/media-source/media-source-trackid-change.html
     47
     48            When appending an initialization segment after the receivedFirstInitializationSegment flag is
     49            true, and when the number of video or audio tracks is 1, the trackId is allowed to change across
     50            initialiaztion segments. When this occurs, move the TrackBuffer inside the trackBufferMap to
     51            refer to the new trackId, so that when MediaSamples are parsed, they're put into the correct
     52            TrackBuffer.
     53
     54            * Modules/mediasource/SourceBuffer.cpp:
     55            (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
     56            * html/track/AudioTrack.cpp:
     57            (WebCore::AudioTrack::setPrivate):
     58            * html/track/InbandTextTrack.cpp:
     59            (WebCore::InbandTextTrack::setPrivate):
     60            * html/track/VideoTrack.cpp:
     61            (WebCore::VideoTrack::setPrivate):
     62
    1632020-11-13  Russell Epstein  <repstein@apple.com>
    264
  • branches/safari-610-branch/Source/WebCore/Modules/mediasource/SourceBuffer.cpp

    r260078 r269795  
    11121112            return;
    11131113        }
     1114
     1115        Vector<std::pair<AtomString, TrackBuffer>> newTrackBuffers;
     1116
    11141117        // 3.2 Add the appropriate track descriptions from this initialization segment to each of the track buffers.
    11151118        ASSERT(segment.audioTracks.size() == audioTracks().length());
    11161119        for (auto& audioTrackInfo : segment.audioTracks) {
    11171120            if (audioTracks().length() == 1) {
    1118                 audioTracks().item(0)->setPrivate(*audioTrackInfo.track);
     1121                auto* track = audioTracks().item(0);
     1122                auto oldId = track->id();
     1123                auto newId = audioTrackInfo.track->id();
     1124                track->setPrivate(*audioTrackInfo.track);
     1125                if (newId != oldId) {
     1126                    auto trackBuffer = m_trackBufferMap.take(oldId);
     1127                    newTrackBuffers.append(std::make_pair(newId, WTFMove(trackBuffer)));
     1128                }
    11191129                break;
    11201130            }
     
    11281138        for (auto& videoTrackInfo : segment.videoTracks) {
    11291139            if (videoTracks().length() == 1) {
    1130                 videoTracks().item(0)->setPrivate(*videoTrackInfo.track);
     1140                auto* track = videoTracks().item(0);
     1141                auto oldId = track->id();
     1142                auto newId = videoTrackInfo.track->id();
     1143                track->setPrivate(*videoTrackInfo.track);
     1144                if (newId != oldId) {
     1145                    auto trackBuffer = m_trackBufferMap.take(oldId);
     1146                    newTrackBuffers.append(std::make_pair(newId, WTFMove(trackBuffer)));
     1147                }
    11311148                break;
    11321149            }
     
    11401157        for (auto& textTrackInfo : segment.textTracks) {
    11411158            if (textTracks().length() == 1) {
    1142                 downcast<InbandTextTrack>(*textTracks().item(0)).setPrivate(*textTrackInfo.track);
     1159                auto* track = downcast<InbandTextTrack>(textTracks().item(0));
     1160                auto oldId = track->id();
     1161                auto newId = textTrackInfo.track->id();
     1162                track->setPrivate(*textTrackInfo.track);
     1163                if (newId != oldId) {
     1164                    auto trackBuffer = m_trackBufferMap.take(oldId);
     1165                    newTrackBuffers.append(std::make_pair(newId, WTFMove(trackBuffer)));
     1166                }
    11431167                break;
    11441168            }
     
    11471171            ASSERT(textTrack);
    11481172            downcast<InbandTextTrack>(*textTrack).setPrivate(*textTrackInfo.track);
     1173        }
     1174
     1175        while (!newTrackBuffers.isEmpty()) {
     1176            auto trackPair = newTrackBuffers.takeLast();
     1177            m_trackBufferMap.add(trackPair.first, WTFMove(trackPair.second));
    11491178        }
    11501179
  • branches/safari-610-branch/Source/WebCore/html/track/AudioTrack.cpp

    r262695 r269795  
    105105
    106106    updateKindFromPrivate();
     107    setId(m_private->id());
    107108}
    108109
  • branches/safari-610-branch/Source/WebCore/html/track/InbandTextTrack.cpp

    r262695 r269795  
    7878    setModeInternal(mode());
    7979    updateKindFromPrivate();
     80    setId(m_private->id());
    8081}
    8182
  • branches/safari-610-branch/Source/WebCore/html/track/VideoTrack.cpp

    r262695 r269795  
    110110    m_private->setSelected(m_selected);
    111111    updateKindFromPrivate();
     112    setId(m_private->id());
    112113}
    113114
Note: See TracChangeset for help on using the changeset viewer.