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

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 // 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 // Custom proto data structure
274 message RendererInitialize {
275 optional int32 client_handle = 1;
276 optional int32 audio_demuxer_handle = 2;
277 optional int32 video_demuxer_handle = 3;
278 optional int32 callback_handle = 4;
279 }
280
281 message RendererFlushUntil {
282 optional uint32 audio_frame_id = 1;
283 optional uint32 video_frame_id = 2;
284 optional int32 callback_handle = 3;
285 }
286
287 message RendererSetCdm {
288 optional int32 cdm_id = 1;
289 optional int32 callback_handle = 2;
290 }
291
292 message RendererClientOnTimeUpdate {
293 optional int64 time_usec = 1;
294 optional int64 max_time_usec = 2;
295 }
296
297 message DemuxerStreamReadUntil {
298 optional int32 callback_handle = 1;
299 optional int32 frame_id = 2;
300 }
301
302 message DemuxerStreamInitializeCallback {
303 optional int32 type = 1;
304 optional AudioDecoderConfig audio_decoder_config = 2;
305 optional VideoDecoderConfig video_decoder_config = 3;
306 }
307
308 message DemuxerStreamReadUntilCallback {
309 optional int32 status = 1;
310 optional int32 frame_id = 2;
311 optional AudioDecoderConfig audio_decoder_config = 3;
312 optional VideoDecoderConfig video_decoder_config = 4;
313 }
314
315 message CdmInitialize {
316 optional string key_system = 1;
317 optional string security_origin = 2;
318 optional bool allow_distinctive_identifier = 3;
319 optional bool allow_persistent_state = 4;
320 optional bool use_hw_secure_codecs = 5;
321 optional int32 callback_handle = 6;
322 }
323
324 message CdmSetServerCertificate {
325 optional int32 callback_handle = 1;
326 optional bytes certificate_data = 2;
327 }
328
329 message CdmCreateSessionAndGenerateRequest {
330 optional int32 session_type = 1;
331 optional int32 init_data_type = 2;
332 optional int32 callback_handle = 3;
333 optional bytes init_data = 4;
334 }
335
336 message CdmLoadSession {
337 optional int32 session_type = 1;
338 optional string session_id = 2;
339 optional int32 callback_handle = 3;
340 }
341
342 message CdmUpdateSession {
343 optional string session_id = 1;
344 optional int32 callback_handle = 2;
345 optional bytes response = 3;
346 }
347
348 message CdmCloseSession {
349 optional string session_id = 1;
350 optional int32 callback_handle = 2;
351 }
352
353 message CdmRemoveSession {
354 optional string session_id = 1;
355 optional int32 callback_handle = 2;
356 }
357
358 message CdmPromise {
359 // These two fields are used only for RPC_CDM_INITIALIZE_CALLBACK
360 optional int32 cdm_id = 1;
361 optional int32 decryptor_handle = 2;
362
363 optional string session_id = 3;
364 optional bool success = 4;
365 optional MediaKeysException exception = 5;
366 optional uint32 system_code = 6;
367 optional string error_message = 7;
368 }
369
370 message CdmClientOnSessionMessage {
371 optional string session_id = 1;
372 optional MediaKeysMessageType message_type = 2;
373 optional bytes message = 3;
374 }
375
376 message CdmClientOnSessionKeysChange {
377 optional string session_id = 1;
378 optional bool has_additional_usable_key = 2;
379 repeated CdmKeyInformation key_information = 3;
380 }
381
382 message CdmClientOnSessionExpirationUpdate {
383 optional string session_id = 1;
384 optional double new_expiry_time_sec = 2;
385 }
386
387 message RpcMessage {
388 enum RpcProc {
389 // Remoting setup
390 RPC_INTERNAL = 0;
391 RPC_ACQUIRE_RENDERER = 1;
392 RPC_ACQUIRE_RENDERER_DONE = 2;
393 RPC_ACQUIRE_CDM = 3;
394 RPC_ACQUIRE_CDM_DONE = 4;
395 // Renderer message
396 RPC_R_INITIALIZE = 1000;
397 RPC_R_FLUSHUNTIL = 1001;
398 RPC_R_STARTPLAYINGFROM = 1002;
399 RPC_R_SETPLAYBACKRATE = 1003;
400 RPC_R_SETVOLUME = 1004;
401 RPC_R_SETCDM = 1005;
402 // Renderer callbacks
403 RPC_R_INITIALIZE_CALLBACK = 1100;
404 RPC_R_FLUSHUNTIL_CALLBACK = 1101;
405 RPC_R_SETCDM_CALLBACK = 1102;
406 // Renderer client message
407 RPC_RC_ONTIMEUPDATE = 2000;
408 RPC_RC_ONBUFFERINGSTATECHANGE = 2001;
409 RPC_RC_ONENDED = 2002;
410 RPC_RC_ONERROR = 2003;
411 RPC_RC_ONVIDEONATURALSIZECHANGE = 2004;
412 RPC_RC_ONVIDEOOPACITYCHANGE = 2005;
413 RPC_RC_ONSTATISTICSUPDATE = 2006;
414 RPC_RC_ONWAITINGFORDECRYPTIONKEY = 2007;
415 RPC_RC_ONDURATIONCHANGE = 2008;
416 // DemuxerStream message
417 RPC_DS_INITIALIZE = 3000;
418 RPC_DS_READUNTIL = 3001;
419 RPC_DS_ENABLEBITSTREAMCONVERTER = 3002;
420 // DemuxerStream callbacks
421 RPC_DS_INITIALIZE_CALLBACK = 3100;
422 RPC_DS_READUNTIL_CALLBACK = 3101;
423 // ContentDecryptionModule
424 RPC_CDM_SETCLIENT = 4000;
425 RPC_CDM_INITIALIZE = 4001;
426 RPC_CDM_SETSERVERCERTIFICATE = 4002;
427 RPC_CDM_CREATESESSIONANDGENERATEREQUEST = 4003;
428 RPC_CDM_LOADSESSION = 4004;
429 RPC_CDM_UPDATESESSION = 4005;
430 RPC_CDM_CLOSESESSION = 4006;
431 RPC_CDM_REMOVESESSION = 4007;
432 // ContentDecryptionModule callbacks
433 RPC_CDM_INITIALIZE_CALLBACK = 4100;
434 RPC_CDM_SETSERVERCERTIFICATE_CALLBACK = 4101;
435 RPC_CDM_CREATESESSIONANDGENERATEREQUEST_CALLBACK = 4102;
436 RPC_CDM_LOADSESSION_CALLBACK = 4103;
437 RPC_CDM_UPDATESESSION_CALLBACK = 4104;
438 RPC_CDM_CLOSESESSION_CALLBACK = 4105;
439 RPC_CDM_REMOVESESSION_CALLBACK = 4106;
440 // ContentDecryptionModule client
441 RPC_CDMC_ONSESSIONMESSAGE = 5000;
442 RPC_CDMC_ONSESSIONCLOSED = 5001;
443 RPC_CDMC_ONSESSIONKEYSCHANGE = 5002;
444 RPC_CDMC_ONSESSIONEXPIRATIONUPDATE = 5003;
445 };
446
447 // Component base of RPC message handle. This allows both sender and receiver
448 // to send or handle message in desired individual components.
449 optional int32 handle = 1;
450
451 // RpcProc of this RPC message
452 optional RpcProc proc = 2;
453
454 oneof rpc_oneof {
455 // For simple RPC which only passes one parameters can use the following
456 // various data type variables without using specific proto data structure.
457 // RPC_ACQUIRE_RENDERER
458 // RPC_ACQUIRE_RENDERER_DONE
459 // RPC_ACQUIRE_CDM
460 // RPC_ACQUIRE_CDM_DONE
461 // RPC_RC_ONBUFFERINGSTATECHANGE
462 // RPC_DS_INITIALIZE_CALLBACK
463 // RPC_DS_READ
464 // RPC_CDM_SETCLIENT
465 int32 integer_value = 3;
466
467 // RPC_R_STARTPLAYINGFROM
468 // RPC_RC_ONDURATIONCHANGE
469 int64 integer64_value = 4;
470
471 // RPC_R_SETPLAYBACKRATE
472 // RPC_R_SETVOLUME
473 double double_value = 5;
474
475 // RPC_R_INITIALIZE_CALLBACK
476 // RPC_R_SETCDM_CALLBACK
477 // RPC_RC_ONVIDEOOPACITYCHANGE
478 bool boolean_value = 6;
479
480 // string only:
481 // RPC_CDMC_ONSESSIONCLOSED
482 string string_value = 7;
483
484 // RPC_R_INITIALIZE
485 RendererInitialize renderer_initialize_rpc = 100;
486
487 // RPC_R_FLUSHUNTIL
488 RendererFlushUntil renderer_flushuntil_rpc = 101;
489
490 // RPC_R_SETCDM
491 RendererSetCdm renderer_set_cdm_rpc = 102;
492
493 // RPC_RC_ONTIMEUPDATE
494 RendererClientOnTimeUpdate rendererclient_ontimeupdate_rpc = 200;
495 // RPC_RC_ONVIDEONATURALSIZECHANGE
496 Size rendererclient_onvideonatualsizechange_rpc = 201;
497 // RPC_RC_ONSTATISTICSUPDATE
498 PipelineStatistics rendererclient_onstatisticsupdate_rpc = 202;
499
500 // RPC_DS_READUNTIL
501 DemuxerStreamReadUntil demuxerstream_readuntil_rpc = 300;
502
503 // RPC_DS_INITIALIZE_CALLBACK
504 DemuxerStreamInitializeCallback demuxerstream_initializecb_rpc = 400;
505 // RPC_DS_READUNTIL_CALLBACK
506 DemuxerStreamReadUntilCallback demuxerstream_readuntilcb_rpc = 401;
507
508 // RPC_CDM_INITIALIZE
509 CdmInitialize cdm_initialize_rpc = 500;
510 // RPC_CDM_SETSERVERCERTIFICATE
511 CdmSetServerCertificate cdm_setservercertificate_rpc = 501;
512 // RPC_CDM_CREATESESSIONANDGENERATEREQUEST
513 CdmCreateSessionAndGenerateRequest cdm_createsessionandgeneraterequest_rpc =
514 502;
515 // RPC_CDM_LOADSESSION
516 CdmLoadSession cdm_loadsession_rpc = 503;
517 // RPC_CDM_UPDATESESSION
518 CdmUpdateSession cdm_updatesession_rpc = 504;
519 // RPC_CDM_CLOSESESSION
520 CdmCloseSession cdm_closesession_rpc = 505;
521 // RPC_CDM_REMOVESESSION
522 CdmRemoveSession cdm_removesession_rpc = 506;
523
524 // CdmPromise message type used for the following procedure
525 // RPC_CDM_INITIALIZE_CALLBACK
526 // RPC_CDM_SETSERVERCERTIFICATE_CALLBACK
527 // RPC_CDM_CREATESESSIONANDGENERATEREQUEST_CALLBACK
528 // RPC_CDM_LOADSESSION_CALLBACK
529 // RPC_CDM_UPDATESESSION_CALLBACK
530 // RPC_CDM_CLOSESESSION_CALLBACK
531 // RPC_CDM_REMOVESESSION_CALLBACK
532 CdmPromise cdm_promise_rpc = 600;
533
534 // RPC_CDMC_ONSESSIONMESSAGE
535 CdmClientOnSessionMessage cdmclient_onsessionmessage_rpc = 601;
536 // RPC_CDMC_ONSESSIONKEYSCHANGE
537 CdmClientOnSessionKeysChange cdmclient_onsessionkeychange_rpc = 602;
538 // RPC_CDMC_ONSESSIONEXPIRATIONUPDATE
539 CdmClientOnSessionExpirationUpdate cdmclient_onsessionexpirationupdate_rpc =
540 603;
541 };
542 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698