blob: eb93383f5a8bb2aa5fe8b2c6773e4b60db815412 [file] [log] [blame]
Andrew MacDonaldcb05b722015-05-08 05:17:511/*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 04:47:3111#ifndef MODULES_AUDIO_PROCESSING_TEST_PROTOBUF_UTILS_H_
12#define MODULES_AUDIO_PROCESSING_TEST_PROTOBUF_UTILS_H_
Andrew MacDonaldcb05b722015-05-08 05:17:5113
kwiberg62eaacf2016-02-17 14:39:0514#include <memory>
Sonia-Florina Horchidanb75d14c2019-08-12 07:57:0115#include <sstream> // no-presubmit-check TODO(webrtc:8982)
kwiberg62eaacf2016-02-17 14:39:0516
Mirko Bonadei92ea95e2017-09-15 04:47:3117#include "rtc_base/protobuf_utils.h"
kwiberg77eab702016-09-29 00:42:0118
Björn Tereliusefeeba02023-10-31 14:44:5019// Generated at build-time by the protobuf compiler.
Mirko Bonadei92ea95e2017-09-15 04:47:3120#include "modules/audio_processing/debug.pb.h"
Andrew MacDonaldcb05b722015-05-08 05:17:5121
22namespace webrtc {
23
kwiberg62eaacf2016-02-17 14:39:0524// Allocates new memory in the unique_ptr to fit the raw message and returns the
Andrew MacDonaldcb05b722015-05-08 05:17:5125// number of bytes read.
kwiberg62eaacf2016-02-17 14:39:0526size_t ReadMessageBytesFromFile(FILE* file, std::unique_ptr<uint8_t[]>* bytes);
Andrew MacDonaldcb05b722015-05-08 05:17:5127
28// Returns true on success, false on error or end-of-file.
mbonadei7c2c8432017-04-07 07:59:1229bool ReadMessageFromFile(FILE* file, MessageLite* msg);
Andrew MacDonaldcb05b722015-05-08 05:17:5130
Sonia-Florina Horchidanb75d14c2019-08-12 07:57:0131// Returns true on success, false on error or end of string stream.
32bool ReadMessageFromString(
33 std::stringstream* input, // no-presubmit-check TODO(webrtc:8982)
34 MessageLite* msg);
35
Andrew MacDonaldcb05b722015-05-08 05:17:5136} // namespace webrtc
37
Mirko Bonadei92ea95e2017-09-15 04:47:3138#endif // MODULES_AUDIO_PROCESSING_TEST_PROTOBUF_UTILS_H_