| // 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. |
| |
| syntax = "proto2"; |
| |
| package wc_fuzzer; |
| |
| 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; |
| } |
| optional EncoderAccelerationPreference acceleration = 2; |
| |
| optional uint64 bitrate = 3; |
| |
| optional double framerate = 4; |
| |
| optional uint32 width = 5; |
| |
| optional uint32 height = 6; |
| } |
| |
| 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 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 bytes data = 4; |
| } |
| |
| // Mix of args to VideoFrame constructor. |
| // TODO(sandersd): Define a new Init type when PlanesInit constructor lands. |
| message VideoFrameBitmapInit { |
| optional uint64 timestamp = 1; |
| |
| optional uint64 duration = 2; |
| |
| optional uint32 bitmap_width = 3; |
| |
| optional bytes rgb_bitmap = 4; |
| } |
| |
| message EncodeVideo { |
| optional VideoFrameBitmapInit frame = 1; |
| |
| message EncodeOptions { optional bool key_frame = 1; } |
| optional EncodeOptions options = 2; |
| } |
| |
| 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 DecodeImage { |
| optional uint32 frame_index = 1; |
| optional bool complete_frames_only = 2; |
| } |
| |
| message DecodeMetadata {} |
| |
| message SelectTrack { |
| required uint32 track_id = 1; |
| } |
| |
| message ImageDecoderApiInvocation { |
| oneof Api { |
| DecodeImage decode_image = 1; |
| DecodeMetadata decode_metadata = 2; |
| SelectTrack select_track = 3; |
| } |
| } |
| |
| message ImageBitmapOptions { |
| enum ImageOrientation { |
| ORIENTATION_NONE = 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; |
| 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; |
| } |