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

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

Powered by Google App Engine
This is Rietveld 408576698