Commit 30b3936d authored by Chris Cunningham's avatar Chris Cunningham Committed by Commit Bot

WebCodecs: AudioDecoder templated blink bindings

This connects the IDL definitions to real code. We introduce
DecoderTemplate to house the common request processing between
audio/video decoders. A follow up cl will convert VideoDecoder to use
this as well.

For now AudioDecoder always uses FFmpeg and hard codes the codec to AAC.

Change-Id: I891fbe095e57a240db2b528ced81ee1d6f14ef31

Bug: 1094090
Change-Id: I891fbe095e57a240db2b528ced81ee1d6f14ef31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2274584
Commit-Queue: Chrome Cunningham <chcunningham@chromium.org>
Auto-Submit: Chrome Cunningham <chcunningham@chromium.org>
Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786017}
parent 745a8d62
...@@ -731,6 +731,13 @@ static_idl_files_in_modules = get_path_info( ...@@ -731,6 +731,13 @@ static_idl_files_in_modules = get_path_info(
"//third_party/blink/renderer/modules/webaudio/stereo_panner_options.idl", "//third_party/blink/renderer/modules/webaudio/stereo_panner_options.idl",
"//third_party/blink/renderer/modules/webaudio/wave_shaper_node.idl", "//third_party/blink/renderer/modules/webaudio/wave_shaper_node.idl",
"//third_party/blink/renderer/modules/webaudio/wave_shaper_options.idl", "//third_party/blink/renderer/modules/webaudio/wave_shaper_options.idl",
"//third_party/blink/renderer/modules/webcodecs/audio_decoder.idl",
"//third_party/blink/renderer/modules/webcodecs/audio_decoder_init.idl",
"//third_party/blink/renderer/modules/webcodecs/audio_frame.idl",
"//third_party/blink/renderer/modules/webcodecs/audio_frame_init.idl",
"//third_party/blink/renderer/modules/webcodecs/audio_frame_output_callback.idl",
"//third_party/blink/renderer/modules/webcodecs/encoded_audio_chunk.idl",
"//third_party/blink/renderer/modules/webcodecs/encoded_audio_config.idl",
"//third_party/blink/renderer/modules/webcodecs/encoded_video_chunk.idl", "//third_party/blink/renderer/modules/webcodecs/encoded_video_chunk.idl",
"//third_party/blink/renderer/modules/webcodecs/encoded_video_config.idl", "//third_party/blink/renderer/modules/webcodecs/encoded_video_config.idl",
"//third_party/blink/renderer/modules/webcodecs/image_decoder.idl", "//third_party/blink/renderer/modules/webcodecs/image_decoder.idl",
......
...@@ -120,6 +120,8 @@ generated_modules_callback_function_files = [ ...@@ -120,6 +120,8 @@ generated_modules_callback_function_files = [
"$bindings_modules_v8_output_dir/v8_animate_callback.h", "$bindings_modules_v8_output_dir/v8_animate_callback.h",
"$bindings_modules_v8_output_dir/v8_animator_constructor.cc", "$bindings_modules_v8_output_dir/v8_animator_constructor.cc",
"$bindings_modules_v8_output_dir/v8_animator_constructor.h", "$bindings_modules_v8_output_dir/v8_animator_constructor.h",
"$bindings_modules_v8_output_dir/v8_audio_frame_output_callback.cc",
"$bindings_modules_v8_output_dir/v8_audio_frame_output_callback.h",
"$bindings_modules_v8_output_dir/v8_blink_audio_worklet_process_callback.cc", "$bindings_modules_v8_output_dir/v8_blink_audio_worklet_process_callback.cc",
"$bindings_modules_v8_output_dir/v8_blink_audio_worklet_process_callback.h", "$bindings_modules_v8_output_dir/v8_blink_audio_worklet_process_callback.h",
"$bindings_modules_v8_output_dir/v8_blink_audio_worklet_processor_constructor.cc", "$bindings_modules_v8_output_dir/v8_blink_audio_worklet_processor_constructor.cc",
......
...@@ -6,8 +6,17 @@ import("//third_party/blink/renderer/modules/modules.gni") ...@@ -6,8 +6,17 @@ import("//third_party/blink/renderer/modules/modules.gni")
blink_modules_sources("webcodecs") { blink_modules_sources("webcodecs") {
sources = [ sources = [
"audio_decoder.cc",
"audio_decoder.h",
"audio_frame.cc",
"audio_frame.h",
"decoder_selector.cc", "decoder_selector.cc",
"decoder_selector.h", "decoder_selector.h",
"decoder_template.cc",
"decoder_template.h",
"encoded_audio_chunk.cc",
"encoded_audio_chunk.h",
"encoded_audio_metadata.h",
"encoded_video_chunk.cc", "encoded_video_chunk.cc",
"encoded_video_chunk.h", "encoded_video_chunk.h",
"encoded_video_metadata.h", "encoded_video_metadata.h",
...@@ -37,6 +46,7 @@ blink_modules_sources("webcodecs") { ...@@ -37,6 +46,7 @@ blink_modules_sources("webcodecs") {
source_set("unit_tests") { source_set("unit_tests") {
testonly = true testonly = true
sources = [ sources = [
"audio_decoder_test.cc",
"decoder_selector_test.cc", "decoder_selector_test.cc",
"encoded_video_chunk_test.cc", "encoded_video_chunk_test.cc",
"video_decoder_broker_test.cc", "video_decoder_broker_test.cc",
......
// 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/audio_decoder.h"
#include "media/base/audio_codecs.h"
#include "media/base/audio_decoder.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/channel_layout.h"
#include "media/base/encryption_scheme.h"
#include "media/base/media_util.h"
#include "media/base/waiting.h"
#include "media/filters/ffmpeg_audio_decoder.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_audio_decoder_init.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_encoded_audio_chunk.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_encoded_audio_config.h"
#include <memory>
#include <vector>
namespace blink {
// static
std::unique_ptr<AudioDecoderTraits::MediaDecoderType>
AudioDecoderTraits::CreateDecoder(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
media::MediaLog* media_log) {
return std::make_unique<media::FFmpegAudioDecoder>(task_runner, media_log);
}
// static
void AudioDecoderTraits::InitializeDecoder(
MediaDecoderType& decoder,
const ConfigType& config,
MediaDecoderType::InitCB init_cb,
MediaDecoderType::OutputCB output_cb) {
std::vector<uint8_t> extra_data;
if (config.hasDescription()) {
DOMArrayBuffer* buffer;
if (config.description().IsArrayBuffer()) {
buffer = config.description().GetAsArrayBuffer();
} else {
// TODO(sandersd): Can IsNull() be true?
DCHECK(config.description().IsArrayBufferView());
buffer = config.description().GetAsArrayBufferView()->buffer();
}
// TODO(sandersd): Is it possible to not have Data()?
uint8_t* start = static_cast<uint8_t*>(buffer->Data());
size_t size = buffer->ByteLengthAsSizeT();
extra_data.assign(start, start + size);
}
// TODO(chcunningham): Convert the rest of blink config -> media config.
auto media_config =
media::AudioDecoderConfig(media::kCodecAAC, media::kSampleFormatPlanarF32,
media::CHANNEL_LAYOUT_STEREO, 48000, extra_data,
media::EncryptionScheme::kUnencrypted);
decoder.Initialize(media_config, nullptr /* cdm_context */,
std::move(init_cb), output_cb, media::WaitingCB());
}
// static
int AudioDecoderTraits::GetMaxDecodeRequests(const MediaDecoderType& decoder) {
return 1;
}
// static
scoped_refptr<media::DecoderBuffer> AudioDecoderTraits::MakeDecoderBuffer(
const InputType& chunk) {
// TODO(chcunningham): Implement the conversion.
auto decoder_buffer = media::DecoderBuffer::CopyFrom(
static_cast<uint8_t*>(chunk.data()->Data()),
chunk.data()->ByteLengthAsSizeT());
decoder_buffer->set_timestamp(
base::TimeDelta::FromMicroseconds(chunk.timestamp()));
decoder_buffer->set_is_key_frame(chunk.type() == "key");
return decoder_buffer;
}
// static
AudioDecoder* AudioDecoder::Create(ScriptState* script_state,
const AudioDecoderInit* init,
ExceptionState& exception_state) {
return MakeGarbageCollected<AudioDecoder>(script_state, init,
exception_state);
}
AudioDecoder::AudioDecoder(ScriptState* script_state,
const AudioDecoderInit* init,
ExceptionState& exception_state)
: DecoderTemplate<AudioDecoderTraits>(script_state, init, exception_state) {
}
} // 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_AUDIO_DECODER_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_AUDIO_DECODER_H_
#include "third_party/blink/renderer/modules/webcodecs/decoder_template.h"
#include <stdint.h>
#include <memory>
#include "media/base/audio_decoder.h"
#include "media/base/media_log.h"
#include "media/base/status.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_video_frame_output_callback.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_web_codecs_error_callback.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/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
#include "third_party/blink/renderer/platform/heap/heap_allocator.h"
#include "third_party/blink/renderer/platform/heap/member.h"
namespace media {
class AudioBuffer;
class DecoderBuffer;
class MediaLog;
} // namespace media
namespace blink {
class ExceptionState;
class AudioDecoderInit;
class AudioFrame;
class EncodedAudioChunk;
class EncodedAudioConfig;
class AudioDecoderInit;
class V8AudioFrameOutputCallback;
class MODULES_EXPORT AudioDecoderTraits {
public:
using InitType = AudioDecoderInit;
using OutputType = AudioFrame;
using MediaOutputType = media::AudioBuffer;
using MediaDecoderType = media::AudioDecoder;
using OutputCallbackType = V8AudioFrameOutputCallback;
using ConfigType = EncodedAudioConfig;
using InputType = EncodedAudioChunk;
static std::unique_ptr<MediaDecoderType> CreateDecoder(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
media::MediaLog* media_log);
static void InitializeDecoder(MediaDecoderType& decoder,
const ConfigType& config,
MediaDecoderType::InitCB init_cb,
MediaDecoderType::OutputCB output_cb);
static int GetMaxDecodeRequests(const MediaDecoderType& decoder);
static scoped_refptr<media::DecoderBuffer> MakeDecoderBuffer(
const InputType& input);
};
class MODULES_EXPORT AudioDecoder : public DecoderTemplate<AudioDecoderTraits> {
DEFINE_WRAPPERTYPEINFO();
public:
static AudioDecoder* Create(ScriptState*,
const AudioDecoderInit*,
ExceptionState&);
AudioDecoder(ScriptState*, const AudioDecoderInit*, ExceptionState&);
~AudioDecoder() override = default;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_AUDIO_DECODER_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.
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_audio_decoder_init.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
#include "third_party/blink/renderer/modules/webcodecs/audio_decoder.h"
namespace blink {
TEST(AudioDecoderTest, Construction) {
V8TestingScope v8_scope;
auto* init = MakeGarbageCollected<AudioDecoderInit>();
auto* decoder = MakeGarbageCollected<AudioDecoder>(
v8_scope.GetScriptState(), init, v8_scope.GetExceptionState());
EXPECT_EQ(decoder->decodeQueueSize(), 0);
}
} // 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.
#include "third_party/blink/renderer/modules/webcodecs/audio_frame.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_audio_frame_init.h"
namespace blink {
// static
AudioFrame* AudioFrame::Create(AudioFrameInit* init,
ExceptionState& exception_state) {
// FIXME : throw exception if no audio buffer.
return MakeGarbageCollected<AudioFrame>(init);
}
AudioFrame::AudioFrame(AudioFrameInit* init)
: timestamp_(init->timestamp()), buffer_(init->buffer()) {}
AudioFrame::AudioFrame(scoped_refptr<media::AudioBuffer> buffer)
: timestamp_(buffer->timestamp().InMicroseconds()) {
// FIXME - use the |buffer| to initialize AudioBuffer.
}
void AudioFrame::close() {
buffer_.Clear();
}
uint64_t AudioFrame::timestamp() const {
return timestamp_;
}
AudioBuffer* AudioFrame::buffer() const {
return buffer_;
}
void AudioFrame::Trace(Visitor* visitor) const {
visitor->Trace(buffer_);
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_AUDIO_FRAME_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_AUDIO_FRAME_H_
#include "media/base/audio_buffer.h"
#include "third_party/blink/renderer/modules/modules_export.h"
#include "third_party/blink/renderer/modules/webaudio/audio_buffer.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
namespace blink {
class ExceptionState;
class AudioFrameInit;
class MODULES_EXPORT AudioFrame final : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
static AudioFrame* Create(AudioFrameInit*, ExceptionState&);
// Internal constructor for creating from media::AudioDecoder output.
explicit AudioFrame(scoped_refptr<media::AudioBuffer>);
// audio_frame.idl implementation.
explicit AudioFrame(AudioFrameInit*);
void close();
uint64_t timestamp() const;
AudioBuffer* buffer() const;
// GarbageCollected override.
void Trace(Visitor*) const override;
private:
uint64_t timestamp_;
Member<AudioBuffer> buffer_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_AUDIO_FRAME_H_
...@@ -7,4 +7,4 @@ ...@@ -7,4 +7,4 @@
dictionary AudioFrameInit { dictionary AudioFrameInit {
unsigned long long timestamp; // microseconds unsigned long long timestamp; // microseconds
AudioBuffer buffer; AudioBuffer buffer;
}; };
\ No newline at end of file
// 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_DECODER_TEMPLATE_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_DECODER_TEMPLATE_H_
#include <stdint.h>
#include <memory>
#include "media/base/decode_status.h"
#include "media/base/media_log.h"
#include "media/base/status.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_web_codecs_error_callback.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/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
#include "third_party/blink/renderer/platform/heap/heap_allocator.h"
#include "third_party/blink/renderer/platform/heap/member.h"
namespace blink {
template <typename Traits>
class MODULES_EXPORT DecoderTemplate : public ScriptWrappable {
public:
typedef typename Traits::ConfigType ConfigType;
typedef typename Traits::InputType InputType;
typedef typename Traits::InitType InitType;
typedef typename Traits::MediaDecoderType MediaDecoderType;
typedef typename Traits::MediaOutputType MediaOutputType;
typedef typename Traits::OutputType OutputType;
typedef typename Traits::OutputCallbackType OutputCallbackType;
DecoderTemplate(ScriptState*, const InitType*, ExceptionState&);
~DecoderTemplate() override;
int32_t decodeQueueSize();
void configure(const ConfigType*, ExceptionState&);
void decode(const InputType*, ExceptionState&);
ScriptPromise flush(ExceptionState&);
void reset(ExceptionState&);
void close();
// GarbageCollected override.
void Trace(Visitor*) const override;
private:
struct Request : public GarbageCollected<Request> {
enum class Type {
kConfigure,
kDecode,
kFlush,
kReset,
};
void Trace(Visitor*) const;
Type type;
// For kConfigure Requests.
Member<const ConfigType> config;
// For kDecode Requests.
Member<const InputType> chunk;
// For kFlush Requests.
Member<ScriptPromiseResolver> resolver;
};
void ProcessRequests();
bool ProcessConfigureRequest(Request* request);
bool ProcessDecodeRequest(Request* request);
bool ProcessFlushRequest(Request* request);
bool ProcessResetRequest(Request* request);
void HandleError();
// Called by |decoder_|.
void OnInitializeDone(media::Status status);
void OnDecodeDone(uint32_t id, media::DecodeStatus);
void OnFlushDone(media::DecodeStatus);
void OnConfigureFlushDone(media::DecodeStatus);
void OnResetDone();
void OnOutput(scoped_refptr<MediaOutputType>);
Member<ScriptState> script_state_;
Member<OutputCallbackType> output_cb_;
Member<V8WebCodecsErrorCallback> error_cb_;
HeapDeque<Member<Request>> requests_;
int32_t requested_decodes_ = 0;
int32_t requested_resets_ = 0;
// An in-flight, mutually-exclusive request.
// Could be a configure, flush, or reset. Decodes go in |pending_decodes_|.
Member<Request> pending_request_;
std::unique_ptr<media::MediaLog> media_log_;
// TODO(sandersd): Store the last config, flush, and reset so that
// duplicates can be elided.
std::unique_ptr<MediaDecoderType> decoder_;
// TODO(sandersd): Can this just be a HashSet by ptr comparison?
uint32_t pending_decode_id_ = 0;
HeapHashMap<uint32_t, Member<Request>> pending_decodes_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_DECODER_TEMPLATE_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.
#include "third_party/blink/renderer/modules/webcodecs/encoded_audio_chunk.h"
#include <utility>
#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink {
EncodedAudioChunk* EncodedAudioChunk::Create(String type,
uint64_t timestamp,
const DOMArrayPiece& data) {
EncodedAudioMetadata metadata;
metadata.timestamp = base::TimeDelta::FromMicroseconds(timestamp);
metadata.key_frame = (type == "key");
return MakeGarbageCollected<EncodedAudioChunk>(
metadata, DOMArrayBuffer::Create(data.Bytes(), data.ByteLengthAsSizeT()));
}
EncodedAudioChunk::EncodedAudioChunk(EncodedAudioMetadata metadata,
DOMArrayBuffer* buffer)
: metadata_(metadata), buffer_(buffer) {}
String EncodedAudioChunk::type() const {
return metadata_.key_frame ? "key" : "delta";
}
uint64_t EncodedAudioChunk::timestamp() const {
return metadata_.timestamp.InMicroseconds();
}
DOMArrayBuffer* EncodedAudioChunk::data() const {
return buffer_;
}
} // 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_ENCODED_AUDIO_CHUNK_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_ENCODED_AUDIO_CHUNK_H_
#include "third_party/blink/renderer/core/typed_arrays/dom_array_piece.h"
#include "third_party/blink/renderer/modules/modules_export.h"
#include "third_party/blink/renderer/modules/webcodecs/encoded_audio_metadata.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
namespace blink {
class DOMArrayBuffer;
class MODULES_EXPORT EncodedAudioChunk final : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
EncodedAudioChunk(EncodedAudioMetadata metadata, DOMArrayBuffer* buffer);
static EncodedAudioChunk* Create(String type,
uint64_t timestamp,
const DOMArrayPiece& data);
// encoded_audio_chunk.idl implementation.
String type() const;
uint64_t timestamp() const;
DOMArrayBuffer* data() const;
void Trace(Visitor* visitor) const override {
visitor->Trace(buffer_);
ScriptWrappable::Trace(visitor);
}
private:
EncodedAudioMetadata metadata_;
Member<DOMArrayBuffer> buffer_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_ENCODED_AUDIO_CHUNK_H_
...@@ -15,4 +15,6 @@ enum EncodedAudioChunkType { ...@@ -15,4 +15,6 @@ enum EncodedAudioChunkType {
readonly attribute EncodedAudioChunkType type; readonly attribute EncodedAudioChunkType type;
readonly attribute unsigned long long timestamp; // microseconds readonly attribute unsigned long long timestamp; // microseconds
readonly attribute ArrayBuffer data; readonly attribute ArrayBuffer data;
// TODO(chcunningham): Duration? Or better yet, should we have a unified audio/video "chunk"?
}; };
...@@ -16,5 +16,5 @@ dictionary EncodedAudioConfig { ...@@ -16,5 +16,5 @@ dictionary EncodedAudioConfig {
// Optional byte data required to initialize audio decoders such as Vorbis // Optional byte data required to initialize audio decoders such as Vorbis
// codebooks. // codebooks.
BufferSource extraData; BufferSource description;
}; };
// Copyright 2019 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_ENCODED_AUDIO_METADATA_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_ENCODED_AUDIO_METADATA_H_
#include "base/time/time.h"
namespace blink {
struct EncodedAudioMetadata {
bool key_frame = false;
base::TimeDelta timestamp;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBCODECS_ENCODED_AUDIO_METADATA_H_
...@@ -3,7 +3,10 @@ ...@@ -3,7 +3,10 @@
# found in the LICENSE file. # found in the LICENSE file.
modules_idl_files = [ modules_idl_files = [
"audio_decoder.idl",
"audio_frame.idl",
"encoded_video_chunk.idl", "encoded_video_chunk.idl",
"encoded_audio_chunk.idl",
"image_decoder.idl", "image_decoder.idl",
"video_decoder.idl", "video_decoder.idl",
"video_encoder.idl", "video_encoder.idl",
...@@ -13,13 +16,16 @@ modules_idl_files = [ ...@@ -13,13 +16,16 @@ modules_idl_files = [
] ]
modules_callback_function_idl_files = [ modules_callback_function_idl_files = [
"audio_frame_output_callback.idl",
"video_encoder_output_callback.idl", "video_encoder_output_callback.idl",
"video_frame_output_callback.idl", "video_frame_output_callback.idl",
"web_codecs_error_callback.idl", "web_codecs_error_callback.idl",
] ]
modules_dictionary_idl_files = [ modules_dictionary_idl_files = [
"audio_decoder_init.idl",
"encoded_video_config.idl", "encoded_video_config.idl",
"encoded_audio_config.idl",
"image_decoder_init.idl", "image_decoder_init.idl",
"image_frame.idl", "image_frame.idl",
"image_track.idl", "image_track.idl",
...@@ -28,6 +34,7 @@ modules_dictionary_idl_files = [ ...@@ -28,6 +34,7 @@ modules_dictionary_idl_files = [
"video_encoder_init.idl", "video_encoder_init.idl",
"video_encoder_encode_options.idl", "video_encoder_encode_options.idl",
"video_frame_init.idl", "video_frame_init.idl",
"audio_frame_init.idl",
"video_track_writer_parameters.idl", "video_track_writer_parameters.idl",
] ]
......
...@@ -14,6 +14,21 @@ interface AbortSignal : EventTarget ...@@ -14,6 +14,21 @@ interface AbortSignal : EventTarget
getter onabort getter onabort
method constructor method constructor
setter onabort setter onabort
interface AudioDecoder
attribute @@toStringTag
getter decodeQueueSize
method close
method configure
method constructor
method decode
method flush
method reset
interface AudioFrame
attribute @@toStringTag
getter buffer
getter timestamp
method close
method constructor
interface BackgroundFetchEvent : ExtendableEvent interface BackgroundFetchEvent : ExtendableEvent
attribute @@toStringTag attribute @@toStringTag
getter registration getter registration
...@@ -409,6 +424,12 @@ interface DecompressionStream ...@@ -409,6 +424,12 @@ interface DecompressionStream
getter readable getter readable
getter writable getter writable
method constructor method constructor
interface EncodedAudioChunk
attribute @@toStringTag
getter data
getter timestamp
getter type
method constructor
interface ErrorEvent : Event interface ErrorEvent : Event
attribute @@toStringTag attribute @@toStringTag
getter colno getter colno
......
...@@ -15,6 +15,21 @@ Starting worker: resources/global-interface-listing-worker.js ...@@ -15,6 +15,21 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] getter onabort [Worker] getter onabort
[Worker] method constructor [Worker] method constructor
[Worker] setter onabort [Worker] setter onabort
[Worker] interface AudioDecoder
[Worker] attribute @@toStringTag
[Worker] getter decodeQueueSize
[Worker] method close
[Worker] method configure
[Worker] method constructor
[Worker] method decode
[Worker] method flush
[Worker] method reset
[Worker] interface AudioFrame
[Worker] attribute @@toStringTag
[Worker] getter buffer
[Worker] getter timestamp
[Worker] method close
[Worker] method constructor
[Worker] interface BackgroundFetchManager [Worker] interface BackgroundFetchManager
[Worker] attribute @@toStringTag [Worker] attribute @@toStringTag
[Worker] method constructor [Worker] method constructor
...@@ -364,6 +379,12 @@ Starting worker: resources/global-interface-listing-worker.js ...@@ -364,6 +379,12 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] attribute PERSISTENT [Worker] attribute PERSISTENT
[Worker] attribute TEMPORARY [Worker] attribute TEMPORARY
[Worker] method constructor [Worker] method constructor
[Worker] interface EncodedAudioChunk
[Worker] attribute @@toStringTag
[Worker] getter data
[Worker] getter timestamp
[Worker] getter type
[Worker] method constructor
[Worker] interface ErrorEvent : Event [Worker] interface ErrorEvent : Event
[Worker] attribute @@toStringTag [Worker] attribute @@toStringTag
[Worker] getter colno [Worker] getter colno
......
...@@ -268,10 +268,25 @@ interface AudioContext : BaseAudioContext ...@@ -268,10 +268,25 @@ interface AudioContext : BaseAudioContext
method getOutputTimestamp method getOutputTimestamp
method resume method resume
method suspend method suspend
interface AudioDecoder
attribute @@toStringTag
getter decodeQueueSize
method close
method configure
method constructor
method decode
method flush
method reset
interface AudioDestinationNode : AudioNode interface AudioDestinationNode : AudioNode
attribute @@toStringTag attribute @@toStringTag
getter maxChannelCount getter maxChannelCount
method constructor method constructor
interface AudioFrame
attribute @@toStringTag
getter buffer
getter timestamp
method close
method constructor
interface AudioListener interface AudioListener
attribute @@toStringTag attribute @@toStringTag
getter forwardX getter forwardX
...@@ -2280,6 +2295,12 @@ interface ElementInternals ...@@ -2280,6 +2295,12 @@ interface ElementInternals
setter ariaValueNow setter ariaValueNow
setter ariaValueText setter ariaValueText
setter role setter role
interface EncodedAudioChunk
attribute @@toStringTag
getter data
getter timestamp
getter type
method constructor
interface EncodedVideoChunk interface EncodedVideoChunk
attribute @@toStringTag attribute @@toStringTag
getter data getter data
......
...@@ -15,6 +15,21 @@ Starting worker: resources/global-interface-listing-worker.js ...@@ -15,6 +15,21 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] getter onabort [Worker] getter onabort
[Worker] method constructor [Worker] method constructor
[Worker] setter onabort [Worker] setter onabort
[Worker] interface AudioDecoder
[Worker] attribute @@toStringTag
[Worker] getter decodeQueueSize
[Worker] method close
[Worker] method configure
[Worker] method constructor
[Worker] method decode
[Worker] method flush
[Worker] method reset
[Worker] interface AudioFrame
[Worker] attribute @@toStringTag
[Worker] getter buffer
[Worker] getter timestamp
[Worker] method close
[Worker] method constructor
[Worker] interface BackgroundFetchManager [Worker] interface BackgroundFetchManager
[Worker] attribute @@toStringTag [Worker] attribute @@toStringTag
[Worker] method constructor [Worker] method constructor
...@@ -359,6 +374,12 @@ Starting worker: resources/global-interface-listing-worker.js ...@@ -359,6 +374,12 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] getter readable [Worker] getter readable
[Worker] getter writable [Worker] getter writable
[Worker] method constructor [Worker] method constructor
[Worker] interface EncodedAudioChunk
[Worker] attribute @@toStringTag
[Worker] getter data
[Worker] getter timestamp
[Worker] getter type
[Worker] method constructor
[Worker] interface ErrorEvent : Event [Worker] interface ErrorEvent : Event
[Worker] attribute @@toStringTag [Worker] attribute @@toStringTag
[Worker] getter colno [Worker] getter colno
......
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