1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496
|
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
package wc_fuzzer;
message AllowSharedBufferSource {
// Note: length is capped in the fuzzer to avoid OOM.
optional uint32 length = 1;
optional bool shared = 2;
enum ViewType {
NONE = 0;
INT8 = 1;
UINT32 = 2;
DATA = 3;
}
optional ViewType view_type = 3;
optional uint32 view_offset = 4;
optional uint32 view_length = 5;
// Transfer ArrayBuffer into ctor
optional bool transfer = 6;
}
message DOMRectInit {
optional double x = 1;
optional double y = 2;
optional double width = 3;
optional double height = 4;
}
message PlaneLayout {
optional uint32 offset = 1;
optional uint32 stride = 2;
}
message VideoFrameCopyToOptions {
optional DOMRectInit rect = 1;
repeated PlaneLayout layout = 2;
}
message VideoColorSpaceInit {
enum VideoColorPrimaries {
VCP_BT709 = 0;
VCP_BT470BG = 1;
VCP_SMPTE170M = 2;
VCP_BT2020 = 3;
VCP_SMPTE432 = 4;
}
optional VideoColorPrimaries primaries = 1;
enum VideoTransferCharacteristics {
VTC_BT709 = 0;
VTC_SMPTE170M = 1;
VTC_IEC61966_2_1 = 2;
VTC_LINEAR = 3;
VTC_PQ = 4;
VTC_HLG = 5;
}
optional VideoTransferCharacteristics transfer = 2;
enum VideoMatrixCoefficients {
VMC_RGB = 0;
VMC_BT709 = 1;
VMC_BT470BG = 2;
VMC_SMPTE170M = 3;
VMC_BT2020_NCL = 4;
}
optional VideoMatrixCoefficients matrix = 3;
optional bool full_range = 4;
}
message VideoFrameBufferInit {
enum VideoPixelFormat {
I420 = 0;
I420A = 1;
I444 = 2;
NV12 = 3;
RGBA = 4;
RGBX = 5;
BGRA = 6;
BGRX = 7;
}
optional VideoPixelFormat format = 1;
repeated PlaneLayout layout = 2;
optional int64 timestamp = 3;
optional uint64 duration = 4;
optional uint32 coded_width = 5;
optional uint32 coded_height = 6;
optional DOMRectInit visible_rect = 7;
optional uint32 display_width = 8;
optional uint32 display_height = 9;
optional VideoColorSpaceInit color_space = 10;
}
message VideoFrameBufferInitInvocation {
required AllowSharedBufferSource data = 1;
required VideoFrameBufferInit init = 2;
}
message ConfigureVideoDecoder {
// String describing codec (e.g. "vp09.00.10.08")
optional string codec = 1;
optional bytes description = 2;
}
message ConfigureVideoEncoder {
// String describing codec (e.g. "vp09.00.10.08")
optional string codec = 1;
enum EncoderAccelerationPreference {
ALLOW = 0;
DENY = 1;
REQUIRE = 2;
}
enum ScalabilityMode {
L1T1 = 0;
L1T2 = 1;
L1T3 = 2;
}
enum LatencyMode {
QUALITY = 0;
REALTIME = 1;
}
enum ContentHint {
NONE = 0;
MOTION = 1;
DETAIL = 2;
TEXT = 3;
}
enum VideoEncoderBitrateMode {
CONSTANT = 0;
VARIABLE = 1;
QUANTIZER = 2;
}
enum AlphaOption {
KEEP = 0;
DISCARD = 1;
}
optional EncoderAccelerationPreference acceleration = 2;
optional uint64 bitrate = 3;
optional double framerate = 4;
optional uint32 width = 5;
optional uint32 height = 6;
optional uint32 display_width = 7;
optional uint32 display_height = 8;
optional ScalabilityMode scalability_mode = 9;
optional VideoEncoderBitrateMode bitrate_mode = 10;
optional LatencyMode latency_mode = 11;
optional AlphaOption alpha = 12;
optional ContentHint content_hint = 13;
}
message ConfigureAudioDecoder {
// String describing codec (e.g. "opus")
optional string codec = 1;
optional uint32 sample_rate = 2;
optional uint32 number_of_channels = 3;
optional bytes description = 4;
}
enum AacFormat {
AAC = 0;
ADTS = 1;
}
enum BitrateMode {
VARIABLE = 0;
CONSTANT = 1;
}
message AacEncoderConfig {
optional AacFormat format = 1;
}
enum OpusSignal {
AUTO = 0;
MUSIC = 1;
VOICE = 2;
}
enum OpusApplication {
VOIP = 0;
AUDIO = 1;
LOWDELAY = 2;
}
message OpusEncoderConfig {
optional uint64 frame_duration = 1;
optional uint32 complexity = 2;
optional uint32 packetlossperc = 3;
optional bool useinbandfec = 4;
optional bool usedtx = 5;
optional OpusSignal signal = 6;
optional OpusApplication application = 7;
}
message ConfigureAudioEncoder {
// String describing codec (e.g. "opus")
optional string codec = 1;
optional uint32 sample_rate = 2;
optional uint32 number_of_channels = 3;
optional uint64 bitrate = 4;
optional AacEncoderConfig aac = 5;
optional OpusEncoderConfig opus = 6;
optional BitrateMode bitrate_mode = 7;
}
enum EncodedChunkType {
KEY = 0;
DELTA = 1;
}
message EncodedVideoChunk {
optional EncodedChunkType type = 1;
optional uint64 timestamp = 2;
optional uint64 duration = 3;
optional bytes data = 4;
}
message EncodedAudioChunk {
optional EncodedChunkType type = 1;
optional uint64 timestamp = 2;
optional uint64 duration = 3;
optional bytes data = 4;
}
// Mix of args to VideoFrame constructor.
message VideoFrameBitmapInit {
optional uint64 timestamp = 1;
optional uint64 duration = 2;
optional uint32 bitmap_width = 3;
optional bytes rgb_bitmap = 4;
}
enum AudioSampleFormat {
U8 = 0;
S16 = 1;
S32 = 2;
F32 = 3;
U8_PLANAR = 4;
S16_PLANAR = 5;
S32_PLANAR = 6;
F32_PLANAR = 7;
}
message AudioDataInit {
optional uint64 timestamp = 1;
optional uint32 length = 2;
optional uint32 sample_rate = 3;
repeated bytes channels = 4;
required AudioSampleFormat format = 5;
// Transfer ArrayBuffer into ctor
optional bool transfer = 6;
}
message EncodeVideo {
oneof Frames {
VideoFrameBitmapInit frame = 1;
VideoFrameBufferInitInvocation frame_from_buffer = 3;
}
message EncodeOptionsForAv1 {
optional uint32 quantizer = 1;
};
message EncodeOptionsForVp9 {
optional uint32 quantizer = 1;
};
message EncodeOptions {
optional bool key_frame = 1;
optional EncodeOptionsForAv1 av1 = 2;
optional EncodeOptionsForVp9 vp9 = 3;
}
optional EncodeOptions options = 2;
}
message EncodeAudio {
optional AudioDataInit data = 1;
}
message DecodeVideo {
optional EncodedVideoChunk chunk = 1;
}
message DecodeAudio {
optional EncodedAudioChunk chunk = 1;
}
message Flush {
optional bool wait_for_promise = 1;
}
message Reset {}
message Close {}
message VideoDecoderApiInvocation {
oneof Api {
ConfigureVideoDecoder configure = 1;
DecodeVideo decode = 2;
Flush flush = 3;
Reset reset = 4;
Close close = 5;
}
}
message VideoDecoderApiInvocationSequence {
repeated VideoDecoderApiInvocation invocations = 1;
}
message AudioDecoderApiInvocation {
oneof Api {
ConfigureAudioDecoder configure = 1;
DecodeAudio decode = 2;
Flush flush = 3;
Reset reset = 4;
Close close = 5;
}
}
message AudioDecoderApiInvocationSequence {
repeated AudioDecoderApiInvocation invocations = 1;
}
message VideoEncoderApiInvocation {
oneof Api {
ConfigureVideoEncoder configure = 1;
EncodeVideo encode = 2;
Flush flush = 3;
Reset reset = 4;
Close close = 5;
}
}
message VideoEncoderApiInvocationSequence {
repeated VideoEncoderApiInvocation invocations = 1;
}
message AudioEncoderApiInvocation {
oneof Api {
ConfigureAudioEncoder configure = 1;
EncodeAudio encode = 2;
Flush flush = 3;
Reset reset = 4;
Close close = 5;
}
}
message AudioEncoderApiInvocationSequence {
repeated AudioEncoderApiInvocation invocations = 1;
}
message DecodeImage {
optional uint32 frame_index = 1;
optional bool complete_frames_only = 2;
}
message DecodeMetadata {}
message SelectTrack {
required uint32 track_id = 1;
optional bool selected = 2 [default = true];
}
message ImageDecoderApiInvocation {
oneof Api {
DecodeImage decode_image = 1;
DecodeMetadata decode_metadata = 2 [deprecated = true];
SelectTrack select_track = 3;
}
}
message ImageBitmapOptions {
enum ImageOrientation {
ORIENTATION_FROM_IMAGE = 0;
FLIPY = 1;
}
enum PremultiplyAlpha {
PREMULTIPLY_NONE = 0;
PREMULTIPLY = 1;
PREMULTIPLY_DEFAULT = 2;
}
enum ColorSpaceConversion {
CS_NONE = 0;
CS_DEFAULT = 1;
}
enum ResizeQuality {
PIXELATED = 0;
LOW = 1;
MEDIUM = 2;
HIGH = 3;
}
optional ImageOrientation image_orientation = 1;
optional PremultiplyAlpha premultiply_alpha = 2 [deprecated = true];
optional ColorSpaceConversion color_space_conversion = 3;
optional uint32 resize_width = 4;
optional uint32 resize_height = 5;
optional ResizeQuality resize_quality = 6;
}
message ConfigureImageDecoder {
required bytes data = 1;
required string type = 2;
optional ImageBitmapOptions options = 3;
optional bool prefer_animation = 4;
}
message ImageDecoderApiInvocationSequence {
required ConfigureImageDecoder config = 1;
repeated ImageDecoderApiInvocation invocations = 2;
}
message VideoFrameCopyToInvocation {
required AllowSharedBufferSource destination = 1;
optional VideoFrameCopyToOptions options = 2;
}
message VideoFrameCopyToCase {
// TODO(sandersd): Support other kinds of frames.
required VideoFrameBufferInitInvocation video_frame = 1;
// TODO(sandersd): Support multiple concurrent operations, optional waiting,
// close(), etc.
required VideoFrameCopyToInvocation copy_to = 2;
}
message AudioDataCopyToOptions {
required uint32 plane_index = 1;
optional uint32 frame_offset = 2;
optional uint32 frame_count = 3;
optional AudioSampleFormat format = 4;
}
message AudioDataCopyToInvocation {
required AllowSharedBufferSource destination = 1;
required AudioDataCopyToOptions options = 2;
}
message AudioDataCopyToCase {
required AudioDataInit audio_data = 1;
// TODO(chcunningham): Support multiple concurrent operations, optional
// waiting, close(), etc.
required AudioDataCopyToInvocation copy_to = 2;
}
|