Rob Schonberger | 07ee123 | 2020-10-12 17:50:06 +1100 | [diff] [blame] | 1 | // Copyright 2020 The Chromium OS 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 | #ifndef ML_SODA_PROTO_MOJOM_CONVERSION_H_ |
| 6 | #define ML_SODA_PROTO_MOJOM_CONVERSION_H_ |
| 7 | |
| 8 | #include "chrome/knowledge/soda/extended_soda_api.pb.h" |
| 9 | #include "ml/mojom/soda.mojom.h" |
| 10 | |
| 11 | namespace ml { |
| 12 | chromeos::machine_learning::mojom::SpeechRecognizerEventPtr |
| 13 | SpeechRecognizerEventFromProto( |
| 14 | const speech::soda::chrome::SodaResponse& soda_response); |
| 15 | |
| 16 | bool IsStopSodaResponse( |
| 17 | const speech::soda::chrome::SodaResponse& soda_response); |
| 18 | bool IsStartSodaResponse( |
| 19 | const speech::soda::chrome::SodaResponse& soda_response); |
| 20 | bool IsShutdownSodaResponse( |
| 21 | const speech::soda::chrome::SodaResponse& soda_response); |
| 22 | |
| 23 | // Exposed to ease testing. |
| 24 | namespace internal { |
| 25 | chromeos::machine_learning::mojom::AudioLevelEventPtr AudioLevelEventFromProto( |
| 26 | const speech::soda::chrome::SodaResponse& soda_response); |
| 27 | |
| 28 | chromeos::machine_learning::mojom::PartialResultPtr PartialResultFromProto( |
| 29 | const speech::soda::chrome::SodaResponse& soda_response); |
| 30 | |
Rob Schonberger | 828bcff | 2021-01-13 10:44:01 +1100 | [diff] [blame] | 31 | chromeos::machine_learning::mojom::PartialResultPtr |
| 32 | PartialResultFromPrefetchProto( |
| 33 | const speech::soda::chrome::SodaResponse& soda_response); |
| 34 | |
Rob Schonberger | 07ee123 | 2020-10-12 17:50:06 +1100 | [diff] [blame] | 35 | chromeos::machine_learning::mojom::FinalResultPtr FinalResultFromProto( |
| 36 | const speech::soda::chrome::SodaResponse& soda_response); |
| 37 | |
| 38 | chromeos::machine_learning::mojom::EndpointerEventPtr EndpointerEventFromProto( |
| 39 | const speech::soda::chrome::SodaResponse& soda_response); |
| 40 | } // namespace internal |
| 41 | |
| 42 | } // namespace ml |
| 43 | |
| 44 | #endif // ML_SODA_PROTO_MOJOM_CONVERSION_H_ |