| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 switch (value) { | 94 switch (value) { |
| 95 CASE_RETURN_OTHER(kUnknownSampleFormat); | 95 CASE_RETURN_OTHER(kUnknownSampleFormat); |
| 96 CASE_RETURN_OTHER(kSampleFormatU8); | 96 CASE_RETURN_OTHER(kSampleFormatU8); |
| 97 CASE_RETURN_OTHER(kSampleFormatS16); | 97 CASE_RETURN_OTHER(kSampleFormatS16); |
| 98 CASE_RETURN_OTHER(kSampleFormatS32); | 98 CASE_RETURN_OTHER(kSampleFormatS32); |
| 99 CASE_RETURN_OTHER(kSampleFormatF32); | 99 CASE_RETURN_OTHER(kSampleFormatF32); |
| 100 CASE_RETURN_OTHER(kSampleFormatPlanarS16); | 100 CASE_RETURN_OTHER(kSampleFormatPlanarS16); |
| 101 CASE_RETURN_OTHER(kSampleFormatPlanarF32); | 101 CASE_RETURN_OTHER(kSampleFormatPlanarF32); |
| 102 CASE_RETURN_OTHER(kSampleFormatPlanarS32); | 102 CASE_RETURN_OTHER(kSampleFormatPlanarS32); |
| 103 CASE_RETURN_OTHER(kSampleFormatS24); | 103 CASE_RETURN_OTHER(kSampleFormatS24); |
| 104 CASE_RETURN_OTHER(kSampleFormatAc3); |
| 105 CASE_RETURN_OTHER(kSampleFormatEac3); |
| 104 } | 106 } |
| 105 return base::nullopt; // Not a 'default' to ensure compile-time checks. | 107 return base::nullopt; // Not a 'default' to ensure compile-time checks. |
| 106 } | 108 } |
| 107 | 109 |
| 108 base::Optional<pb::AudioDecoderConfig::SampleFormat> | 110 base::Optional<pb::AudioDecoderConfig::SampleFormat> |
| 109 ToProtoAudioDecoderConfigSampleFormat(::media::SampleFormat value) { | 111 ToProtoAudioDecoderConfigSampleFormat(::media::SampleFormat value) { |
| 110 using OriginType = ::media::SampleFormat; | 112 using OriginType = ::media::SampleFormat; |
| 111 using OtherType = pb::AudioDecoderConfig; | 113 using OtherType = pb::AudioDecoderConfig; |
| 112 switch (value) { | 114 switch (value) { |
| 113 CASE_RETURN_OTHER(kUnknownSampleFormat); | 115 CASE_RETURN_OTHER(kUnknownSampleFormat); |
| 114 CASE_RETURN_OTHER(kSampleFormatU8); | 116 CASE_RETURN_OTHER(kSampleFormatU8); |
| 115 CASE_RETURN_OTHER(kSampleFormatS16); | 117 CASE_RETURN_OTHER(kSampleFormatS16); |
| 116 CASE_RETURN_OTHER(kSampleFormatS32); | 118 CASE_RETURN_OTHER(kSampleFormatS32); |
| 117 CASE_RETURN_OTHER(kSampleFormatF32); | 119 CASE_RETURN_OTHER(kSampleFormatF32); |
| 118 CASE_RETURN_OTHER(kSampleFormatPlanarS16); | 120 CASE_RETURN_OTHER(kSampleFormatPlanarS16); |
| 119 CASE_RETURN_OTHER(kSampleFormatPlanarF32); | 121 CASE_RETURN_OTHER(kSampleFormatPlanarF32); |
| 120 CASE_RETURN_OTHER(kSampleFormatPlanarS32); | 122 CASE_RETURN_OTHER(kSampleFormatPlanarS32); |
| 121 CASE_RETURN_OTHER(kSampleFormatS24); | 123 CASE_RETURN_OTHER(kSampleFormatS24); |
| 124 CASE_RETURN_OTHER(kSampleFormatAc3); |
| 125 CASE_RETURN_OTHER(kSampleFormatEac3); |
| 122 } | 126 } |
| 123 return base::nullopt; // Not a 'default' to ensure compile-time checks. | 127 return base::nullopt; // Not a 'default' to ensure compile-time checks. |
| 124 } | 128 } |
| 125 | 129 |
| 126 base::Optional<::media::ChannelLayout> ToMediaChannelLayout( | 130 base::Optional<::media::ChannelLayout> ToMediaChannelLayout( |
| 127 pb::AudioDecoderConfig::ChannelLayout value) { | 131 pb::AudioDecoderConfig::ChannelLayout value) { |
| 128 using OriginType = pb::AudioDecoderConfig; | 132 using OriginType = pb::AudioDecoderConfig; |
| 129 using OtherType = ::media::ChannelLayout; | 133 using OtherType = ::media::ChannelLayout; |
| 130 switch (value) { | 134 switch (value) { |
| 131 CASE_RETURN_OTHER(CHANNEL_LAYOUT_NONE); | 135 CASE_RETURN_OTHER(CHANNEL_LAYOUT_NONE); |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 switch (value) { | 580 switch (value) { |
| 577 CASE_RETURN_OTHER(kOk); | 581 CASE_RETURN_OTHER(kOk); |
| 578 CASE_RETURN_OTHER(kAborted); | 582 CASE_RETURN_OTHER(kAborted); |
| 579 CASE_RETURN_OTHER(kConfigChanged); | 583 CASE_RETURN_OTHER(kConfigChanged); |
| 580 } | 584 } |
| 581 return base::nullopt; // Not a 'default' to ensure compile-time checks. | 585 return base::nullopt; // Not a 'default' to ensure compile-time checks. |
| 582 } | 586 } |
| 583 | 587 |
| 584 } // namespace remoting | 588 } // namespace remoting |
| 585 } // namespace media | 589 } // namespace media |
| OLD | NEW |