Commit 642d7582 authored by Dan Sanders's avatar Dan Sanders Committed by Commit Bot

[webcodecs] Update VideoFrame IDL.

This improves our alignment with the current draft spec, and exposes
the APIs required to implement planar access.

Bug: 1096717, 1096722, 897297
Change-Id: Ic9f33ce703e4492d61ad5784c849b8816a75b89f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2341836Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Reviewed-by: default avatarChrome Cunningham <chcunningham@chromium.org>
Commit-Queue: Dan Sanders <sandersd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796522}
parent 18e7f1b8
...@@ -742,6 +742,8 @@ static_idl_files_in_modules = get_path_info( ...@@ -742,6 +742,8 @@ static_idl_files_in_modules = get_path_info(
"//third_party/blink/renderer/modules/webcodecs/image_decoder_init.idl", "//third_party/blink/renderer/modules/webcodecs/image_decoder_init.idl",
"//third_party/blink/renderer/modules/webcodecs/image_frame.idl", "//third_party/blink/renderer/modules/webcodecs/image_frame.idl",
"//third_party/blink/renderer/modules/webcodecs/image_track.idl", "//third_party/blink/renderer/modules/webcodecs/image_track.idl",
"//third_party/blink/renderer/modules/webcodecs/plane.idl",
"//third_party/blink/renderer/modules/webcodecs/plane_init.idl",
"//third_party/blink/renderer/modules/webcodecs/video_decoder.idl", "//third_party/blink/renderer/modules/webcodecs/video_decoder.idl",
"//third_party/blink/renderer/modules/webcodecs/video_decoder_init.idl", "//third_party/blink/renderer/modules/webcodecs/video_decoder_init.idl",
"//third_party/blink/renderer/modules/webcodecs/video_encoder.idl", "//third_party/blink/renderer/modules/webcodecs/video_encoder.idl",
......
...@@ -24,6 +24,8 @@ blink_modules_sources("webcodecs") { ...@@ -24,6 +24,8 @@ blink_modules_sources("webcodecs") {
"encoded_video_metadata.h", "encoded_video_metadata.h",
"image_decoder_external.cc", "image_decoder_external.cc",
"image_decoder_external.h", "image_decoder_external.h",
"plane.cc",
"plane.h",
"video_decoder.cc", "video_decoder.cc",
"video_decoder.h", "video_decoder.h",
"video_decoder_broker.cc", "video_decoder_broker.cc",
......
...@@ -8,6 +8,7 @@ modules_idl_files = [ ...@@ -8,6 +8,7 @@ modules_idl_files = [
"encoded_video_chunk.idl", "encoded_video_chunk.idl",
"encoded_audio_chunk.idl", "encoded_audio_chunk.idl",
"image_decoder.idl", "image_decoder.idl",
"plane.idl",
"video_decoder.idl", "video_decoder.idl",
"video_encoder.idl", "video_encoder.idl",
"video_frame.idl", "video_frame.idl",
...@@ -29,6 +30,7 @@ modules_dictionary_idl_files = [ ...@@ -29,6 +30,7 @@ modules_dictionary_idl_files = [
"image_decoder_init.idl", "image_decoder_init.idl",
"image_frame.idl", "image_frame.idl",
"image_track.idl", "image_track.idl",
"plane_init.idl",
"video_decoder_init.idl", "video_decoder_init.idl",
"video_encoder_config.idl", "video_encoder_config.idl",
"video_encoder_init.idl", "video_encoder_init.idl",
......
// Copyright 2020 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.
#include "third_party/blink/renderer/modules/webcodecs/plane.h"
namespace blink {
Plane::Plane(VideoFrame* frame, uint32_t plane)
: frame_(frame), plane_(plane) {}
uint32_t Plane::stride() const {
// Use |plane_|, to satisfy the compiler.
static_cast<void>(plane_);
// TODO(sandersd): Look up via |frame_|.
return 0;
}
uint32_t Plane::rows() const {
// TODO(sandersd): Look up via |frame_|.
return 0;
}
uint32_t Plane::length() const {
// TODO(sandersd): Look up via |frame_|.
return 0;
}
void Plane::readInto(MaybeShared<DOMArrayBufferView> dst, ExceptionState&) {}
void Plane::Trace(Visitor* visitor) const {
visitor->Trace(frame_);
ScriptWrappable::Trace(visitor);
}
} // namespace blink
// Copyright 2020 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_WEBCODECS_PLANE_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_PLANE_H_
#include <stdint.h>
#include "third_party/blink/renderer/core/typed_arrays/array_buffer_view_helpers.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h"
#include "third_party/blink/renderer/modules/modules_export.h"
#include "third_party/blink/renderer/modules/webcodecs/video_frame.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/member.h"
namespace blink {
class ExceptionState;
class MODULES_EXPORT Plane final : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
~Plane() override = default;
uint32_t stride() const;
uint32_t rows() const;
uint32_t length() const;
void readInto(MaybeShared<DOMArrayBufferView> dst, ExceptionState&);
void Trace(Visitor*) const override;
private:
Plane(VideoFrame* frame, uint32_t plane);
Member<VideoFrame> frame_;
uint32_t plane_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_PLANE_H_
// Copyright 2020 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.
// https://github.com/WICG/web-codecs
[
Exposed=(Window,Worker),
RuntimeEnabled=WebCodecs
] interface Plane {
readonly attribute unsigned long stride;
readonly attribute unsigned long rows;
readonly attribute unsigned long length;
[RaisesException] void readInto([AllowShared] ArrayBufferView dst);
};
// Copyright 2020 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.
// https://github.com/WICG/web-codecs
dictionary PlaneInit {
// Source of plane data.
// |stride| * |rows| bytes will be read, starting at offset 0.
required BufferSource src;
// Size of each row, in bytes.
required unsigned long stride;
// Number of rows.
required unsigned long rows;
};
...@@ -114,8 +114,8 @@ void VideoEncoder::encode(VideoFrame* frame, ...@@ -114,8 +114,8 @@ void VideoEncoder::encode(VideoFrame* frame,
"Encoder is not configured yet."); "Encoder is not configured yet.");
return; return;
} }
if (frame->visibleWidth() != uint32_t{frame_size_.width()} || if (frame->cropWidth() != uint32_t{frame_size_.width()} ||
frame->visibleHeight() != uint32_t{frame_size_.height()}) { frame->cropHeight() != uint32_t{frame_size_.height()}) {
exception_state.ThrowDOMException( exception_state.ThrowDOMException(
DOMExceptionCode::kOperationError, DOMExceptionCode::kOperationError,
"Frame size doesn't match initial encoder parameters."); "Frame size doesn't match initial encoder parameters.");
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "components/viz/common/gpu/raster_context_provider.h" #include "components/viz/common/gpu/raster_context_provider.h"
#include "components/viz/common/resources/single_release_callback.h" #include "components/viz/common/resources/single_release_callback.h"
#include "gpu/command_buffer/client/shared_image_interface.h" #include "gpu/command_buffer/client/shared_image_interface.h"
#include "media/base/timestamp_constants.h"
#include "media/base/video_frame.h" #include "media/base/video_frame.h"
#include "media/base/video_frame_metadata.h" #include "media/base/video_frame_metadata.h"
#include "media/renderers/paint_canvas_video_renderer.h" #include "media/renderers/paint_canvas_video_renderer.h"
...@@ -67,58 +68,9 @@ VideoFrame::VideoFrame(scoped_refptr<media::VideoFrame> frame) ...@@ -67,58 +68,9 @@ VideoFrame::VideoFrame(scoped_refptr<media::VideoFrame> frame)
DCHECK(frame_); DCHECK(frame_);
} }
scoped_refptr<media::VideoFrame> VideoFrame::frame() {
return frame_;
}
scoped_refptr<const media::VideoFrame> VideoFrame::frame() const {
return frame_;
}
uint64_t VideoFrame::timestamp() const {
if (!frame_)
return 0;
return frame_->timestamp().InMicroseconds();
}
base::Optional<uint64_t> VideoFrame::duration() const {
if (frame_ && frame_->metadata()->frame_duration.has_value())
return frame_->metadata()->frame_duration->InMicroseconds();
return base::Optional<uint64_t>();
}
uint32_t VideoFrame::codedWidth() const {
if (!frame_)
return 0;
return frame_->coded_size().width();
}
uint32_t VideoFrame::codedHeight() const {
if (!frame_)
return 0;
return frame_->coded_size().height();
}
uint32_t VideoFrame::visibleWidth() const {
if (!frame_)
return 0;
return frame_->visible_rect().width();
}
uint32_t VideoFrame::visibleHeight() const {
if (!frame_)
return 0;
return frame_->visible_rect().height();
}
void VideoFrame::close() {
frame_.reset();
}
// static // static
VideoFrame* VideoFrame::Create(VideoFrameInit* init, VideoFrame* VideoFrame::Create(ImageBitmap* source,
ImageBitmap* source, VideoFrameInit* init,
ExceptionState& exception_state) { ExceptionState& exception_state) {
if (!source) { if (!source) {
exception_state.ThrowDOMException(DOMExceptionCode::kNotFoundError, exception_state.ThrowDOMException(DOMExceptionCode::kNotFoundError,
...@@ -211,6 +163,89 @@ VideoFrame* VideoFrame::Create(VideoFrameInit* init, ...@@ -211,6 +163,89 @@ VideoFrame* VideoFrame::Create(VideoFrameInit* init,
return result; return result;
} }
String VideoFrame::format() const {
// TODO(sandersd): Look up on |frame_|.
return String();
}
HeapVector<Member<Plane>> VideoFrame::planes() const {
// TODO(sandersd): Should probably be extrated and cached.
return HeapVector<Member<Plane>>();
}
uint32_t VideoFrame::codedWidth() const {
if (!frame_)
return 0;
return frame_->coded_size().width();
}
uint32_t VideoFrame::codedHeight() const {
if (!frame_)
return 0;
return frame_->coded_size().height();
}
uint32_t VideoFrame::cropLeft() const {
if (!frame_)
return 0;
return frame_->visible_rect().x();
}
uint32_t VideoFrame::cropTop() const {
if (!frame_)
return 0;
return frame_->visible_rect().y();
}
uint32_t VideoFrame::cropWidth() const {
if (!frame_)
return 0;
return frame_->visible_rect().width();
}
uint32_t VideoFrame::cropHeight() const {
if (!frame_)
return 0;
return frame_->visible_rect().height();
}
uint32_t VideoFrame::displayWidth() const {
if (!frame_)
return 0;
return frame_->natural_size().width();
}
uint32_t VideoFrame::displayHeight() const {
if (!frame_)
return 0;
return frame_->natural_size().height();
}
base::Optional<uint64_t> VideoFrame::timestamp() const {
if (!frame_ || frame_->timestamp() == media::kNoTimestamp)
return base::nullopt;
return frame_->timestamp().InMicroseconds();
}
base::Optional<uint64_t> VideoFrame::duration() const {
// TODO(sandersd): Can a duration be kNoTimestamp?
if (!frame_ || !frame_->metadata()->frame_duration.has_value())
return base::nullopt;
return frame_->metadata()->frame_duration->InMicroseconds();
}
void VideoFrame::close() {
frame_.reset();
}
scoped_refptr<media::VideoFrame> VideoFrame::frame() {
return frame_;
}
scoped_refptr<const media::VideoFrame> VideoFrame::frame() const {
return frame_;
}
ScriptPromise VideoFrame::createImageBitmap(ScriptState* script_state, ScriptPromise VideoFrame::createImageBitmap(ScriptState* script_state,
const ImageBitmapOptions* options, const ImageBitmapOptions* options,
ExceptionState& exception_state) { ExceptionState& exception_state) {
...@@ -219,7 +254,8 @@ ScriptPromise VideoFrame::createImageBitmap(ScriptState* script_state, ...@@ -219,7 +254,8 @@ ScriptPromise VideoFrame::createImageBitmap(ScriptState* script_state,
} }
IntSize VideoFrame::BitmapSourceSize() const { IntSize VideoFrame::BitmapSourceSize() const {
return IntSize(visibleWidth(), visibleHeight()); // TODO(crbug.com/1096724): Should be scaled to display size.
return IntSize(cropWidth(), cropHeight());
} }
bool VideoFrame::preferAcceleratedImageBitmap() const { bool VideoFrame::preferAcceleratedImageBitmap() const {
...@@ -245,8 +281,8 @@ ScriptPromise VideoFrame::CreateImageBitmap(ScriptState* script_state, ...@@ -245,8 +281,8 @@ ScriptPromise VideoFrame::CreateImageBitmap(ScriptState* script_state,
} }
if (!preferAcceleratedImageBitmap()) { if (!preferAcceleratedImageBitmap()) {
size_t bytes_per_row = sizeof(SkColor) * visibleWidth(); size_t bytes_per_row = sizeof(SkColor) * cropWidth();
size_t image_pixels_size = bytes_per_row * visibleHeight(); size_t image_pixels_size = bytes_per_row * cropHeight();
sk_sp<SkData> image_pixels = TryAllocateSkData(image_pixels_size); sk_sp<SkData> image_pixels = TryAllocateSkData(image_pixels_size);
if (!image_pixels) { if (!image_pixels) {
...@@ -258,7 +294,7 @@ ScriptPromise VideoFrame::CreateImageBitmap(ScriptState* script_state, ...@@ -258,7 +294,7 @@ ScriptPromise VideoFrame::CreateImageBitmap(ScriptState* script_state,
frame_.get(), image_pixels->writable_data(), bytes_per_row); frame_.get(), image_pixels->writable_data(), bytes_per_row);
SkImageInfo info = SkImageInfo info =
SkImageInfo::Make(visibleWidth(), visibleHeight(), kN32_SkColorType, SkImageInfo::Make(cropWidth(), cropHeight(), kN32_SkColorType,
kUnpremul_SkAlphaType, std::move(sk_color_space)); kUnpremul_SkAlphaType, std::move(sk_color_space));
sk_sp<SkImage> skImage = sk_sp<SkImage> skImage =
SkImage::MakeRasterData(info, image_pixels, bytes_per_row); SkImage::MakeRasterData(info, image_pixels, bytes_per_row);
......
...@@ -5,18 +5,25 @@ ...@@ -5,18 +5,25 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_VIDEO_FRAME_H_ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_VIDEO_FRAME_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_VIDEO_FRAME_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_VIDEO_FRAME_H_
#include <stdint.h>
#include "base/optional.h" #include "base/optional.h"
#include "media/base/video_frame.h" #include "media/base/video_frame.h"
#include "third_party/blink/renderer/core/imagebitmap/image_bitmap_source.h" #include "third_party/blink/renderer/core/imagebitmap/image_bitmap_source.h"
#include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/modules/modules_export.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h" #include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/heap_allocator.h"
#include "third_party/blink/renderer/platform/heap/member.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink { namespace blink {
class ImageBitmap; class ImageBitmap;
class ExceptionState; class ExceptionState;
class VideoFrameInit; class Plane;
class ScriptPromise; class ScriptPromise;
class ScriptState; class ScriptState;
class VideoFrameInit;
class MODULES_EXPORT VideoFrame final : public ScriptWrappable, class MODULES_EXPORT VideoFrame final : public ScriptWrappable,
public ImageBitmapSource { public ImageBitmapSource {
...@@ -26,35 +33,45 @@ class MODULES_EXPORT VideoFrame final : public ScriptWrappable, ...@@ -26,35 +33,45 @@ class MODULES_EXPORT VideoFrame final : public ScriptWrappable,
explicit VideoFrame(scoped_refptr<media::VideoFrame> frame); explicit VideoFrame(scoped_refptr<media::VideoFrame> frame);
// video_frame.idl implementation. // video_frame.idl implementation.
static VideoFrame* Create(VideoFrameInit*, ImageBitmap*, ExceptionState&); static VideoFrame* Create(ImageBitmap*, VideoFrameInit*, ExceptionState&);
ScriptPromise createImageBitmap(ScriptState*,
const ImageBitmapOptions*,
ExceptionState&);
// ImageBitmapSource implementation String format() const;
IntSize BitmapSourceSize() const override; HeapVector<Member<Plane>> planes() const;
ScriptPromise CreateImageBitmap(ScriptState*,
base::Optional<IntRect> crop_rect,
const ImageBitmapOptions*,
ExceptionState&) override;
uint64_t timestamp() const;
base::Optional<uint64_t> duration() const;
uint32_t codedWidth() const; uint32_t codedWidth() const;
uint32_t codedHeight() const; uint32_t codedHeight() const;
uint32_t visibleWidth() const;
uint32_t visibleHeight() const; uint32_t cropLeft() const;
uint32_t cropTop() const;
uint32_t cropWidth() const;
uint32_t cropHeight() const;
uint32_t displayWidth() const;
uint32_t displayHeight() const;
base::Optional<uint64_t> timestamp() const;
base::Optional<uint64_t> duration() const;
void close(); void close();
ScriptPromise createImageBitmap(ScriptState*,
const ImageBitmapOptions*,
ExceptionState&);
// Convenience functions // Convenience functions
scoped_refptr<media::VideoFrame> frame(); scoped_refptr<media::VideoFrame> frame();
scoped_refptr<const media::VideoFrame> frame() const; scoped_refptr<const media::VideoFrame> frame() const;
private: private:
// ImageBitmapSource implementation
static constexpr uint64_t kCpuEfficientFrameSize = 320u * 240u; static constexpr uint64_t kCpuEfficientFrameSize = 320u * 240u;
IntSize BitmapSourceSize() const override;
bool preferAcceleratedImageBitmap() const; bool preferAcceleratedImageBitmap() const;
ScriptPromise CreateImageBitmap(ScriptState*,
base::Optional<IntRect> crop_rect,
const ImageBitmapOptions*,
ExceptionState&) override;
scoped_refptr<media::VideoFrame> frame_; scoped_refptr<media::VideoFrame> frame_;
}; };
......
...@@ -3,23 +3,58 @@ ...@@ -3,23 +3,58 @@
// found in the LICENSE file. // found in the LICENSE file.
// https://github.com/WICG/web-codecs // https://github.com/WICG/web-codecs
enum VideoPixelFormat {
// 4:2:0 subsampled planar YUV
"I420"
};
[ [
Exposed=Window, Exposed=Window,
RuntimeEnabled=WebCodecs RuntimeEnabled=WebCodecs
] interface VideoFrame { ] interface VideoFrame {
[RaisesException] constructor(VideoFrameInit init, ImageBitmap source); [RaisesException] constructor(ImageBitmap source, VideoFrameInit init);
void close();
[CallWith=ScriptState, RaisesException] Promise<ImageBitmap> createImageBitmap( // TODO(sandersd): Provide a way to find out what pixel formats are supported.
optional ImageBitmapOptions options = {}); // TODO(sandersd): Provide a way to convert to a specific pixel format, and to
// find out what pixel formats can be converted to.
readonly attribute unsigned long long timestamp; // microseconds // TODO(sandersd): It's not clear whether it's better to use undefined, or a
readonly attribute unsigned long long? duration; // microseconds // special enum value to mean 'opaque format'. Undefined does result in
// shorter branch conditions.
readonly attribute VideoPixelFormat? format;
readonly attribute FrozenArray<Plane>? planes;
// The size of the frame; typically padded to a multiple of some block size.
readonly attribute unsigned long codedWidth; readonly attribute unsigned long codedWidth;
readonly attribute unsigned long codedHeight; readonly attribute unsigned long codedHeight;
readonly attribute unsigned long visibleWidth; // The region of the frame that is not padding.
readonly attribute unsigned long visibleHeight; readonly attribute unsigned long cropLeft;
readonly attribute unsigned long cropTop;
readonly attribute unsigned long cropWidth;
readonly attribute unsigned long cropHeight;
// The intended display size (and display aspect ratio) of the crop region.
// TODO(sandersd): The draft spec says double, and that makes sense, but it
// also makes createImageBitmap() ambiguous.
readonly attribute unsigned long displayWidth;
readonly attribute unsigned long displayHeight;
// Presentation timestamp, in microseconds.
readonly attribute unsigned long long? timestamp;
// Presentation duration, in microseconds.
readonly attribute unsigned long long? duration;
// TODO(sandersd): color space metadata.
// TODO(sandersd): rotation metadata.
// Release held resources immediately.
// TODO(sandersd): Describe how a closed VideoFrame acts.
void close();
// Create an ImageBitmap from the crop region, scaled to the display size.
// TODO(sandersd): Should use the global createImageBitmap() instead.
[CallWith=ScriptState, RaisesException] Promise<ImageBitmap> createImageBitmap(
optional ImageBitmapOptions options = {});
}; };
...@@ -40,20 +40,20 @@ TEST_F(VideoFrameTest, ConstructorAndAttributes) { ...@@ -40,20 +40,20 @@ TEST_F(VideoFrameTest, ConstructorAndAttributes) {
gfx::Size(100, 200) /* visible_size */); gfx::Size(100, 200) /* visible_size */);
VideoFrame* blink_frame = CreateBlinkVideoFrame(media_frame); VideoFrame* blink_frame = CreateBlinkVideoFrame(media_frame);
EXPECT_EQ(1000u, blink_frame->timestamp()); EXPECT_EQ(1000u, blink_frame->timestamp().value());
EXPECT_EQ(112u, blink_frame->codedWidth()); EXPECT_EQ(112u, blink_frame->codedWidth());
EXPECT_EQ(208u, blink_frame->codedHeight()); EXPECT_EQ(208u, blink_frame->codedHeight());
EXPECT_EQ(100u, blink_frame->visibleWidth()); EXPECT_EQ(100u, blink_frame->cropWidth());
EXPECT_EQ(200u, blink_frame->visibleHeight()); EXPECT_EQ(200u, blink_frame->cropHeight());
EXPECT_EQ(media_frame, blink_frame->frame()); EXPECT_EQ(media_frame, blink_frame->frame());
blink_frame->close(); blink_frame->close();
EXPECT_EQ(0u, blink_frame->timestamp()); EXPECT_FALSE(blink_frame->timestamp().has_value());
EXPECT_EQ(0u, blink_frame->codedWidth()); EXPECT_EQ(0u, blink_frame->codedWidth());
EXPECT_EQ(0u, blink_frame->codedHeight()); EXPECT_EQ(0u, blink_frame->codedHeight());
EXPECT_EQ(0u, blink_frame->visibleWidth()); EXPECT_EQ(0u, blink_frame->cropWidth());
EXPECT_EQ(0u, blink_frame->visibleHeight()); EXPECT_EQ(0u, blink_frame->cropHeight());
EXPECT_EQ(nullptr, blink_frame->frame()); EXPECT_EQ(nullptr, blink_frame->frame());
} }
......
...@@ -1228,6 +1228,13 @@ interface Permissions ...@@ -1228,6 +1228,13 @@ interface Permissions
method request method request
method requestAll method requestAll
method revoke method revoke
interface Plane
attribute @@toStringTag
getter length
getter rows
getter stride
method constructor
method readInto
interface Profiler interface Profiler
attribute @@toStringTag attribute @@toStringTag
getter sampleInterval getter sampleInterval
......
...@@ -24,7 +24,7 @@ async function generateBitmap(width, height, text) { ...@@ -24,7 +24,7 @@ async function generateBitmap(width, height, text) {
async function createFrame(width, height, ts) { async function createFrame(width, height, ts) {
let imageBitmap = await generateBitmap(width, height, ts.toString()); let imageBitmap = await generateBitmap(width, height, ts.toString());
return new VideoFrame({ timestamp: ts }, imageBitmap); return new VideoFrame(imageBitmap, { timestamp: ts });
} }
async function encode_test(codec, profile, acc) { async function encode_test(codec, profile, acc) {
...@@ -83,4 +83,4 @@ promise_test(encode_test. ...@@ -83,4 +83,4 @@ promise_test(encode_test.
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
return createImageBitmap(canvas, imageBitmapOptions) return createImageBitmap(canvas, imageBitmapOptions)
.then((fromImageBitmap) => { .then((fromImageBitmap) => {
let videoFrame = new VideoFrame({ let videoFrame = new VideoFrame(fromImageBitmap, {
timestamp: 0 timestamp: 0
}, fromImageBitmap); });
return videoFrame.createImageBitmap(imageBitmapOptions); return videoFrame.createImageBitmap(imageBitmapOptions);
}) })
.then((toImageBitmap) => { .then((toImageBitmap) => {
...@@ -112,9 +112,9 @@ ...@@ -112,9 +112,9 @@
ctx.fillRect(0, 0, width, height); ctx.fillRect(0, 0, width, height);
return createImageBitmap(canvas).then((fromImageBitmap) => { return createImageBitmap(canvas).then((fromImageBitmap) => {
let videoFrame = new VideoFrame({ let videoFrame = new VideoFrame(fromImageBitmap, {
timestamp: 0 timestamp: 0
}, fromImageBitmap); });
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let processVideoFrame = (frame) => { let processVideoFrame = (frame) => {
frame.createImageBitmap().then((toImageBitmap) => { frame.createImageBitmap().then((toImageBitmap) => {
......
...@@ -1173,6 +1173,13 @@ Starting worker: resources/global-interface-listing-worker.js ...@@ -1173,6 +1173,13 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] method request [Worker] method request
[Worker] method requestAll [Worker] method requestAll
[Worker] method revoke [Worker] method revoke
[Worker] interface Plane
[Worker] attribute @@toStringTag
[Worker] getter length
[Worker] getter rows
[Worker] getter stride
[Worker] method constructor
[Worker] method readInto
[Worker] interface Profiler [Worker] interface Profiler
[Worker] attribute @@toStringTag [Worker] attribute @@toStringTag
[Worker] getter sampleInterval [Worker] getter sampleInterval
......
...@@ -6111,6 +6111,13 @@ interface PictureInPictureWindow : EventTarget ...@@ -6111,6 +6111,13 @@ interface PictureInPictureWindow : EventTarget
getter width getter width
method constructor method constructor
setter onresize setter onresize
interface Plane
attribute @@toStringTag
getter length
getter rows
getter stride
method constructor
method readInto
interface Plugin interface Plugin
attribute @@toStringTag attribute @@toStringTag
getter description getter description
...@@ -8785,10 +8792,16 @@ interface VideoFrame ...@@ -8785,10 +8792,16 @@ interface VideoFrame
attribute @@toStringTag attribute @@toStringTag
getter codedHeight getter codedHeight
getter codedWidth getter codedWidth
getter cropHeight
getter cropLeft
getter cropTop
getter cropWidth
getter displayHeight
getter displayWidth
getter duration getter duration
getter format
getter planes
getter timestamp getter timestamp
getter visibleHeight
getter visibleWidth
method close method close
method constructor method constructor
method createImageBitmap method createImageBitmap
......
...@@ -1128,6 +1128,13 @@ Starting worker: resources/global-interface-listing-worker.js ...@@ -1128,6 +1128,13 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] method request [Worker] method request
[Worker] method requestAll [Worker] method requestAll
[Worker] method revoke [Worker] method revoke
[Worker] interface Plane
[Worker] attribute @@toStringTag
[Worker] getter length
[Worker] getter rows
[Worker] getter stride
[Worker] method constructor
[Worker] method readInto
[Worker] interface Profiler [Worker] interface Profiler
[Worker] attribute @@toStringTag [Worker] attribute @@toStringTag
[Worker] getter sampleInterval [Worker] getter sampleInterval
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment