Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 35206c679b712981303a4d5f826d5543a1fa0df2
      
https://github.com/WebKit/WebKit/commit/35206c679b712981303a4d5f826d5543a1fa0df2
  Author: Vivienne Watermeier <[email protected]>
  Date:   2025-03-12 (Wed, 12 Mar 2025)

  Changed paths:
    M Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp
    M Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h
    M 
Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp
    M 
Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h
    M 
Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp
    M 
Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h

  Log Message:
  -----------
  [MSE][GStreamer] Assign track indices per-MediaSource
https://bugs.webkit.org/show_bug.cgi?id=289476

Reviewed by Philippe Normand.

Similar to track IDs, track indices (for a given type of track) should be unique
per MediaPlayer/MediaSource.

For that reason, this changes the track ID registry on 
MediaSourcePrivateGStreamer
to additionally hold each track's index and streamType, so the logic for 
assigning
indices to can be moved out of AppendPipeline. Instead, registering the track 
now
returns a RegisteredTrack structure informing it of the track's final ID and 
index.

All the (un)registerTrackId methods, along with m_trackIdRegistry, were renamed,
to more accurately express that they are not dealing with just the IDs anymore.

Finally, the StreamType enum was moved to MediaSourcePrivateGStreamer as well,
since the registry needs to keep track of each track's type to assign indices.

* Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::AppendPipeline::appsinkNewSample):
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
(WebCore::AppendPipeline::didReceiveInitializationSegment):
(WebCore::AppendPipeline::tryCreateTrackFromPad): Index is now assigned by 
track registry.
* Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h:
* 
Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp:
(WebCore::MediaSourcePrivateGStreamer::registerTrack): Aside from IDs, also 
determines index now.
(WebCore::MediaSourcePrivateGStreamer::unregisterTrack):
  ASSERT() that the given ID is known, instead of just returning false.
  If the ID was never registered or unregistered twice, that would be a bug.
(WebCore::MediaSourcePrivateGStreamer::registerTrackId): Deleted.
(WebCore::MediaSourcePrivateGStreamer::unregisterTrackId): Deleted.
* Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h:
  Move StreamType here, and create a new RegisteredTrack struct to store ID, 
index, and type.
* 
Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::registerTrack):
  Just ASSERT() that mediaSource exists, there should be no reasonable scenario 
where it would be missing at this point.
(WebCore::SourceBufferPrivateGStreamer::unregisterTrack): Ditto.
(WebCore::SourceBufferPrivateGStreamer::tryRegisterTrackId): Deleted.
(WebCore::SourceBufferPrivateGStreamer::tryUnregisterTrackId): Deleted.
* Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:

Canonical link: https://commits.webkit.org/292009@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to