Niels Möller | 739fcb9 | 2016-02-29 12:11:45 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 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 | */ |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 10 | #ifndef TEST_FRAME_UTILS_H_ |
| 11 | #define TEST_FRAME_UTILS_H_ |
Niels Möller | 739fcb9 | 2016-02-29 12:11:45 | [diff] [blame] | 12 | |
pbos | c7c26a0 | 2017-01-02 16:42:32 | [diff] [blame] | 13 | #include <stdint.h> |
| 14 | |
Mirko Bonadei | d970807 | 2019-01-25 19:26:48 | [diff] [blame] | 15 | #include "api/scoped_refptr.h" |
Artem Titov | 9b73159 | 2022-10-07 13:01:32 | [diff] [blame] | 16 | #include "api/video/nv12_buffer.h" |
Niels Möller | 739fcb9 | 2016-02-29 12:11:45 | [diff] [blame] | 17 | |
| 18 | namespace webrtc { |
nisse | 115bd15 | 2016-09-30 11:14:07 | [diff] [blame] | 19 | class I420Buffer; |
Niels Möller | 739fcb9 | 2016-02-29 12:11:45 | [diff] [blame] | 20 | class VideoFrame; |
nisse | 7cc9cc0 | 2016-03-30 06:44:19 | [diff] [blame] | 21 | class VideoFrameBuffer; |
Niels Möller | 739fcb9 | 2016-02-29 12:11:45 | [diff] [blame] | 22 | namespace test { |
| 23 | |
| 24 | bool EqualPlane(const uint8_t* data1, |
| 25 | const uint8_t* data2, |
nisse | 26acec4 | 2016-04-15 10:43:39 | [diff] [blame] | 26 | int stride1, |
| 27 | int stride2, |
Niels Möller | 739fcb9 | 2016-02-29 12:11:45 | [diff] [blame] | 28 | int width, |
| 29 | int height); |
| 30 | |
nisse | 26acec4 | 2016-04-15 10:43:39 | [diff] [blame] | 31 | static inline bool EqualPlane(const uint8_t* data1, |
| 32 | const uint8_t* data2, |
| 33 | int stride, |
| 34 | int width, |
| 35 | int height) { |
| 36 | return EqualPlane(data1, data2, stride, stride, width, height); |
| 37 | } |
| 38 | |
Niels Möller | 739fcb9 | 2016-02-29 12:11:45 | [diff] [blame] | 39 | bool FramesEqual(const webrtc::VideoFrame& f1, const webrtc::VideoFrame& f2); |
| 40 | |
nisse | 7cc9cc0 | 2016-03-30 06:44:19 | [diff] [blame] | 41 | bool FrameBufsEqual(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f1, |
| 42 | const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f2); |
| 43 | |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 44 | rtc::scoped_refptr<I420Buffer> ReadI420Buffer(int width, int height, FILE*); |
nisse | 115bd15 | 2016-09-30 11:14:07 | [diff] [blame] | 45 | |
Artem Titov | 9b73159 | 2022-10-07 13:01:32 | [diff] [blame] | 46 | rtc::scoped_refptr<NV12Buffer> ReadNV12Buffer(int width, int height, FILE*); |
| 47 | |
Niels Möller | 739fcb9 | 2016-02-29 12:11:45 | [diff] [blame] | 48 | } // namespace test |
| 49 | } // namespace webrtc |
| 50 | |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 51 | #endif // TEST_FRAME_UTILS_H_ |