summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/webcodecs/fuzzer_inputs.proto
blob: 15db4fca68fefb5bb87aa33ca396351289d9cbc5 (plain)
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
// 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;
}