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

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

Powered by Google App Engine
This is Rietveld 408576698