Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(578)

Side by Side Diff: media/remoting/proto/remoting_rpc_message.proto

Issue 2261503002: Define remote playback proto buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add OWNERS file Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // Protocol buffer for Media Remoting.
6
7 syntax = "proto2";
8
9 option optimize_for = LITE_RUNTIME;
10
11 package media.remoting.pb;
12
13 enum RpcProc {
14 // Remoting setup
15 RPC_INTERNAL = 0;
16 RPC_ACQUIRE_RENDERER = 1;
17 RPC_ACQUIRE_RENDERER_DONE = 2;
18 RPC_ACQUIRE_CDM = 3;
19 RPC_ACQUIRE_CDM_DONE = 4;
20 // Renderer message
21 RPC_R_INITIALIZE = 1000;
22 RPC_R_FLUSHUNTIL = 1001;
23 RPC_R_STARTPLAYINGFROM = 1002;
24 RPC_R_SETPLAYBACKRATE = 1003;
25 RPC_R_SETVOLUME = 1004;
26 RPC_R_SETCDM = 1005;
27 RPC_R_INITIALIZE_CALLBACK = 1100;
28 RPC_R_FLUSHUNTIL_CALLBACK = 1101;
29 RPC_R_SETCDM_CALLBACK = 1102;
30 // Renderer client message
31 RPC_RC_ONTIMEUPDATE = 2000;
32 RPC_RC_ONBUFFERINGSTATECHANGE = 2001;
33 RPC_RC_ONENDED = 2002;
34 RPC_RC_ONERROR = 2003;
35 RPC_RC_ONVIDEONATURALSIZECHANGE = 2004;
36 RPC_RC_ONVIDEOOPACITYCHANGE = 2005;
37 // DemuxerStream message
38 RPC_DS_INITIALIZE = 3000;
39 RPC_DS_READUNTIL = 3001;
40 RPC_DS_ENABLEBITSTREAMCONVERTER = 3002;
41 // DemuxerStream callbacks
42 RPC_DS_INITIALIZE_CALLBACK = 3100;
43 RPC_DS_READUNTIL_CALLBACK = 3101;
44 // ContentDecryptionModule
45 RPC_CDM_SETCLIENT = 4000;
46 RPC_CDM_INITIALIZE = 4001;
47 RPC_CDM_SETSERVERCERTIFICATE = 4002;
48 RPC_CDM_CREATESESSIONANDGENERATEREQUEST = 4003;
49 RPC_CDM_LOADSESSION = 4004;
50 RPC_CDM_UPDATESESSION = 4005;
51 RPC_CDM_CLOSESESSION = 4006;
52 RPC_CDM_REMOVESESSION = 4007;
53 // ContentDecryptionModule callbacks
54 RPC_CDM_INITIALIZE_CALLBACK = 4100;
55 RPC_CDM_SETSERVERCERTIFICATE_CALLBACK = 4101;
56 RPC_CDM_CREATESESSIONANDGENERATEREQUEST_CALLBACK = 4102;
57 RPC_CDM_LOADSESSION_CALLBACK = 4103;
58 RPC_CDM_UPDATESESSION_CALLBACK = 4104;
59 RPC_CDM_CLOSESESSION_CALLBACK = 4105;
60 RPC_CDM_REMOVESESSION_CALLBACK = 4106;
61 // ContentDecryptionModule client
62 RPC_CDMC_ONSESSIONMESSAGE = 5000;
63 RPC_CDMC_ONSESSIONCLOSED = 5001;
64 RPC_CDMC_ONSESSIONKEYSCHANGE = 5002;
65 RPC_CDMC_ONSESSIONEXPIRATIONUPDATE = 5003;
66 };
67
68 // DecoderBuffer information which will be sent using RTP packets. The actual
69 // decoder buffer is not included in this proto data structure.
70 message DecoderBuffer {
71 optional int64 timestamp_usec = 1;
72 optional int64 duration_usec = 2;
73 optional bool is_key_frame = 3;
74 optional DecryptConfig decrypt_config = 4;
75 optional int64 front_discard_usec = 5;
76 optional int64 back_discard_usec = 6;
77 optional int64 splice_timestamp_usec = 7;
78 optional bytes side_data = 8;
79 // To distinguish from valid 0-length buffers
80 optional bool is_eos = 9;
81 }
82
83 // Utility proto data structure
84 message Size {
85 optional int32 width = 1;
86 optional int32 height = 2;
87 }
88
89 message EncryptionScheme {
90 // Align with EncryptionScheme::CipherMode
91 enum CipherMode {
92 CIPHER_MODE_UNENCRYPTED = 0;
93 CIPHER_MODE_AES_CTR = 1;
94 CIPHER_MODE_AES_CBC = 2;
95 }
96
97 optional CipherMode mode = 1;
98 optional uint32 encrypt_blocks = 2;
99 optional uint32 skip_blocks = 3;
100 }
101
102 message AudioDecoderConfig {
103 // Should align with ::media::Codec
104 enum Codec {
105 kUnknownAudioCodec = 0;
106 kCodecAAC = 1;
107 kCodecMP3 = 2;
108 kCodecPCM = 3;
109 kCodecVorbis = 4;
110 kCodecFLAC = 5;
111 kCodecAMR_NB = 6;
112 kCodecAMR_WB = 7;
113 kCodecPCM_MULAW = 8;
114 kCodecGSM_MS = 9;
115 kCodecPCM_S16BE = 10;
116 kCodecPCM_S24BE = 11;
117 kCodecOpus = 12;
118 kCodecEAC3 = 13;
119 kCodecPCM_ALAW = 14;
120 kCodecALAC = 15;
121 kCodecAC3 = 16;
122 }
123
124 // Should align with ::media::SampleFormat
125 enum SampleFormat {
126 kUnknownSampleFormat = 0;
127 kSampleFormatU8 = 1;
128 kSampleFormatS16 = 2;
129 kSampleFormatS32 = 3;
130 kSampleFormatF32 = 4;
131 kSampleFormatPlanarS16 = 5;
132 kSampleFormatPlanarF32 = 6;
133 kSampleFormatPlanarS32 = 7;
134 kSampleFormatS24 = 8;
135 };
136
137 // Should align with ::media::ChannelLayout
138 enum ChannelLayout {
139 CHANNEL_LAYOUT_NONE = 0;
140 CHANNEL_LAYOUT_UNSUPPORTED = 1;
141 CHANNEL_LAYOUT_MONO = 2;
142 CHANNEL_LAYOUT_STEREO = 3;
143 CHANNEL_LAYOUT_2_1 = 4;
144 CHANNEL_LAYOUT_SURROUND = 5;
145 CHANNEL_LAYOUT_4_0 = 6;
146 CHANNEL_LAYOUT_2_2 = 7;
147 CHANNEL_LAYOUT_QUAD = 8;
148 CHANNEL_LAYOUT_5_0 = 9;
149 CHANNEL_LAYOUT_5_1 = 10;
150 CHANNEL_LAYOUT_5_0_BACK = 11;
151 CHANNEL_LAYOUT_5_1_BACK = 12;
152 CHANNEL_LAYOUT_7_0 = 13;
153 CHANNEL_LAYOUT_7_1 = 14;
154 CHANNEL_LAYOUT_7_1_WIDE = 15;
155 CHANNEL_LAYOUT_STEREO_DOWNMIX = 16;
156 CHANNEL_LAYOUT_2POINT1 = 17;
157 CHANNEL_LAYOUT_3_1 = 18;
158 CHANNEL_LAYOUT_4_1 = 19;
159 CHANNEL_LAYOUT_6_0 = 20;
160 CHANNEL_LAYOUT_6_0_FRONT = 21;
161 CHANNEL_LAYOUT_HEXAGONAL = 22;
162 CHANNEL_LAYOUT_6_1 = 23;
163 CHANNEL_LAYOUT_6_1_BACK = 24;
164 CHANNEL_LAYOUT_6_1_FRONT = 25;
165 CHANNEL_LAYOUT_7_0_FRONT = 26;
166 CHANNEL_LAYOUT_7_1_WIDE_BACK = 27;
167 CHANNEL_LAYOUT_OCTAGONAL = 28;
168 CHANNEL_LAYOUT_DISCRETE = 29;
169 CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC = 30;
170 CHANNEL_LAYOUT_4_1_QUAD_SIDE = 31;
171 };
172
173 optional Codec codec = 1;
174 optional EncryptionScheme encryption_scheme = 2;
175 optional SampleFormat sample_format = 3;
176 optional ChannelLayout channel_layout = 4;
177 optional int32 samples_per_second = 5;
178 optional int64 seek_preroll_usec = 6;
179 optional int32 codec_delay = 7;
180 optional bytes extra_data = 8;
181 }
182
183 message Rect {
184 optional int32 x = 1;
185 optional int32 y = 2;
186 optional int32 width = 3;
187 optional int32 height = 4;
188 }
189
190 message VideoDecoderConfig {
191 // Should align with ::media::VideoCodec
192 enum Codec {
193 kUnknownVideoCodec = 0;
194 kCodecH264 = 1;
195 kCodecVC1 = 2;
196 kCodecMPEG2 = 3;
197 kCodecMPEG4 = 4;
198 kCodecTheora = 5;
199 kCodecVP8 = 6;
200 kCodecVP9 = 7;
201 kCodecHEVC = 8;
202 }
203
204 // Should align with ::media::VideoCodecProfile
205 enum Profile {
206 VIDEO_CODEC_PROFILE_UNKNOWN = -1;
207 H264PROFILE_BASELINE = 0;
208 H264PROFILE_MAIN = 1;
209 H264PROFILE_EXTENDED = 2;
210 H264PROFILE_HIGH = 3;
211 H264PROFILE_HIGH10PROFILE = 4;
212 H264PROFILE_HIGH422PROFILE = 5;
213 H264PROFILE_HIGH444PREDICTIVEPROFILE = 6;
214 H264PROFILE_SCALABLEBASELINE = 7;
215 H264PROFILE_SCALABLEHIGH = 8;
216 H264PROFILE_STEREOHIGH = 9;
217 H264PROFILE_MULTIVIEWHIGH = 10;
218 VP8PROFILE_ANY = 11;
219 VP9PROFILE_PROFILE0 = 12;
220 VP9PROFILE_PROFILE1 = 13;
221 VP9PROFILE_PROFILE2 = 14;
222 VP9PROFILE_PROFILE3 = 15;
223 HEVCPROFILE_MAIN = 16;
224 HEVCPROFILE_MAIN10 = 17;
225 HEVCPROFILE_MAIN_STILL_PICTURE = 18;
226 };
227
228 // Should align with ::media::VideoPixelFormat
229 enum Format {
230 PIXEL_FORMAT_UNKNOWN = 0;
231 PIXEL_FORMAT_I420 = 1;
232 PIXEL_FORMAT_YV12 = 2;
233 PIXEL_FORMAT_YV16 = 3;
234 PIXEL_FORMAT_YV12A = 4;
235 PIXEL_FORMAT_YV24 = 5;
236 PIXEL_FORMAT_NV12 = 6;
237 PIXEL_FORMAT_NV21 = 7;
238 PIXEL_FORMAT_UYVY = 8;
239 PIXEL_FORMAT_YUY2 = 9;
240 PIXEL_FORMAT_ARGB = 10;
241 PIXEL_FORMAT_XRGB = 11;
242 PIXEL_FORMAT_RGB24 = 12;
243 PIXEL_FORMAT_RGB32 = 13;
244 PIXEL_FORMAT_MJPEG = 14;
245 PIXEL_FORMAT_MT21 = 15;
246 PIXEL_FORMAT_YUV420P9 = 16;
247 PIXEL_FORMAT_YUV420P10 = 17;
248 PIXEL_FORMAT_YUV422P9 = 18;
249 PIXEL_FORMAT_YUV422P10 = 19;
250 PIXEL_FORMAT_YUV444P9 = 20;
251 PIXEL_FORMAT_YUV444P10 = 21;
252 };
253
254 // Should align with ::media::ColorSpace
255 enum ColorSpace {
256 COLOR_SPACE_UNSPECIFIED = 0;
257 COLOR_SPACE_JPEG = 1;
258 COLOR_SPACE_HD_REC709 = 2;
259 COLOR_SPACE_SD_REC601 = 3;
260 };
261
262 optional Codec codec = 1;
263 optional EncryptionScheme encryption_scheme = 2;
264 optional Profile profile = 3;
265 optional Format format = 4;
266 optional ColorSpace color_space = 5;
267 optional Size coded_size = 6;
268 optional Rect visible_rect = 7;
269 optional Size natural_size = 8;
270 optional bytes extra_data = 9;
271 }
272
273 message DecryptConfig {
274 message SubSample {
275 optional uint32 clear_bytes = 1;
276 optional uint32 cypher_bytes = 2;
277 }
278
279 optional bytes key_id = 1;
280 optional bytes iv = 2;
281 repeated SubSample sub_samples = 3;
282 }
283
284 message CdmKeyInformation {
285 // Align with CdmKeyInformation::KeyStatus
286 enum KeyStatus {
287 USABLE = 0;
288 INTERNAL_ERROR = 1;
289 EXPIRED = 2;
290 OUTPUT_RESTRICTED = 3;
291 OUTPUT_DOWNSCALED = 4;
292 KEY_STATUS_PENDING = 5;
293 RELEASED = 6;
294 }
295
296 optional bytes key_id = 1;
297 optional KeyStatus status = 2;
298 optional uint32 system_code = 3;
299 }
300
301 // Should align with MediaKeys::Exception
302 enum MediaKeysException {
303 NOT_SUPPORTED_ERROR = 0;
304 INVALID_STATE_ERROR = 1;
305 INVALID_ACCESS_ERROR = 2;
306 QUOTA_EXCEEDED_ERROR = 3;
307 UNKNOWN_ERROR = 4;
308 CLIENT_ERROR = 5;
309 OUTPUT_ERROR = 6;
310 }
311
312 // Should align with MediaKeys::MessageType
313 enum MediaKeysMessageType {
314 LICENSE_REQUEST = 0;
315 LICENSE_RENEWAL = 1;
316 LICENSE_RELEASE = 2;
317 }
318
319 // Custom proto data structure
320 message RendererInitialize {
321 optional int32 client_handle = 1;
322 optional int32 audio_demuxer_handle = 2;
323 optional int32 video_demuxer_handle = 3;
324 optional int32 callback_handle = 4;
325 }
326
327 message RendererFlushUntil {
328 optional uint32 audio_frame_id = 1;
329 optional uint32 video_frame_id = 2;
330 optional int32 callback_handle = 3;
331 }
332
333 message RendererStartPlayingFrom {
334 optional int64 time_delta_usec = 1;
335 }
336
337 message RendererSetCdm {
338 optional int32 cdm_id = 1;
339 optional int32 callback_handle = 2;
340 }
341
342 message RendererClientOnTimeUpdate {
343 optional int64 time_usec = 1;
344 optional int64 max_time_usec = 2;
345 }
346
347 message DemuxerStreamReadUntil {
348 optional int32 callback_handle = 1;
349 optional int32 frame_id = 2;
350 }
351
352 message DemuxerStreamInitializeCallback {
353 optional int32 type = 1;
354 optional AudioDecoderConfig audio_decoder_config = 2;
355 optional VideoDecoderConfig video_decoder_config = 3;
356 }
357
358 message DemuxerStreamReadUntilCallback {
359 optional int32 status = 1;
360 optional int32 frame_id = 2;
361 optional AudioDecoderConfig audio_decoder_config = 3;
362 optional VideoDecoderConfig video_decoder_config = 4;
363 }
364
365 message CdmInitialize {
366 optional string key_system = 1;
367 optional string security_origin = 2;
368 optional bool allow_distinctive_identifier = 3;
369 optional bool allow_persistent_state = 4;
370 optional bool use_hw_secure_codecs = 5;
371 optional int32 callback_handle = 6;
372 }
373
374 message CdmSetServerCertificate {
375 optional int32 callback_handle = 1;
376 optional bytes certificate_data = 2;
377 }
378
379 message CdmCreateSessionAndGenerateRequest {
380 optional int32 session_type = 1;
381 optional int32 init_data_type = 2;
382 optional int32 callback_handle = 3;
383 optional bytes init_data = 4;
384 }
385
386 message CdmLoadSession {
387 optional int32 session_type = 1;
388 optional string session_id = 2;
389 optional int32 callback_handle = 3;
390 }
391
392 message CdmUpdateSession {
393 optional string session_id = 1;
394 optional int32 callback_handle = 2;
395 optional bytes response = 3;
396 }
397
398 message CdmCloseSession {
399 optional string session_id = 1;
400 optional int32 callback_handle = 2;
401 }
402
403 message CdmRemoveSession {
404 optional string session_id = 1;
405 optional int32 callback_handle = 2;
406 }
407
408 message CdmPromise {
409 // These two fields are used only for RPC_CDM_INITIALIZE_CALLBACK
410 optional int32 cdm_id = 1;
411 optional int32 decryptor_handle = 2;
412
413 optional string session_id = 3;
414 optional bool success = 4;
415 optional MediaKeysException exception = 5;
416 optional uint32 system_code = 6;
417 optional string error_message = 7;
418 }
419
420 message CdmClientOnSessionMessage {
421 optional string session_id = 1;
422 optional MediaKeysMessageType message_type = 2;
423 optional bytes message = 3;
424 }
425
426 message CdmClientOnSessionKeysChange {
427 optional string session_id = 1;
428 optional bool has_additional_usable_key = 2;
429 repeated CdmKeyInformation key_information = 3;
430 }
431
432 message CdmClientOnSessionExpirationUpdate {
433 optional string session_id = 1;
434 optional double new_expiry_time_sec = 2;
435 }
436
437 message RpcMessage {
438 // Handle of this RPC message
439 optional int32 handle = 1;
440
441 // RpcProc of this RPC message
442 optional RpcProc proc = 2;
443
444 oneof rpc_oneof {
445 // For simple RPC which only passes one parameters can use the following
446 // various data type variables without using specific proto data structure.
447 // RPC_ACQUIRE_RENDERER
448 // RPC_ACQUIRE_RENDERER_DONE
449 // RPC_ACQUIRE_CDM
450 // RPC_ACQUIRE_CDM_DONE
451 // RPC_RC_ONBUFFERINGSTATECHANGE
452 // RPC_DS_INITIALIZE_CALLBACK
453 // RPC_DS_READ
454 // RPC_CDM_SETCLIENT
455 int32 integer_value = 3;
456
457 // RPC_R_SETPLAYBACKRATE
458 // RPC_R_SETVOLUME
459 double double_value = 4;
460
461 // RPC_R_INITIALIZE_CALLBACK
462 // RPC_R_SETCDM_CALLBACK
463 // RPC_RC_ONVIDEOOPACITYCHANGE
464 bool boolean_value = 5;
465
466 // string only:
467 // RPC_CDMC_ONSESSIONCLOSED
468 string string_value = 6;
469
470 // RPC_R_INITIALIZE
471 RendererInitialize renderer_initialize_rpc = 100;
472
473 // RPC_R_FLUSHUNTIL
474 RendererFlushUntil renderer_flushuntil_rpc = 101;
475
476 // RPC_R_STARTPLAYINGFROM
477 RendererStartPlayingFrom renderer_startplayingfrom_rpc = 102;
478
479 // RPC_R_SETCDM
480 RendererSetCdm renderer_set_cdm_rpc = 103;
481
482 // RPC_RC_ONTIMEUPDATE
483 RendererClientOnTimeUpdate rendererclient_ontimeupdate_rpc = 200;
484 // RPC_RC_ONVIDEONATURALSIZECHANGE
485 Size rendererclient_onvideonatualsizechange_rpc = 201;
486
487 // RPC_DS_READUNTIL
488 DemuxerStreamReadUntil demuxerstream_readuntil_rpc = 300;
489
490 // RPC_DS_INITIALIZE_CALLBACK
491 DemuxerStreamInitializeCallback demuxerstream_initializecb_rpc = 400;
492 // RPC_DS_READUNTIL_CALLBACK
493 DemuxerStreamReadUntilCallback demuxerstream_readuntilcb_rpc = 401;
494
495 // RPC_CDM_INITIALIZE
496 CdmInitialize cdm_initialize_rpc = 500;
497 // RPC_CDM_SETSERVERCERTIFICATE
498 CdmSetServerCertificate cdm_setservercertificate_rpc = 501;
499 // RPC_CDM_CREATESESSIONANDGENERATEREQUEST
500 CdmCreateSessionAndGenerateRequest cdm_createsessionandgeneraterequest_rpc =
501 502;
502 // RPC_CDM_LOADSESSION
503 CdmLoadSession cdm_loadsession_rpc = 503;
504 // RPC_CDM_UPDATESESSION
505 CdmUpdateSession cdm_updatesession_rpc = 504;
506 // RPC_CDM_CLOSESESSION
507 CdmCloseSession cdm_closesession_rpc = 505;
508 // RPC_CDM_REMOVESESSION
509 CdmRemoveSession cdm_removesession_rpc = 506;
510
511 // CdmPromise message type used for the following procedure
512 // RPC_CDM_INITIALIZE_CALLBACK
513 // RPC_CDM_SETSERVERCERTIFICATE_CALLBACK
514 // RPC_CDM_CREATESESSIONANDGENERATEREQUEST_CALLBACK
515 // RPC_CDM_LOADSESSION_CALLBACK
516 // RPC_CDM_UPDATESESSION_CALLBACK
517 // RPC_CDM_CLOSESESSION_CALLBACK
518 // RPC_CDM_REMOVESESSION_CALLBACK
519 CdmPromise cdm_promise_rpc = 600;
520
521 // RPC_CDMC_ONSESSIONMESSAGE
522 CdmClientOnSessionMessage cdmclient_onsessionmessage_rpc = 601;
523 // RPC_CDMC_ONSESSIONKEYSCHANGE
524 CdmClientOnSessionKeysChange cdmclient_onsessionkeychange_rpc = 602;
525 // RPC_CDMC_ONSESSIONEXPIRATIONUPDATE
526 CdmClientOnSessionExpirationUpdate cdmclient_onsessionexpirationupdate_rpc =
527 603;
528 };
529 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698