Skip to content

Commit

Permalink
Move SourceBufferWriteHead to Cobalt module (#4851)
Browse files Browse the repository at this point in the history
1. Moves the `SourceBuffer.writeHead` implementation from the
mediasource module to the Cobalt module.
2. Renames `source_buffer_write_head.idl` to
`source_buffer_extensions.idl`.

b/395658866
  • Loading branch information
osagie98 authored Feb 13, 2025
1 parent fed9b86 commit 103051c
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 18 deletions.
10 changes: 1 addition & 9 deletions third_party/blink/renderer/bindings/idl_in_modules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,7 @@ if (is_cobalt) {
"//third_party/blink/renderer/modules/cobalt/window_h_5_vcc.idl",
"//third_party/blink/renderer/modules/cobalt/h5vcc_system/h_5_vcc_system.idl",
"//third_party/blink/renderer/modules/cobalt/h5vcc_runtime/h_5_vcc_runtime.idl",
"//third_party/blink/renderer/modules/cobalt/mediasource/source_buffer_extensions.idl",
],
"abspath")
}
Expand Down Expand Up @@ -1295,15 +1296,6 @@ if (target_os != "android") {
"abspath")
}

# SourceBufferWriteHead
# An extension to the SourceBuffer interface that allows web apps to check the
# highest presentation timestamp written to the Renderer.
if (is_cobalt && use_starboard_media) {
static_idl_files_in_modules += get_path_info(
[ "//third_party/blink/renderer/modules/mediasource/source_buffer_write_head.idl" ],
"abspath")
}

# Statically-defined (not runtime-generated) IDL files in 'modules' component.
# These IDL definitions are used only for testing.
static_idl_files_in_modules_for_testing = get_path_info(
Expand Down
1 change: 1 addition & 0 deletions third_party/blink/renderer/modules/cobalt/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ blink_modules_sources("h_5_vcc") {
"//third_party/blink/renderer/modules/cobalt/crash_annotator",
"//third_party/blink/renderer/modules/cobalt/h5vcc_runtime",
"//third_party/blink/renderer/modules/cobalt/h5vcc_system",
"//third_party/blink/renderer/modules/cobalt/mediasource",
]
}
24 changes: 24 additions & 0 deletions third_party/blink/renderer/modules/cobalt/mediasource/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2025 The Cobalt Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//third_party/blink/renderer/modules/modules.gni")

blink_modules_sources("mediasource") {
sources = [
"source_buffer_write_head.cc",
"source_buffer_write_head.h",
]

deps = [ "//third_party/blink/renderer/modules/mediasource:mediasource" ]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
ImplementedAs=SourceBufferWriteHead
] partial interface SourceBuffer {
[RaisesException] readonly attribute double writeHead;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "third_party/blink/renderer/modules/mediasource/source_buffer_write_head.h"
#include "third_party/blink/renderer/modules/cobalt/mediasource/source_buffer_write_head.h"

#include "third_party/blink/renderer/modules/mediasource/source_buffer.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_SOURCE_BUFFER_WRITE_HEAD_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_SOURCE_BUFFER_WRITE_HEAD_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_COBALT_MEDIASOURCE_SOURCE_BUFFER_WRITE_HEAD_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_COBALT_MEDIASOURCE_SOURCE_BUFFER_WRITE_HEAD_H_

#include "build/build_config.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
Expand All @@ -36,4 +36,4 @@ class SourceBufferWriteHead {

} // namespace blink

#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASOURCE_SOURCE_BUFFER_WRITE_HEAD_H_
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_COBALT_MEDIASOURCE_SOURCE_BUFFER_WRITE_HEAD_H_
4 changes: 0 additions & 4 deletions third_party/blink/renderer/modules/mediasource/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ blink_modules_sources("mediasource") {
"//third_party/blink/renderer/modules/webcodecs:webcodecs",
]
if (is_cobalt && use_starboard_media) {
sources += [
"source_buffer_write_head.cc",
"source_buffer_write_head.h",
]
deps += [ "//starboard($starboard_toolchain)" ]
}
}

0 comments on commit 103051c

Please sign in to comment.