-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MSE-in-Workers: srcObject part 2: MS.getHandle()
Adds ability for apps to get a MediaSourceHandle from a dedicated worker MediaSource instance, gated by RuntimeEnabledFeature "MediaSourceInWorkersUsingHandle". Updates the PassKey required for creation of a concrete MediaSourceAttachmentSupplement to allow that only from either URLMediaSource::createObjectURL or the new MediaSource::getHandle method. This specificity is enabled by a new AttachmentCreationPassKeyProvider type. Later changes will enable apps to post the handle to the main thread and attach it to an HTMLMediaElement via the srcObject attribute; they will also include test updates. References: Full prototype CL: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) crbug.com/506273 is somewhat related, but not fixed by this change (it refers to directly setting MediaSource on Window context to the media element's srcObject attribute.) This change sequence is specific to enabling MSE-in-Worker attachment via srcObject using a handle object. BUG=878133,506273 Change-Id: Ic61f4cc4193080bdbc39234b98897d9a789778d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688613 Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Reviewed-by: Will Cassella <cassew@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012129} NOKEYCHECK=True GitOrigin-RevId: 09e5fb1a68416f65ef2255c846b81a46f6aa8e52
- Loading branch information
1 parent
a99a568
commit f31cbc6
Showing
14 changed files
with
174 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
blink/renderer/modules/mediasource/attachment_creation_pass_key_provider.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2022 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_ATTACHMENT_CREATION_PASS_KEY_PROVIDER_H_ | ||
#define THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_ATTACHMENT_CREATION_PASS_KEY_PROVIDER_H_ | ||
|
||
#include "base/types/pass_key.h" | ||
#include "third_party/blink/renderer/modules/mediasource/media_source.h" | ||
#include "third_party/blink/renderer/modules/mediasource/url_media_source.h" | ||
|
||
namespace blink { | ||
|
||
class ExceptionState; | ||
class MediaSource; | ||
class MediaSourceHandleImpl; | ||
class ScriptState; | ||
|
||
class AttachmentCreationPassKeyProvider { | ||
STATIC_ONLY(AttachmentCreationPassKeyProvider); | ||
|
||
public: | ||
using PassKey = base::PassKey<AttachmentCreationPassKeyProvider>; | ||
|
||
private: | ||
// These specific friend methods are allowed to use GetPassKey so they may | ||
// create a MediaSourceAttachmentSupplement. | ||
static PassKey GetPassKey() { return PassKey(); } | ||
friend String URLMediaSource::createObjectURL(ScriptState*, MediaSource*); | ||
friend MediaSourceHandleImpl* MediaSource::getHandle(ExceptionState&); | ||
}; | ||
|
||
} // namespace blink | ||
|
||
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_ATTACHMENT_CREATION_PASS_KEY_PROVIDER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters