blob: 9eafb6dfa144642cae598baa80f94ed144f77494 [file] [log] [blame]
Rob Schonberger07ee1232020-10-12 17:50:06 +11001// 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
11namespace ml {
12chromeos::machine_learning::mojom::SpeechRecognizerEventPtr
13SpeechRecognizerEventFromProto(
14 const speech::soda::chrome::SodaResponse& soda_response);
15
16bool IsStopSodaResponse(
17 const speech::soda::chrome::SodaResponse& soda_response);
18bool IsStartSodaResponse(
19 const speech::soda::chrome::SodaResponse& soda_response);
20bool IsShutdownSodaResponse(
21 const speech::soda::chrome::SodaResponse& soda_response);
22
23// Exposed to ease testing.
24namespace internal {
25chromeos::machine_learning::mojom::AudioLevelEventPtr AudioLevelEventFromProto(
26 const speech::soda::chrome::SodaResponse& soda_response);
27
28chromeos::machine_learning::mojom::PartialResultPtr PartialResultFromProto(
29 const speech::soda::chrome::SodaResponse& soda_response);
30
Rob Schonberger828bcff2021-01-13 10:44:01 +110031chromeos::machine_learning::mojom::PartialResultPtr
32PartialResultFromPrefetchProto(
33 const speech::soda::chrome::SodaResponse& soda_response);
34
Rob Schonberger07ee1232020-10-12 17:50:06 +110035chromeos::machine_learning::mojom::FinalResultPtr FinalResultFromProto(
36 const speech::soda::chrome::SodaResponse& soda_response);
37
38chromeos::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_