OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/remoting/rpc/proto_enum_utils.h" | 5 #include "media/remoting/rpc/proto_enum_utils.h" |
6 | 6 |
7 namespace media { | 7 namespace media { |
8 namespace remoting { | 8 namespace remoting { |
9 | 9 |
10 #define CASE_RETURN_OTHER(x) \ | 10 #define CASE_RETURN_OTHER(x) \ |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 CASE_RETURN_OTHER(EXPIRED); | 449 CASE_RETURN_OTHER(EXPIRED); |
450 CASE_RETURN_OTHER(OUTPUT_RESTRICTED); | 450 CASE_RETURN_OTHER(OUTPUT_RESTRICTED); |
451 CASE_RETURN_OTHER(OUTPUT_DOWNSCALED); | 451 CASE_RETURN_OTHER(OUTPUT_DOWNSCALED); |
452 CASE_RETURN_OTHER(KEY_STATUS_PENDING); | 452 CASE_RETURN_OTHER(KEY_STATUS_PENDING); |
453 CASE_RETURN_OTHER(RELEASED); | 453 CASE_RETURN_OTHER(RELEASED); |
454 } | 454 } |
455 return base::nullopt; // Not a 'default' to ensure compile-time checks. | 455 return base::nullopt; // Not a 'default' to ensure compile-time checks. |
456 } | 456 } |
457 | 457 |
458 base::Optional<::media::CdmPromise::Exception> ToCdmPromiseException( | 458 base::Optional<::media::CdmPromise::Exception> ToCdmPromiseException( |
459 pb::MediaKeysException value) { | 459 pb::CdmException value) { |
460 using OriginType = pb::MediaKeysException; | 460 using OriginType = pb::CdmException; |
461 using OtherType = ::media::CdmPromise; | 461 using OtherType = ::media::CdmPromise; |
462 switch (value) { | 462 switch (value) { |
463 CASE_RETURN_OTHER(NOT_SUPPORTED_ERROR); | 463 CASE_RETURN_OTHER(NOT_SUPPORTED_ERROR); |
464 CASE_RETURN_OTHER(INVALID_STATE_ERROR); | 464 CASE_RETURN_OTHER(INVALID_STATE_ERROR); |
465 CASE_RETURN_OTHER(INVALID_ACCESS_ERROR); | 465 CASE_RETURN_OTHER(INVALID_ACCESS_ERROR); |
466 CASE_RETURN_OTHER(QUOTA_EXCEEDED_ERROR); | 466 CASE_RETURN_OTHER(QUOTA_EXCEEDED_ERROR); |
467 CASE_RETURN_OTHER(UNKNOWN_ERROR); | 467 CASE_RETURN_OTHER(UNKNOWN_ERROR); |
468 CASE_RETURN_OTHER(CLIENT_ERROR); | 468 CASE_RETURN_OTHER(CLIENT_ERROR); |
469 CASE_RETURN_OTHER(OUTPUT_ERROR); | 469 CASE_RETURN_OTHER(OUTPUT_ERROR); |
470 } | 470 } |
471 return base::nullopt; // Not a 'default' to ensure compile-time checks. | 471 return base::nullopt; // Not a 'default' to ensure compile-time checks. |
472 } | 472 } |
473 | 473 |
474 base::Optional<pb::MediaKeysException> ToProtoMediaKeysException( | 474 base::Optional<pb::CdmException> ToProtoCdmException( |
475 ::media::CdmPromise::Exception value) { | 475 ::media::CdmPromise::Exception value) { |
476 using OriginType = ::media::CdmPromise; | 476 using OriginType = ::media::CdmPromise; |
477 using OtherType = pb::MediaKeysException; | 477 using OtherType = pb::CdmException; |
478 switch (value) { | 478 switch (value) { |
479 CASE_RETURN_OTHER(NOT_SUPPORTED_ERROR); | 479 CASE_RETURN_OTHER(NOT_SUPPORTED_ERROR); |
480 CASE_RETURN_OTHER(INVALID_STATE_ERROR); | 480 CASE_RETURN_OTHER(INVALID_STATE_ERROR); |
481 CASE_RETURN_OTHER(INVALID_ACCESS_ERROR); | 481 CASE_RETURN_OTHER(INVALID_ACCESS_ERROR); |
482 CASE_RETURN_OTHER(QUOTA_EXCEEDED_ERROR); | 482 CASE_RETURN_OTHER(QUOTA_EXCEEDED_ERROR); |
483 CASE_RETURN_OTHER(UNKNOWN_ERROR); | 483 CASE_RETURN_OTHER(UNKNOWN_ERROR); |
484 CASE_RETURN_OTHER(CLIENT_ERROR); | 484 CASE_RETURN_OTHER(CLIENT_ERROR); |
485 CASE_RETURN_OTHER(OUTPUT_ERROR); | 485 CASE_RETURN_OTHER(OUTPUT_ERROR); |
486 } | 486 } |
487 return base::nullopt; // Not a 'default' to ensure compile-time checks. | 487 return base::nullopt; // Not a 'default' to ensure compile-time checks. |
488 } | 488 } |
489 | 489 |
490 base::Optional<::media::MediaKeys::MessageType> ToMediaMediaKeysMessageType( | 490 base::Optional<::media::ContentDecryptionModule::MessageType> |
491 pb::MediaKeysMessageType value) { | 491 ToMediaCdmMessageType(pb::CdmMessageType value) { |
492 using OriginType = pb::MediaKeysMessageType; | 492 using OriginType = pb::CdmMessageType; |
493 using OtherType = ::media::MediaKeys; | 493 using OtherType = ::media::ContentDecryptionModule; |
494 switch (value) { | 494 switch (value) { |
495 CASE_RETURN_OTHER(LICENSE_REQUEST); | 495 CASE_RETURN_OTHER(LICENSE_REQUEST); |
496 CASE_RETURN_OTHER(LICENSE_RENEWAL); | 496 CASE_RETURN_OTHER(LICENSE_RENEWAL); |
497 CASE_RETURN_OTHER(LICENSE_RELEASE); | 497 CASE_RETURN_OTHER(LICENSE_RELEASE); |
498 } | 498 } |
499 return base::nullopt; // Not a 'default' to ensure compile-time checks. | 499 return base::nullopt; // Not a 'default' to ensure compile-time checks. |
500 } | 500 } |
501 | 501 |
502 base::Optional<pb::MediaKeysMessageType> ToProtoMediaKeysMessageType( | 502 base::Optional<pb::CdmMessageType> ToProtoCdmMessageType( |
503 ::media::MediaKeys::MessageType value) { | 503 ::media::ContentDecryptionModule::MessageType value) { |
504 using OriginType = ::media::MediaKeys; | 504 using OriginType = ::media::ContentDecryptionModule; |
505 using OtherType = pb::MediaKeysMessageType; | 505 using OtherType = pb::CdmMessageType; |
506 switch (value) { | 506 switch (value) { |
507 CASE_RETURN_OTHER(LICENSE_REQUEST); | 507 CASE_RETURN_OTHER(LICENSE_REQUEST); |
508 CASE_RETURN_OTHER(LICENSE_RENEWAL); | 508 CASE_RETURN_OTHER(LICENSE_RENEWAL); |
509 CASE_RETURN_OTHER(LICENSE_RELEASE); | 509 CASE_RETURN_OTHER(LICENSE_RELEASE); |
510 } | 510 } |
511 return base::nullopt; // Not a 'default' to ensure compile-time checks. | 511 return base::nullopt; // Not a 'default' to ensure compile-time checks. |
512 } | 512 } |
513 | 513 |
514 base::Optional<::media::MediaKeys::SessionType> ToMediaKeysSessionType( | 514 base::Optional<::media::ContentDecryptionModule::SessionType> ToCdmSessionType( |
515 pb::MediaKeysSessionType value) { | 515 pb::CdmSessionType value) { |
516 using OriginType = pb::MediaKeysSessionType; | 516 using OriginType = pb::CdmSessionType; |
517 using OtherType = ::media::MediaKeys; | 517 using OtherType = ::media::ContentDecryptionModule; |
518 switch (value) { | 518 switch (value) { |
519 CASE_RETURN_OTHER(TEMPORARY_SESSION); | 519 CASE_RETURN_OTHER(TEMPORARY_SESSION); |
520 CASE_RETURN_OTHER(PERSISTENT_LICENSE_SESSION); | 520 CASE_RETURN_OTHER(PERSISTENT_LICENSE_SESSION); |
521 CASE_RETURN_OTHER(PERSISTENT_RELEASE_MESSAGE_SESSION); | 521 CASE_RETURN_OTHER(PERSISTENT_RELEASE_MESSAGE_SESSION); |
522 } | 522 } |
523 return base::nullopt; // Not a 'default' to ensure compile-time checks. | 523 return base::nullopt; // Not a 'default' to ensure compile-time checks. |
524 } | 524 } |
525 | 525 |
526 base::Optional<pb::MediaKeysSessionType> ToProtoMediaKeysSessionType( | 526 base::Optional<pb::CdmSessionType> ToProtoCdmSessionType( |
527 ::media::MediaKeys::SessionType value) { | 527 ::media::ContentDecryptionModule::SessionType value) { |
528 using OriginType = ::media::MediaKeys; | 528 using OriginType = ::media::ContentDecryptionModule; |
529 using OtherType = pb::MediaKeysSessionType; | 529 using OtherType = pb::CdmSessionType; |
530 switch (value) { | 530 switch (value) { |
531 CASE_RETURN_OTHER(TEMPORARY_SESSION); | 531 CASE_RETURN_OTHER(TEMPORARY_SESSION); |
532 CASE_RETURN_OTHER(PERSISTENT_LICENSE_SESSION); | 532 CASE_RETURN_OTHER(PERSISTENT_LICENSE_SESSION); |
533 CASE_RETURN_OTHER(PERSISTENT_RELEASE_MESSAGE_SESSION); | 533 CASE_RETURN_OTHER(PERSISTENT_RELEASE_MESSAGE_SESSION); |
534 } | 534 } |
535 return base::nullopt; // Not a 'default' to ensure compile-time checks. | 535 return base::nullopt; // Not a 'default' to ensure compile-time checks. |
536 } | 536 } |
537 | 537 |
538 base::Optional<::media::EmeInitDataType> ToMediaEmeInitDataType( | 538 base::Optional<::media::EmeInitDataType> ToMediaEmeInitDataType( |
539 pb::CdmCreateSessionAndGenerateRequest::EmeInitDataType value) { | 539 pb::CdmCreateSessionAndGenerateRequest::EmeInitDataType value) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 switch (value) { | 580 switch (value) { |
581 CASE_RETURN_OTHER(kOk); | 581 CASE_RETURN_OTHER(kOk); |
582 CASE_RETURN_OTHER(kAborted); | 582 CASE_RETURN_OTHER(kAborted); |
583 CASE_RETURN_OTHER(kConfigChanged); | 583 CASE_RETURN_OTHER(kConfigChanged); |
584 } | 584 } |
585 return base::nullopt; // Not a 'default' to ensure compile-time checks. | 585 return base::nullopt; // Not a 'default' to ensure compile-time checks. |
586 } | 586 } |
587 | 587 |
588 } // namespace remoting | 588 } // namespace remoting |
589 } // namespace media | 589 } // namespace media |
OLD | NEW |