2016-02-29 13:11:45 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef TEST_FRAME_UTILS_H_
|
|
|
|
|
#define TEST_FRAME_UTILS_H_
|
2016-02-29 13:11:45 +01:00
|
|
|
|
2017-01-02 08:42:32 -08:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
2019-01-25 20:26:48 +01:00
|
|
|
#include "api/scoped_refptr.h"
|
2022-10-07 15:01:32 +02:00
|
|
|
#include "api/video/nv12_buffer.h"
|
2016-02-29 13:11:45 +01:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
2016-09-30 04:14:07 -07:00
|
|
|
class I420Buffer;
|
2016-02-29 13:11:45 +01:00
|
|
|
class VideoFrame;
|
2016-03-29 23:44:19 -07:00
|
|
|
class VideoFrameBuffer;
|
2016-02-29 13:11:45 +01:00
|
|
|
namespace test {
|
|
|
|
|
|
|
|
|
|
bool EqualPlane(const uint8_t* data1,
|
|
|
|
|
const uint8_t* data2,
|
2016-04-15 03:43:39 -07:00
|
|
|
int stride1,
|
|
|
|
|
int stride2,
|
2016-02-29 13:11:45 +01:00
|
|
|
int width,
|
|
|
|
|
int height);
|
|
|
|
|
|
2016-04-15 03:43:39 -07:00
|
|
|
static inline bool EqualPlane(const uint8_t* data1,
|
|
|
|
|
const uint8_t* data2,
|
|
|
|
|
int stride,
|
|
|
|
|
int width,
|
|
|
|
|
int height) {
|
|
|
|
|
return EqualPlane(data1, data2, stride, stride, width, height);
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-29 13:11:45 +01:00
|
|
|
bool FramesEqual(const webrtc::VideoFrame& f1, const webrtc::VideoFrame& f2);
|
|
|
|
|
|
2016-03-29 23:44:19 -07:00
|
|
|
bool FrameBufsEqual(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f1,
|
|
|
|
|
const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f2);
|
|
|
|
|
|
2018-06-19 15:03:05 +02:00
|
|
|
rtc::scoped_refptr<I420Buffer> ReadI420Buffer(int width, int height, FILE*);
|
2016-09-30 04:14:07 -07:00
|
|
|
|
2022-10-07 15:01:32 +02:00
|
|
|
rtc::scoped_refptr<NV12Buffer> ReadNV12Buffer(int width, int height, FILE*);
|
|
|
|
|
|
2016-02-29 13:11:45 +01:00
|
|
|
} // namespace test
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // TEST_FRAME_UTILS_H_
|